[R] Problems Creating an R package

Thomas Petzoldt thpe at hhbio.wasser.tu-dresden.de
Thu Jun 29 17:39:59 CEST 2006


Hi Aarti

src/  if you have source files in C or Fortran.
R/    for the R sources.

If you have no C or Fortran files, you should delete the src/ directory.

The syntax error in your R function is simply that the "," is on a new
line so R "thinks" that the line above is complete.

Hope it helps

Thomas P.


Aarti Dahiya wrote:
> Hi all,
> 
> When I check my package using "Rcmd check ..\myPackage\R.mykg" on Windows in 
> Command Prompt, this is what get:-
> 
> * using log directory 'C:/R/bin/R.getdata.Rcheck'
> * using Version 2.3.1 (2006-06-01)
> * checking for file 'R.getdata/DESCRIPTION' ... OK
> * checking extension type ... Package
> * this is package 'R.getdata' version '1.0'
> * checking package dependencies ... OK
> * checking if this is a source package ... OK
> * checking whether package 'R.getdata' can be installed ... OK
> * checking package directory ... OK
> * checking for portable file names ... OK
> * checking DESCRIPTION meta-information ... OK
> * checking top-level files ... OK
> * checking index information ... OK
> * checking package subdirectories ... WARNING
> Subdirectory 'src' contains no source files.
> * checking R files for syntax errors ... ERROR
> Syntax error in file 'R/ConnectionFactory.R'
> 
> Q1. What should I put in 'src'.  I did put two of my source .R files, it 
> still does not work.
> 
> Q2. This is what I get if I source R/ConnectionFactory.R.
> Error in parse(file, n = -1, NULL, "?") : syntax error at
> 5: }
> 6: , .env = <
> 
> These are the contents of R/ConnectionFactory.R.
> 
> "ConnectionFactory" <-
> structure(function()
> {
> 	extend(Object(), "ConnectionFactory")
> }
> , .env = <environment>, class = c("Class", "Object"), ...instanciationTime = 


> structure(1151521420.604, class = c("POSIXt",
> "POSIXct")), formals = c("public", "class"), modifiers = c("public",
> "class")
> 
> Please note that this file is one that was automatically generated in 
> R.mykg/R.  My source file ConnectionFactory.R has the actual R code which 
> sources just fine.
> 
> I will greatly appreciate any help!  Thank you.
> 
> Aarti
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list