Re: [R] Package seems to be present but library don't find it
On 12-04-03 12:25 PM, Marc Girondot wrote: Indeed I get this error message when I install the library using R CMD INSTALL but not within the GUI (in MacOsX). Good to know that R CMD INSTALL is more verbose and permits to track bug. I followed up in R-sig-mac, and it turns out the reason you didn't get a message is that you didn't specify the package type, and the default is to assume you have a binary package. A binary install just copies the files into place without looking at them. If you had specified type=source in the install.packages() call, you would get the same error messages as I got. Duncan Murdoch Thanks a lot. It works fine now. Marc Le 03/04/12 16:03, Duncan Murdoch a écrit : On 03/04/2012 9:50 AM, Marc Girondot wrote: In case someone has the competence to check, the file is here: setwd(~) download.file(http://www.ese.u-psud.fr/epc/conservation/r-scripts/HelloWorld_1.0.tar.gz;, HelloWorld_1.0.tar.gz) install.packages(HelloWorld_1.0.tar.gz, repos = NULL) The problem is that you try to export the name HelloWorld in your NAMESPACE file, but you don't have an object of that name. You should export showHello instead. Not sure why you didn't see the error message I got: $ R CMD INSTALL HelloWorld_1.0.tar.gz * installing to library 'F:/cygwin/home/murdoch/R/win-library/2.15' * installing *source* package 'HelloWorld' ... ** R ** preparing package for lazy loading ** help Warning: C:/temp/RtmpimSWuh/R.INSTALLe801c296e9/HelloWorld/man/HelloWorld-packag e.Rd:32: All text must be in a section Warning: C:/temp/RtmpimSWuh/R.INSTALLe801c296e9/HelloWorld/man/HelloWorld-packag e.Rd:33: All text must be in a section *** installing help indices ** building package indices ** testing if installed package can be loaded Error in namespaceExport(ns, exports) : undefined exports: HelloWorld Error: loading failed Execution halted ERROR: loading failed * removing 'F:/cygwin/home/murdoch/R/win-library/2.15/HelloWorld' Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Package seems to be present but library don't find it
Hi, I try to make my first package? The HelloWorld.R file is: HelloWorld.R #' showHello est une fonction R permettant d'afficher le message #' Hello World! sur la console. #' @title la fonction showHello() showHello -function(){ cat(Hello World!\n) } I use the following procedure to get the tar: # set the working directory where the file is located setwd(...) package.skeleton(HelloWorld,code_files=c(HelloWorld.R)) # to generate .rd files library(roxygen2) roxygenize(HelloWorld,copy.package=FALSE) system(R CMD build '/Users/marcgirondot/Documents/Espace de travail R/Phenology/Source fit/Essai_package/HelloWorld') * checking for file ‘/Users/marcgirondot/Documents/Espace de travail R/Phenology/Source fit/Essai_package/HelloWorld/DESCRIPTION’ ... OK * preparing ‘HelloWorld’: * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files * checking for empty or unneeded directories Removed empty directory ‘HelloWorld/inst’ * building ‘HelloWorld_1.0.tar.gz’ install.packages(/Users/marcgirondot/Documents/Espace\ de\ travail\ R/Phenology/Source\ fit/Essai_package/HelloWorld_1.0.tar.gz, repos = NULL) Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’ (as ‘lib’ is unspecified) library(HelloWorld) Erreur dans library(HelloWorld) : ‘HelloWorld’ n'est pas un nom correct de package installé Whereas the Helloworld folder is available in the library folder with other packages /Library/Frameworks/R.framework/Versions/2.14/Resources/library/HelloWorld -- __ Marc Girondot, Pr Laboratoire Ecologie, Systématique et Evolution Equipe de Conservation des Populations et des Communautés CNRS, AgroParisTech et Université Paris-Sud 11 , UMR 8079 Bâtiment 362 91405 Orsay Cedex, France Tel: 33 1 (0)1.69.15.72.30 Fax: 33 1 (0)1.69.15.73.53 e-mail: marc.giron...@u-psud.fr Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html Skype: girondot __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Package seems to be present but library don't find it
In case someone has the competence to check, the file is here: setwd(~) download.file(http://www.ese.u-psud.fr/epc/conservation/r-scripts/HelloWorld_1.0.tar.gz;, HelloWorld_1.0.tar.gz) install.packages(HelloWorld_1.0.tar.gz, repos = NULL) Thanks a lot Marc Le 03/04/12 10:55, Marc Girondot a écrit : Hi, I try to make my first package? The HelloWorld.R file is: HelloWorld.R #' showHello est une fonction R permettant d'afficher le message #' Hello World! sur la console. #' @title la fonction showHello() showHello -function(){ cat(Hello World!\n) } I use the following procedure to get the tar: # set the working directory where the file is located setwd(...) package.skeleton(HelloWorld,code_files=c(HelloWorld.R)) # to generate .rd files library(roxygen2) roxygenize(HelloWorld,copy.package=FALSE) system(R CMD build '/Users/marcgirondot/Documents/Espace de travail R/Phenology/Source fit/Essai_package/HelloWorld') * checking for file ‘/Users/marcgirondot/Documents/Espace de travail R/Phenology/Source fit/Essai_package/HelloWorld/DESCRIPTION’ ... OK * preparing ‘HelloWorld’: * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files * checking for empty or unneeded directories Removed empty directory ‘HelloWorld/inst’ * building ‘HelloWorld_1.0.tar.gz’ install.packages(/Users/marcgirondot/Documents/Espace\ de\ travail\ R/Phenology/Source\ fit/Essai_package/HelloWorld_1.0.tar.gz, repos = NULL) Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’ (as ‘lib’ is unspecified) library(HelloWorld) Erreur dans library(HelloWorld) : ‘HelloWorld’ n'est pas un nom correct de package installé Whereas the Helloworld folder is available in the library folder with other packages /Library/Frameworks/R.framework/Versions/2.14/Resources/library/HelloWorld -- __ Marc Girondot, Pr Laboratoire Ecologie, Systématique et Evolution Equipe de Conservation des Populations et des Communautés CNRS, AgroParisTech et Université Paris-Sud 11 , UMR 8079 Bâtiment 362 91405 Orsay Cedex, France Tel: 33 1 (0)1.69.15.72.30 Fax: 33 1 (0)1.69.15.73.53 e-mail: marc.giron...@u-psud.fr Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html Skype: girondot __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Package seems to be present but library don't find it
On 03/04/2012 9:50 AM, Marc Girondot wrote: In case someone has the competence to check, the file is here: setwd(~) download.file(http://www.ese.u-psud.fr/epc/conservation/r-scripts/HelloWorld_1.0.tar.gz;, HelloWorld_1.0.tar.gz) install.packages(HelloWorld_1.0.tar.gz, repos = NULL) The problem is that you try to export the name HelloWorld in your NAMESPACE file, but you don't have an object of that name. You should export showHello instead. Not sure why you didn't see the error message I got: $ R CMD INSTALL HelloWorld_1.0.tar.gz * installing to library 'F:/cygwin/home/murdoch/R/win-library/2.15' * installing *source* package 'HelloWorld' ... ** R ** preparing package for lazy loading ** help Warning: C:/temp/RtmpimSWuh/R.INSTALLe801c296e9/HelloWorld/man/HelloWorld-packag e.Rd:32: All text must be in a section Warning: C:/temp/RtmpimSWuh/R.INSTALLe801c296e9/HelloWorld/man/HelloWorld-packag e.Rd:33: All text must be in a section *** installing help indices ** building package indices ** testing if installed package can be loaded Error in namespaceExport(ns, exports) : undefined exports: HelloWorld Error: loading failed Execution halted ERROR: loading failed * removing 'F:/cygwin/home/murdoch/R/win-library/2.15/HelloWorld' Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Package seems to be present but library don't find it
Indeed I get this error message when I install the library using R CMD INSTALL but not within the GUI (in MacOsX). Good to know that R CMD INSTALL is more verbose and permits to track bug. Thanks a lot. It works fine now. Marc Le 03/04/12 16:03, Duncan Murdoch a écrit : On 03/04/2012 9:50 AM, Marc Girondot wrote: In case someone has the competence to check, the file is here: setwd(~) download.file(http://www.ese.u-psud.fr/epc/conservation/r-scripts/HelloWorld_1.0.tar.gz;, HelloWorld_1.0.tar.gz) install.packages(HelloWorld_1.0.tar.gz, repos = NULL) The problem is that you try to export the name HelloWorld in your NAMESPACE file, but you don't have an object of that name. You should export showHello instead. Not sure why you didn't see the error message I got: $ R CMD INSTALL HelloWorld_1.0.tar.gz * installing to library 'F:/cygwin/home/murdoch/R/win-library/2.15' * installing *source* package 'HelloWorld' ... ** R ** preparing package for lazy loading ** help Warning: C:/temp/RtmpimSWuh/R.INSTALLe801c296e9/HelloWorld/man/HelloWorld-packag e.Rd:32: All text must be in a section Warning: C:/temp/RtmpimSWuh/R.INSTALLe801c296e9/HelloWorld/man/HelloWorld-packag e.Rd:33: All text must be in a section *** installing help indices ** building package indices ** testing if installed package can be loaded Error in namespaceExport(ns, exports) : undefined exports: HelloWorld Error: loading failed Execution halted ERROR: loading failed * removing 'F:/cygwin/home/murdoch/R/win-library/2.15/HelloWorld' Duncan Murdoch -- __ Marc Girondot, Pr Laboratoire Ecologie, Systématique et Evolution Equipe de Conservation des Populations et des Communautés CNRS, AgroParisTech et Université Paris-Sud 11 , UMR 8079 Bâtiment 362 91405 Orsay Cedex, France Tel: 33 1 (0)1.69.15.72.30 Fax: 33 1 (0)1.69.15.73.53 e-mail: marc.giron...@u-psud.fr Web: http://www.ese.u-psud.fr/epc/conservation/Marc.html Skype: girondot [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.