I just tried out Roxygen package. Within R, I can run through the example in the Roxygen Vignette. But In command line, R CMD roxygen
is not recognized as a valid command. When I run R CMD --help
, I can see all INSTALL, check, ...sweave..., config...
command items but not roxygen. can anyone help me out of this? is there addtional installation steps required other than install.packages("roxygen")
? I use windows 32 with R 2.12.0 and working Rtools environments. Thanks.
If I recall, you have to install packages from source in order for them to be able to provide additional commands for R CMD
. This is because installing new R CMD
commands is a bit of a hack---it requires hijacking the configure script or Makefile and having them copy files to the R bin folder. Installing a package from binary simply unpacks an archive, configure
and make
are never run.
So try install.packages('roxygen', type='source')
. On Windows you will need to install the RTools before this will work.
I just ran into this the other day. I installed as administrator and that fixed it. Just run R as Administrator then do install.packages as normal, then restart R since you don't really want to run it as administrator.
This is a workaround that I have found to be useful working with roxygen2
from the command line (DOS) in Windows. Much of the material is borrowed from here.
Create file roxy.R
with contents:
library(methods)
library(utils)
require(roxygen2)
roxygenize("myPackage")
(Or whatever arguments you're using with roxygen
).
Then create batch file f.bat
with contents:
Rscript roxy.R
Then run f
from the command line:
> f
Notes:
Make sure Rscript.exe
is in your path. It's usually found somewhere like c:\r:\bin\
(To edit the path in Windows, right click 'My Computer', then select 'Properties' then 'Advanced system settings' (on left menu) then 'Advanced' tab, 'Environment Variables' button, 'System variables', 'Path'.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With