I have tried to upload the Hmisc and gmodel tools so that I can use the Describe and CrossTable functions on a datapack, and have downloaded RTools, used the studio to upload and extract the zips, and uploaded them as shown below
> install.packages(c("gmodels", "Hmisc"))
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing packages into ‘C:/Users/Robin/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependencies ‘gtools’, ‘gdata’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/gtools_3.8.2.zip'
Content type 'application/zip' length 336453 bytes (328 KB)
downloaded 328 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/gdata_2.18.0.zip'
Content type 'application/zip' length 1264605 bytes (1.2 MB)
downloaded 1.2 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/gmodels_2.18.1.zip'
Content type 'application/zip' length 114469 bytes (111 KB)
downloaded 111 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/Hmisc_4.4-0.zip'
Content type 'application/zip' length 3168038 bytes (3.0 MB)
downloaded 3.0 MB
package ‘gtools’ successfully unpacked and MD5 sums checked
package ‘gdata’ successfully unpacked and MD5 sums checked
package ‘gmodels’ successfully unpacked and MD5 sums checked
package ‘Hmisc’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Robin\AppData\Local\Temp\RtmpKApZlC\downloaded_packages
> CrossTable(COPD$copd)
Error in CrossTable(COPD$copd) : could not find function "CrossTable"
> package.install("gmodels")
Error in package.install("gmodels") :
could not find function "package.install"
> install.packages("C:/Users/Robin/AppData/Local/Temp/RtmpKApZlC/downloaded_packages/Hmisc_4.4-0.zip", repos = NULL, type = "win.binary")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Robin/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
package ‘Hmisc’ successfully unpacked and MD5 sums checked
However, when I run the Describe function after doing that, I get this:
describe(COPD)
Error in describe(COPD) : could not find function "describe"
What have I done wrong, and how can I rectify it?