could not find function "knitr"

I am very new to R. I was asked to install/update a series of packages which went ok. However, one of the users is reporting they can't find knitr. The command they execute is: knitr("generalizedPredictionWrapper.Rmd")

What I checked:
.Rprofile
I installed into /opt/Rpackages
u/g are root:root
permissions look ok

/opt/Rpackages/knitr/bin:
total 4
-rwxr-xr-x 1 root root 950 Feb 28 13:28 knit

.Rprofile is:

.libPaths("/opt/Rpackages")

cat(".Rprofile: Setting UK repository\n")
r = getOption("repos") # hard code the UK repo for CRAN
r["CRAN"] = "http://cran.uk.r-project.org"
options(repos = r)
rm(r)

lib paths are:

.libPaths()
[1] "/opt/Rpackages" "/usr/local/lib/R/site-library"
[3] "/usr/lib64/R/library" "/usr/share/R/library"

what am I missing?
thanks!

knitr is the package name but the function you want is knit()

library(knitr)
knit("generalizedPredictionWrapper.Rmd")
2 Likes

knitr is the name of the package, there is no knitr() function. I imagine you're looking for knit().

many thanks to the both of you. Now I can move onto the next problem :wink:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.