简体   繁体   中英

Install own R package via function in R

When I build my own package in RStudio I click on "Install and restart" in the Build-tab. I'm wondering if I could do this via a function. I've seen that some code is running ( meinpaket is the package's name):

Rcmd.exe INSTALL --no-multiarch --with-keep.source meinpaket

So I've tried the following:

system("Rcmd.exe INSTALL --no-multiarch --with-keep.source meinpaket")

I've tried it with shell , too.

I get the following error message:

Warning: invalid package 'meinpaket' Error: ERROR: no packages specified

You can zip your package (use the "build from source" command in RStudio to do the whole process including help and vignetts) and then install.packages() pointing to the zip file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM