Search notes:

R function: head

# Show first six elements
#
# Compare with -> tail()
#
# S.a. ../examples/having_a_look_at_data.R
#

head (1:100)
# [1] 1 2 3 4 5 6

head (1:100, n=3)
# [1] 1 2 3

head (1:100, n=-95)
# [1] 1 2 3 4 5

df <- data.frame(
   foo = 1:10,
   bar = LETTERS[1:10],
   baz = c('*', '!', '#', '?', ',', '/', '=', '+', '<', ')')
)

head(df, n=4)
#   foo bar baz
# 1   1   A   *
# 2   2   B   !
# 3   3   C   #
# 4   4   D   ?
Github repository about-r, path: /functions/head.R

See also

tail
Exploring R objects
Index to (some) R functions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758201011, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/functions/head(71): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78