Skip to content

Unexpected input while building package in R

4 messages · R. Michael Weylandt, Mercier Eloi, abhisarihan

#
I am a newbie in R, and I am trying to build an R package but I keep getting
an unexpected input error when I try using the build, check or install
commands. I used the following command to generate the skeleton:

package.skeleton("test")
After this I went to the command prompt and to the directory with the test
folder and ran the command:

R CMD build test
I got the following error message:

Error: 37:1: unexpected input
37: 
     ^
I even tried the check and INSTALL commands on the package and got the same
error. I tried googling the error code and the error message but it seems
like I should not be getting such an error while building the package
itself. Everywhere I checked it seemed like simply typing that command in
command prompt should work. I am wondering if anyone knows what I am doing
wrong? Thanks for the help.

I am using R 2.15.0 on Windows 7.

--
View this message in context: http://r.789695.n4.nabble.com/Unexpected-input-while-building-package-in-R-tp4618065.html
Sent from the R help mailing list archive at Nabble.com.
#
Can you show us the file that's throwing an error? This suggests
there's something syntactically invalid in  your code, but it's
impossible to say what without seeing it.

Best,
Michael
On Tue, May 8, 2012 at 1:00 PM, abhisarihan <abhisarihan at gmail.com> wrote:
#
You did not specify any object in the function. Thus R is building the 
package "test" with all the objects present in your session when you are 
calling the package.skeleton function. I suppose that one of these 
objects is causing problem. I suggest you list all the 
variables/function necessary for your package in the function.

Something like that :
a <- 1
b <- function(x) {x+x}
package.skeleton(name = "test", list=c("a","b"))

Eloi
On 12-05-08 10:00 AM, abhisarihan wrote:

  
    
#
I just fixed the issue. I had to do a full re-install of R to get it working.
I had initially re-installed Rtools and Perl which did not work. However,
upon re-installing R, the error seemed to go away. So I do not really know
what corrupted the R install from earlier, but at the moment, I seemed to
have it working. Is there any way that the registry can be corrupted?
Perhaps, I inadvertently managed to do that. 

--
View this message in context: http://r.789695.n4.nabble.com/Unexpected-input-while-building-package-in-R-tp4618065p4618755.html
Sent from the R help mailing list archive at Nabble.com.