When i try to knit a .Rmd file to PDF (or html or word) in RStudio i get the following error: could not find function "head" Execution halted What do i do? Thanks in advance!
Asked
Active
Viewed 425 times
-1
-
It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. `head` is a base R function so it should be available. Perhaps you have some code in the wrong place somewhere? Can you show us a minimal document that recreates the error for you? – MrFlick May 04 '22 at 16:23
1 Answers
0
Have you made sure you are loading the utils package in a code chunk?
```{r load-packages, include=FALSE}
library(utils)```

Kayjay
- 31
- 2
-
Since utils is a base package I have not encountered this problem before, but without any sample code I would suggest ensuring that the rmd is loading in the utils package which contains the 'head' function. – Kayjay May 04 '22 at 16:30