helloworld.r
#!/usr/bin/Rscript
ds1 = data.frame(1,2,3,4,5,6,7,8,9)
install.packages("caTools", dependencies=TRUE)
str(ds1)
输出:
-bash-4.1$ ./helloworld.r
Installing package into ‘/usr/lib64/R/library’ (as ‘lib’ is unspecified)
Warning in install.packages("caTools", dependencies = TRUE) :
'lib = "/usr/lib64/R/library"' is not writable
Error in install.packages("caTools", dependencies = TRUE) :
unable to install packages
Execution halted