[Rd] First package submission to CRAN
I'm preparing to submit my first package to CRAN, thanks to the help of too many people to mention. I've built and checked the package on Windows ( making a zip) and my path points to the 64 bit version of R. Everything builds and checks and the final warnings have been fixed. My package is pure R with no source from other languages. My questions are as follows. I've read the docs and just need a bit of clarification. 1. For submission I should just build source R CMD build mypkg which outputs a tar.gz 2. Do I have to/ how do I build for 32 bit? Thanks, Steve [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] First package submission to CRAN
Thanks, I understand. Looks like everything checks and Now I have to upload. whew. kinda exciting, even though its a small package for now. Steve On Wed, Jun 22, 2011 at 1:34 PM, Christophe Dutang wrote: > Hi, > > By default, R CMD build makes sources, you have to use --binary if you want > to get binaries. But you have to submit sources to the CRAN ftp server (and > not binary). So just run a R CMD build. > > C > > -- > Christophe Dutang > Ph.D. student at ISFA, Lyon, France > website: http://dutangc.free.fr > > Le 22 juin 2011 à 22:12, steven mosher a écrit : > > > I'm preparing to submit my first package to CRAN, thanks to the help of > too > > many people to mention. > > > > I've built and checked the package on Windows ( making a zip) and my > path > > points to the 64 bit version of R. > > > > Everything builds and checks and the final warnings have been fixed. My > > package is pure R with no source from > > > > other languages. My questions are as follows. I've read the docs and > just > > need a bit of clarification. > > > > 1. For submission I should just build source R CMD build mypkg which > > outputs a tar.gz > > 2. Do I have to/ how do I build for 32 bit? > > > > Thanks, > > > > Steve > > > > [[alternative HTML version deleted]] > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] First package submission to CRAN
Thank you david.. with R CMD build --binary I was seeing the deprecated warning On Wed, Jun 22, 2011 at 4:51 PM, David Scott wrote: > On 23/06/11 08:34, Christophe Dutang wrote: > >> Hi, >> >> By default, R CMD build makes sources, you have to use --binary if you >> want to get binaries. But you have to submit sources to the CRAN ftp server >> (and not binary). So just run a R CMD build. >> >> C >> >> -- >> Christophe Dutang >> Ph.D. student at ISFA, Lyon, France >> website: http://dutangc.free.fr >> > > That is now deprecated Christophe. Recommended now is > > R CMD INSTALL --build > > to get a binary. See the recent thread with the subject > > Porting "unmaintained" packages to post R 2.10.0 era > > David Scott > > > Le 22 juin 2011 à 22:12, steven mosher a écrit : >> >> I'm preparing to submit my first package to CRAN, thanks to the help of >>> too >>> many people to mention. >>> >>> I've built and checked the package on Windows ( making a zip) and my >>> path >>> points to the 64 bit version of R. >>> >>> Everything builds and checks and the final warnings have been fixed. My >>> package is pure R with no source from >>> >>> other languages. My questions are as follows. I've read the docs and >>> just >>> need a bit of clarification. >>> >>> 1. For submission I should just build source R CMD build mypkg which >>> outputs a tar.gz >>> 2. Do I have to/ how do I build for 32 bit? >>> >>> Thanks, >>> >>> Steve >>> >>>[[alternative HTML version deleted]] >>> >>> __** >>> R-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/**listinfo/r-devel<https://stat.ethz.ch/mailman/listinfo/r-devel> >>> >> __** >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/**listinfo/r-devel<https://stat.ethz.ch/mailman/listinfo/r-devel> >> > > > -- > __**__**_ > David Scott Department of Statistics >The University of Auckland, PB 92019 >Auckland 1142,NEW ZEALAND > Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055 > Email: d.sc...@auckland.ac.nz, Fax: +64 9 373 7018 > > > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] First package submission to CRAN
Thanks. figured as much and submitted On Thu, Jun 23, 2011 at 10:16 AM, Sascha Vieweg wrote: > On 11-06-22 22:12, steven mosher wrote: > > I'm preparing to submit my first package to CRAN, thanks to the help of >> too many people to mention. >> > > [...] > > > My package is pure R with no source from other languages. My questions >> are as follows. I've read the docs and just need a bit of clarification. >> >> 1. For submission I should just build source R CMD build mypkg >> which outputs a tar.gz >> >> 2. Do I have to/ how do I build for 32 bit? >> > > AFAIK there is no need to care about 32/64 bit as long as your package is > pure R code. > > Congrats to your new package! > > *S* > > -- > Sascha Vieweg, saschav...@gmail.com > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Syntactically valid names
regexp approach is kinda ugly http://www.r-bloggers.com/testing-for-valid-variable-names/ On Tue, Jul 5, 2011 at 3:29 PM, Hadley Wickham wrote: > > I wouldn't expect so. The basic structure might be handled using a regexp > of sorts, but even that is tricky because of the "dot not followed by > number" rule, and then there's the stop list of reserved words, which would > make your code clumsy whatever you do. > > > > How on Earth would you expect anything to be significantly more elegant > than your > > > > function(x) x == make.names(x) > > > > anyway??! (OK, if there was a wrapper for the C level isValidName() > function...) > > Good point. Thanks! > > Hadley > > -- > Assistant Professor / Dobelman Family Junior Chair > Department of Statistics / Rice University > http://had.co.nz/ > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Creating package Vignette
Also useful if you want to do an FAQ On Thu, Jul 14, 2011 at 10:12 AM, Melissa Jane Hubisz wrote: > Another workaround is to create a "dummy" vignette which does nothing > but include the pdf file. Something like this: > vignette.Rnw: > > % \VignetteIndexEntry{vignette} > % \VignetteKeywords{keywords here} > % \VignettePackage{package name} > > \documentclass[a4paper]{article} > \usepackage{hyperref} > \usepackage{pdfpages} > \begin{document} > \includepdf[fitpaper=true,pages=-]{vignette-source.pdf} > \end{document} > > Not sure if this is totally kosher, but I did this for my package when > the vignette was too computationally intensive to be submitted to > CRAN. > -Melissa > > On Thu, Jul 14, 2011 at 1:00 PM, Ben Bolker wrote: > > Prof Brian Ripley stats.ox.ac.uk> writes: > > > >> > >> It depends what you mean by 'vignette': the R docs have been unclear > >> (but R >= 2.13.0 are more consistent). In most cases a 'vignette' is > >> an Sweave document, the vignette source being the .Rnw file, and the > >> vignette PDF the processed .pdf file. > >> > >> At present vignette() means Sweave documents, as only they have > >> metadata like titles. This is planned to be changed soon. > >> > >> On Thu, 14 Jul 2011, Nipesh Bajaj wrote: > >> > >> > Hi all, I was trying to create some vignette files for my newly > >> > developed package, however wondering whether there could be any > >> > simpler way to do so. In writing R extension it is advised to go > >> > through Sweave route, however I have already got a big pdf file and > >> > want to use this as package vignette. > >> > > >> > So far I have manually created the inst/doc folder in the main package > >> > skeleton, and put that file into this, which is not working by calling > >> > "vignette(file_name)" after I build and load the package. I am > >> > >> file_name is not an argument to vignette(): it is 'topic'. And topics > >> are normally file basenames (without any extension), not file names. > >> > >> > getting following error without opening that pdf file: "vignette > >> > 'file_name' *not* found" > >> > > >> > So I like to know, is there any way to use any arbitrary pdf file as > >> > vignette? > >> > >> By definition, no. > >> > >> > > >> > Any suggestion is highly appreciated. > > > > One possibility: as a workaround, you could include your > > own "xvignette" function in your package: see below. > > It won't show you indices, but it will pick up any appropriately > > named file that you include in the inst/doc directory of your > > package ... > > > > xvignette <- function(vname,pkg,ext="pdf") { > > vname <- paste(vname,ext,sep=".") > > fn <- system.file("doc",vname,package=pkg) > > if (nchar(fn)==0) stop("file not found") > > utils:::print.vignette(list(pdf=fn)) > > invisible(fn) > > } > > > > You'll have to somehow alert your package users to the > > fact that this alternative documentation exists -- perhaps in the help > > package for the package itself. > > > > You might fill in the default value of "pkg" above with your > > package name to make it easier on the user: I thought about > > using some version of getPackageName(environment(xvignette)) > > to do it automatically, but that seems too complicated ... > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Please explain your workflow from R code -> package -> R code -> package
All I need now is a tool to go through the 4 packages I already created without Roxygen and spit out source files with the Roxygen comments in them... really lazy. On Fri, Sep 9, 2011 at 11:41 AM, Hadley Wickham wrote: >> | In other languages, I've seen to write the documentation inside the >> | code files and then post-process to make the documentation. Is there >> | a similar thing for R, to unify the R code development and >> | documentation/package-making process? >> >> You can also follow the cool kids who these days tie some of this together >> using roxygen. > > It's not the cool kids who are doing this, it's the lazy kids ;) > Roxygen(2) does remove a considerable amount of replication between > code and documentation (e.g. replicating function usage in two > places), and the close proximity between code and documentation does > make it easier to remember to update your documentation when the code > changes. > > Roxygen2 adds a few other tools for reducing duplication like > templates, the ability to inherit parameter documentation from other > function, and the family tag to automatically add seealso references > between all members of a related family of functions. These are > things that are painful to do by hand and add a significance > maintenance burden. > > I agree that there's no silver bullet, but good tools certainly can > make life easier. > > Hadley > > -- > Assistant Professor / Dobelman Family Junior Chair > Department of Statistics / Rice University > http://had.co.nz/ > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Please explain your workflow from R code -> package -> R code -> package
Thanks, I was too lazy to even look for it. On Sat, Sep 10, 2011 at 9:31 AM, Joshua Ulrich wrote: > On Sat, Sep 10, 2011 at 11:23 AM, steven mosher > wrote: >> All I need now is a tool to go through the 4 packages I already >> created without Roxygen and spit out source files with the Roxygen >> comments in them... >> >> really lazy. >> >> > That's what Rd2roxygen does... > > Best, > -- > Joshua Ulrich | FOSS Trading: www.fosstrading.com > > > >> >> On Fri, Sep 9, 2011 at 11:41 AM, Hadley Wickham wrote: >>>> | In other languages, I've seen to write the documentation inside the >>>> | code files and then post-process to make the documentation. Is there >>>> | a similar thing for R, to unify the R code development and >>>> | documentation/package-making process? >>>> >>>> You can also follow the cool kids who these days tie some of this together >>>> using roxygen. >>> >>> It's not the cool kids who are doing this, it's the lazy kids ;) >>> Roxygen(2) does remove a considerable amount of replication between >>> code and documentation (e.g. replicating function usage in two >>> places), and the close proximity between code and documentation does >>> make it easier to remember to update your documentation when the code >>> changes. >>> >>> Roxygen2 adds a few other tools for reducing duplication like >>> templates, the ability to inherit parameter documentation from other >>> function, and the family tag to automatically add seealso references >>> between all members of a related family of functions. These are >>> things that are painful to do by hand and add a significance >>> maintenance burden. >>> >>> I agree that there's no silver bullet, but good tools certainly can >>> make life easier. >>> >>> Hadley >>> >>> -- >>> Assistant Professor / Dobelman Family Junior Chair >>> Department of Statistics / Rice University >>> http://had.co.nz/ >>> >>> __ >>> R-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-devel >>> >> >> __ >> R-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-devel >> > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Importing from a package with dependencies
I needed to do a little cleanup on my packages ( before trying Rd2Roxygen) and that involved switching some packages from my Depends list to Imports. Specifically, I had a dependency on "R.utils", but since I only used one or two functions (gunzip ) I thought it best to importFrom("R.utils",gunzip) in the namespace and then switch from depending on R.util to Importing. However, R.utils depends upon R.oo and R.methodsS3. I removed them as well from the depends. Now, when I build the package I get the following warning "library or require call not declared from R.oo I know this is something stupid I am missing. I would like to import from R.util because of a name clash with "raster" ( extract). Do I still need to declare a depends on R.oo and R.methodsS3? Thanks Steve __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Importing from a package with dependencies
Disregard. I found the problem. A stray "require" statement I didnt find on the first pass through the code. On Sat, Sep 10, 2011 at 6:03 PM, steven mosher wrote: > I needed to do a little cleanup on my packages ( before trying > Rd2Roxygen) and that involved > switching some packages from my Depends list to Imports. > > Specifically, I had a dependency on "R.utils", but since I only used > one or two functions > (gunzip ) I thought it best to importFrom("R.utils",gunzip) in the > namespace and then switch > from depending on R.util to Importing. > > However, R.utils depends upon R.oo and R.methodsS3. I removed them as > well from the depends. > > Now, when I build the package I get the following warning > > > "library or require call not declared from R.oo > > I know this is something stupid I am missing. > > I would like to import from R.util because of a name clash with > "raster" ( extract). > > Do I still need to declare a depends on R.oo and R.methodsS3? > > > Thanks > > Steve > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] "could not find function" after import
Duncan I have a related question. I need one function from R.utils. But R.utils depends on R.oo and R.methodsS3. so I made R.util an import and then used importFrom() in the namespace. The package passed the "check". However when it came to use the function it had not been loaded? do I need to add the upstream packages that R.util depends upon? also in the code do I need a library or require? A bit confused Steve On Mon, Sep 19, 2011 at 5:09 PM, Duncan Murdoch wrote: > On 11-09-19 4:48 PM, Stephanie M. Gogarten wrote: >> >> I am trying to build a package (GWASTools, submitted to Bioconductor) >> that uses the "sandwich" package. I have references to "sandwich" in >> DESCRIPTION: >> Imports: methods, DBI, RSQLite, sandwich, survival, DNAcopy >> >> and NAMESPACE: >> import(sandwich) >> >> In the code itself is a call to vcovHC: >> Vhat<- vcovHC(mod, type="HC0") >> >> I have sandwich version 2.2-7 installed. >> >> When I run R CMD check on my package, I get the following error during >> checking of examples: >> * using R Under development (unstable) (2011-08-29 r56828) >> * using platform: x86_64-apple-darwin9.8.0 (64-bit) >> ... >> * checking examples ... ERROR >> ... >> Error in estfun.glm(x) : could not find function "is.zoo" >> Calls: assocTestRegression ... meatHC -> rowMeans -> is.data.frame -> >> estfun -> estfun.glm >> >> I import sandwich, sandwich depends on zoo, but a function in zoo cannot >> be found during execution. >> >> I tried to get around this by explicitly including a "require" statement >> in assocTestRegression: >> require(sandwich) >> >> The example now runs, but I have a warning in R CMD check: >> * checking for unstated dependencies in R code ... WARNING >> ‘library’ or ‘require’ call not declared from: ‘sandwich’ >> >> I am not sure why this is a problem, as there is a "require" statement >> (for a different package) in another function which does not cause any >> warnings. >> >> Can anyone advise on how to get my package to successfully pass R CMD >> check? >> > > If you said that your package Depends on sandwich, you'd probably pass > checks, but this is arguably a bug in the sandwich package. > > The problem is that since you only import sandwich, it never gets attached. > So it never attaches its dependency zoo. It should import zoo (or import > the functions in zoo that it uses) to work properly the way you are calling > it. > > You can see the same error as follows: > > 1. Install sandwich, but don't attach it or zoo. > > 2. Run > > example(glm) > > to create the "glm" object glm.D93. > > Try to call > > sandwich::estfun(glm.D93) > > You'll get the same error as before because is.zoo() will not be loaded. > > It's also arguably a design flaw in R. For testing sandwich, zoo would > generally end up being attached, because the testing of sandwich would > attach it. However, examples like the one above are never tested. > > Duncan Murdoch > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] "could not find function" after import
Thanks duncan. I fixed it by changing to depends and resubmitting my packages. But I changed from depends to imports for a very specific reason. namespace conflicts. There are work arounds for that so its not terminally broken, but IMPORT had the promise of just the elegance I was looking for. Thanks for the explanation. Steve On Fri, Sep 23, 2011 at 11:44 AM, Duncan Murdoch wrote: > On 23/09/2011 12:57 PM, steven mosher wrote: >> >> Duncan >> >> I have a related question. >> >> I need one function from R.utils. But R.utils depends on R.oo and >> R.methodsS3. >> so I made R.util an import and then used importFrom() in the namespace. >> >> The package passed the "check". However when it came to use the function >> it had not been loaded? do I need to add the upstream packages that >> R.util depends >> upon? also in the code do I need a library or require? > > Sounds exactly like the situation with sandwich below. The workaround > available to you is to Depend on R.utils. The author of R.utils could fix > the problem by importing R.oo and R.methodsS3, and the authors of R could > fix it by changing the behaviour of how R handles imports. > > Duncan Murdoch > >> A bit confused >> >> Steve >> >> On Mon, Sep 19, 2011 at 5:09 PM, Duncan Murdoch >> wrote: >> > On 11-09-19 4:48 PM, Stephanie M. Gogarten wrote: >> >> >> >> I am trying to build a package (GWASTools, submitted to Bioconductor) >> >> that uses the "sandwich" package. I have references to "sandwich" in >> >> DESCRIPTION: >> >> Imports: methods, DBI, RSQLite, sandwich, survival, DNAcopy >> >> >> >> and NAMESPACE: >> >> import(sandwich) >> >> >> >> In the code itself is a call to vcovHC: >> >> Vhat<- vcovHC(mod, type="HC0") >> >> >> >> I have sandwich version 2.2-7 installed. >> >> >> >> When I run R CMD check on my package, I get the following error during >> >> checking of examples: >> >> * using R Under development (unstable) (2011-08-29 r56828) >> >> * using platform: x86_64-apple-darwin9.8.0 (64-bit) >> >> ... >> >> * checking examples ... ERROR >> >> ... >> >> Error in estfun.glm(x) : could not find function "is.zoo" >> >> Calls: assocTestRegression ... meatHC -> rowMeans -> >> >> is.data.frame -> >> >> estfun -> estfun.glm >> >> >> >> I import sandwich, sandwich depends on zoo, but a function in zoo >> >> cannot >> >> be found during execution. >> >> >> >> I tried to get around this by explicitly including a "require" >> >> statement >> >> in assocTestRegression: >> >> require(sandwich) >> >> >> >> The example now runs, but I have a warning in R CMD check: >> >> * checking for unstated dependencies in R code ... WARNING >> >> ‘library’ or ‘require’ call not declared from: ‘sandwich’ >> >> >> >> I am not sure why this is a problem, as there is a "require" statement >> >> (for a different package) in another function which does not cause any >> >> warnings. >> >> >> >> Can anyone advise on how to get my package to successfully pass R CMD >> >> check? >> >> >> > >> > If you said that your package Depends on sandwich, you'd probably pass >> > checks, but this is arguably a bug in the sandwich package. >> > >> > The problem is that since you only import sandwich, it never gets >> > attached. >> > So it never attaches its dependency zoo. It should import zoo (or >> > import >> > the functions in zoo that it uses) to work properly the way you are >> > calling >> > it. >> > >> > You can see the same error as follows: >> > >> > 1. Install sandwich, but don't attach it or zoo. >> > >> > 2. Run >> > >> > example(glm) >> > >> > to create the "glm" object glm.D93. >> > >> > Try to call >> > >> > sandwich::estfun(glm.D93) >> > >> > You'll get the same error as before because is.zoo() will not be >> > loaded. >> > >> > It's also arguably a design flaw in R. For testing sandwich, zoo would >> > generally end up being attached, because the testing of sandwich would >> > attach it. However, examples like the one above are never tested. >> > >> > Duncan Murdoch >> > >> > __ >> > R-devel@r-project.org mailing list >> > https://stat.ethz.ch/mailman/listinfo/r-devel >> > > > __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] weird error
I was just rebuilding a package that has built before and I hit this error Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) : cyclic name space dependency detected when loading 'GhcnDaily', already loading 'GhcnDaily' The package built just fine last revision, and the only changes I made were to Rd files How do I track this puppy down [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] weird error
Thanks, found it. never say you only changed one thing. For reference for other folks. There was an errant script in my R subdir for the package that script had a library command for the package. hence the cyclical reference Steve On Mon, Oct 31, 2011 at 8:36 PM, steven mosher wrote: > I was just rebuilding a package that has built before and I hit this error > > Error in loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = > keep.source) : > cyclic name space dependency detected when loading 'GhcnDaily', already > loading 'GhcnDaily' > > The package built just fine last revision, and the only changes I made > were to Rd files > > How do I track this puppy down > > > > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] creating a package in R
If you want simple step by step instructions for Windows, try this http://stevemosher.wordpress.com/ten-steps-to-building-an-r-package-under-windows/ On Sun, Apr 29, 2012 at 7:08 AM, nossa wrote: > Please give me the necessary links that permits me to create my own > package > inR > > -- > View this message in context: > http://r.789695.n4.nabble.com/creating-a-package-in-R-tp4596411p4596411.html > Sent from the R devel mailing list archive at Nabble.com. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Encoding errors in Rd files
Well, I'm working on project trying to bring back an old package last published on R 1.9 back to life. I'm almost there but I am getting killed by an encoding error in the Rd files After reading the manual, I decided to try UTF-8. Mostly because I could spell it. ha. That got me a bit closer but I still have these warnings * checking data for non-ASCII characters ... WARNING Warning: found non-ASCII string(s) 'Tourbihre de la Rivihre-aux-Feu' in object 'modpoll' 'Lac ` la Fourche' in object 'modpoll' 'Lac ` la Loutre' in object 'modpoll' 'Lac Kinogami' in object 'modpoll' * checking data for ASCII and uncompressed saves ... OK * checking examples ... OK * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd problems. LaTeX errors found: ! Package inputenc Error: Keyboard character used is undefined (inputenc)in inputencoding `utf8'. I'll keep searching the help list archives for a clue, but If somebody could point me at educational material it's really time that I learn this aspect. I've readhttp://developer.r-project.org/Encodings_and_R.html How do I figure out which encoding to use with the error seen above Steve [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Encoding errors in Rd files
Thank Dr. Ripley. When I read the instructions " If the DESCRIPTION file is not entirely in ASCII it should contain an Encoding field specifying an encoding. This is used as the encoding of the DESCRIPTION file itself and of the R and NAMESPACE files, and as the default encoding of .Rd files. " I assumed that I should specify an encoding of UTF-8 in the description file to handle the specific Rd files that were having problems. After I removed the encoding field (UTF-8) I had added to the DESCRIPTION file, the following error no longer occurred " Package inputenc Error: Keyboard character used is undefined (inputenc)in inputencoding `utf8'. " however the rd files still had errors. looking at the latex versions of the Rd files I was able to spot which characters in the Rd files were offending. In my normal editor they were simply not showing up, so I had no idea what characters were causing the problem. The only thing I am left with is the entries in the data frame. The package came with some predefined .rda files in its data subdirectory. Using encoding() on the column of the data frame that contains the following items checking data for non-ASCII characters ... WARNING Warning: found non-ASCII string(s) 'Tourbihre de la Rivihre-aux-Feu' in object 'modpoll' 'Lac ` la Fourche' in object 'modpoll' 'Lac ` la Loutre' in object 'modpoll' 'Lac Kinogami' in object 'modpoll' I get "unknown" for all the items. So, If I understand you I should take this dataframe, change the encoding to UTF-8 Sorry for being so dense On Tue, Jul 24, 2012 at 1:46 PM, Prof Brian Ripley wrote: > On 24/07/2012 21:08, steven mosher wrote: > >> Well, I'm working on project trying to bring back an old package last >> published on R 1.9 back to life. >> I'm almost there but I am getting killed by an encoding error in the Rd >> files >> >> After reading the manual, I decided to try UTF-8. Mostly because I could >> spell it. ha. >> >> That got me a bit closer but I still have these warnings >> >> * checking data for non-ASCII characters ... WARNING >>Warning: found non-ASCII string(s) >>'Tourbihre de la Rivihre-aux-Feu' in object 'modpoll' >>'Lac ` la Fourche' in object 'modpoll' >>'Lac ` la Loutre' in object 'modpoll' >>'Lac Kinogami' in object 'modpoll' >> > > How to handle those is in 'Writing R Extensions': basically convert to > UTF-8 and mark them as UTF-8. > > > * checking data for ASCII and uncompressed saves ... OK >> * checking examples ... OK >> * checking PDF version of manual ... WARNING >> LaTeX errors when creating PDF version. >> This typically indicates Rd problems. >> LaTeX errors found: >> ! Package inputenc Error: Keyboard character used is undefined >> (inputenc)in inputencoding `utf8'. >> >> I'll keep searching the help list archives for a clue, but If somebody >> could point me at educational material it's really time >> that I learn this aspect. >> > > Without the actual file we can do little. The message means that > something in the manual inputs (and it could be the DESCRIPTION file or an > Rd file) contains a character not known to LaTeX. Most likely it is simply > not a UTF-8 character, but it could also be outside LaTeX's gamut. > > Normally the LaTeX log (which is in the check output) is more revealing: > you can also try this part alone with R CMD Rd2pdf (and R CMD Rd2pdf > --no-description often points the finger at the DESCRIPTION file). > > > >> I've read >> http://developer.r-project.**org/Encodings_and_R.html<http://developer.r-project.org/Encodings_and_R.html> >> >> How do I figure out which encoding to use with the error seen above >> > > Assuming this is not something esoteric, UTF-8 is the most comprehensive > choice, but LaTeX's UTF-8 coverage (and that of the fonts used) is heavily > biased to Western European scripts. So for example for Lithuanian you may > want to choose something else (Latin-7?). > > > > > -- > Brian D. Ripley, rip...@stats.ox.ac.uk > Professor of Applied Statistics, > http://www.stats.ox.ac.uk/~**ripley/<http://www.stats.ox.ac.uk/~ripley/> > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UKFax: +44 1865 272595 > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Encoding errors in Rd files
Thanks Duncan I was able to find the offending characters in the Rd files. I'll try latin1 for the data.frame (UTF-8 was obviously not the right answer for that.) One thing I was very happy for was that the package just works, not too shabby since it was orginally built under 1.9. Thanks for your help! Steve On Wed, Jul 25, 2012 at 1:04 AM, Duncan Murdoch wrote: > On 12-07-25 3:24 AM, steven mosher wrote: > >> Thank Dr. Ripley. >> >> When I read the instructions >> " If the DESCRIPTION file is not entirely in ASCII it should contain an >> Encoding field specifying an encoding. This is used as the encoding of >> the >> DESCRIPTION file itself and of the R and NAMESPACE files, and as the >> default encoding of .Rd files. " >> >> I assumed that I should specify an encoding of UTF-8 in the description >> file to handle the specific Rd files that were having problems. >> >> After I removed the encoding field (UTF-8) I had added to the >> DESCRIPTION >> file, the following error no longer occurred >> >> " Package inputenc Error: Keyboard character used is undefined >> (inputenc)in inputencoding `utf8'. " >> >> however the rd files still had errors. >> >> looking at the latex versions of the Rd files I was able to spot which >> characters in the Rd files >> were offending. In my normal editor they were simply not showing up, so I >> had no idea what characters were >> causing the problem. >> >> The only thing I am left with is the entries in the data frame. The >> package >> came with some predefined .rda files >> in its data subdirectory. Using encoding() on the column of the data >> frame that contains the following items >> >> checking data for non-ASCII characters ... WARNING >> Warning: found non-ASCII string(s) >> 'Tourbihre de la Rivihre-aux-Feu' in object 'modpoll' >> 'Lac ` la Fourche' in object 'modpoll' >> 'Lac ` la Loutre' in object 'modpoll' >> 'Lac Kinogami' in object 'modpoll' >> >> I get "unknown" for all the items. So, If I understand you I should take >> this dataframe, change the encoding >> to UTF-8. >> > > The issue is almost certainly with accented characters in the text. For > example, the 5th letter in Rivière is an e with a grave accent. It is > displayed as "h" in your error message, because R was not told how to > interpret the way it is stored in the source file, or was told something > that turned out to be incorrect. > > You need to change the source file so that it is stored in the UTF-8 > encoding. That means you should read the file into an editor that displays > it correctly (and that's sometimes hard when you don't know the original > encoding; you may need to do some manual editing), then save it again, > specifying that it should be saved using the UTF-8 encoding. How you do > that depends on your editor. > > Then when you tell R that it is encoded in UTF-8, R will read it properly > and won't complain. > > The tools::showNonASCIIfile() function can help to find characters that > may need fixing. R can recognize when things are not ASCII (those bytes > have the high bit set), but it will be up to you to figure out what > encoding was actually used. For French, latin1 is a good guess but it is > not necessarily right. > > Duncan Murdoch > > >> Sorry for being so dense >> >> On Tue, Jul 24, 2012 at 1:46 PM, Prof Brian Ripley > >wrote: >> >> On 24/07/2012 21:08, steven mosher wrote: >>> >>> Well, I'm working on project trying to bring back an old package last >>>> published on R 1.9 back to life. >>>> I'm almost there but I am getting killed by an encoding error in the Rd >>>> files >>>> >>>> After reading the manual, I decided to try UTF-8. Mostly because I >>>> could >>>> spell it. ha. >>>> >>>> That got me a bit closer but I still have these warnings >>>> >>>> * checking data for non-ASCII characters ... WARNING >>>> Warning: found non-ASCII string(s) >>>> 'Tourbihre de la Rivihre-aux-Feu' in object 'modpoll' >>>> 'Lac ` la Fourche' in object 'modpoll' >>>> 'Lac ` la Loutre' in object 'modpoll' >>>> 'Lac Kinogami' in object 'modpoll' >>>> >>>>
[Rd] Compressing data for package builds
Hi, I have two .rda files that I need to include in a package. I've placed them both in a data directory after save() the are around 150Kb each. When I try to check the package I get the following warning Warning: large data file(s) saved inefficiently: size ASCII compress zagoskin.rda 137Kb FALSE none Note: significantly better compression could be obtained by using R CMD build --resave-data old_size new_size compress modpoll.rda 124Kb 78Kb xz zagoskin.rda137Kb 6Kbbzip2 Both of these files modpoll.rda and zagoskin.rda have already been compressed from megabytes down to Kb. Also,, the instructions"R CMD build --resave-data" doesnt do anything that I can see so I must be using it wrong. Is there a piece of the puzzle I am missing or instructions better than these: I tried LazyDataCompression and my data.rdb is 90Kb. "Package *tools* has a couple of functions to help with data images: checkRdaFiles reports on the way the image was saved, and resaveRdaFiles will re-save with a different type of compression, including choosing the best type for that particular image. Some packages using LazyData will benefit from using a form of compression other than gzip in the installed lazy-loading database. This can be selected by the --data-compress option to R CMD INSTALL or by using the LazyDataCompression field in the DESCRIPTION file. Useful values are bzip2, xz and the default, gzip. The only way to discover which is best is to try them all and look at the size of the pkgname/data/Rdata.rdb file." [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Compressing data for package builds
" R CMD build is how you preferably should be creating your package tar ball, so you simply add the --resave-data argument to your already existing R CMD build call which creates the tar ball from your source directory. So can you elaborate on "doesn't do anything I can see"? In what sense? No output? No compression? " my tarball builds with > R CDM build mattools where mattools is the name of the package. and I get a warning on R CMD check. Things I tried R CMD build --resave-data R CMD build mattools --resave-data R CMD build --resave-data mattools The first does nothing, the second fails on unknown options and the third fails on unknown options. So I found the help for R CMD Now that I figured out how to display help for R CMD build I see that --resave-data must include a specification of the type of compression --resave-data="best" for example I ran that. and got the same error indicating that the rda file had not been compressed. checking data for non-ASCII characters ... OK * checking data for ASCII and uncompressed saves ... WARNING Warning: large data file(s) saved inefficiently: size ASCII compress zagoskin.rda 137Kb FALSE none Note: significantly better compression could be obtained by using R CMD build --resave-data old_size new_size compress modpoll.rda 124Kb 78Kb xz zagoskin.rda137Kb 6Kbbzip2 Building under windows so I wonder if I am missing a system file required to do the compression. On Thu, Aug 16, 2012 at 5:48 PM, Simon Urbanek wrote: > > On Aug 16, 2012, at 5:08 PM, steven mosher wrote: > > > Hi, > > > > I have two .rda files that I need to include in a package. I've placed > > them both in a data directory > > after save() the are around 150Kb each. > > > > When I try to check the package I get the following warning > > > > Warning: large data file(s) saved inefficiently: > >size ASCII compress > > zagoskin.rda 137Kb FALSE none > > > > Note: significantly better compression could be obtained > >by using R CMD build --resave-data > > old_size new_size compress > > modpoll.rda 124Kb 78Kb xz > > zagoskin.rda137Kb 6Kbbzip2 > > > > Both of these files modpoll.rda and zagoskin.rda have already been > > compressed from megabytes down to Kb. > > > > Also,, the instructions"R CMD build --resave-data" doesnt do > anything > > that I can see so I must be using it wrong. > > R CMD build is how you preferably should be creating your package tar > ball, so you simply add the --resave-data argument to your already existing > R CMD build call which creates the tar ball from your source directory. So > can you elaborate on "doesn't do anything I can see"? In what sense? No > output? No compression? > > Cheers, > Simon > > > > Is there a piece of the puzzle I am missing or instructions better than > > these: I tried LazyDataCompression and my > > data.rdb is 90Kb. > > > > "Package *tools* has a couple of functions to help with data images: > > checkRdaFiles reports on the way the image was saved, and resaveRdaFiles > will > > re-save with a different type of compression, including choosing the best > > type for that particular image. > > > > Some packages using LazyData will benefit from using a form of > > compression other than gzip in the installed lazy-loading database. This > > can be selected by the --data-compress option to R CMD INSTALL or by > using > > the LazyDataCompression field in the DESCRIPTION file. Useful values > are > > bzip2, xz and the default, gzip. The only way to discover which is best > is > > to try them all and look at the size of the pkgname/data/Rdata.rdb file." > > > > [[alternative HTML version deleted]] > > > > __ > > R-devel@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-devel > > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Compressing data for package builds
I believe that was my boneheaded error.. checking now.. Yup Thanks guys! On Fri, Aug 17, 2012 at 3:01 AM, Uwe Ligges wrote: > > > On 17.08.2012 07:24, steven mosher wrote: > >> " R CMD build is how you preferably should be creating your package tar >> ball, so you simply add the --resave-data argument to your already >> existing >> R CMD build call which creates the tar ball from your source directory. So >> can you elaborate on "doesn't do anything I can see"? In what sense? No >> output? No compression? " >> >> my tarball builds with > R CDM build mattools >> >> where mattools is the name of the package. and I get a warning on R CMD >> check. >> >> Things I tried >> >> R CMD build --resave-data >> R CMD build mattools --resave-data >> R CMD build --resave-data mattools >> >> The first does nothing, the second fails on unknown options and the third >> fails on unknown options. So I found the help for R CMD >> >> Now that I figured out how to display help for R CMD build I see that >> >> --resave-data must include a specification of the type of compression >> >> --resave-data="best" for example >> >> I ran that. and got the same error indicating that the rda file had not >> been compressed. >> >> checking data for non-ASCII characters ... OK >> * checking data for ASCII and uncompressed saves ... WARNING >>Warning: large data file(s) saved inefficiently: >> size ASCII compress >>zagoskin.rda 137Kb FALSE none >> >>Note: significantly better compression could be obtained >> by using R CMD build --resave-data >> old_size new_size compress >>modpoll.rda 124Kb 78Kb xz >>zagoskin.rda137Kb 6Kbbzip2 >> >> Building under windows so I wonder if I am missing a system file required >> to do the compression. >> > > > > Are you checking the tarball (as recommended) or the source dir? The > compressed versions are in the tarball. The source dir is not changed. > > Uwe Liges > > > > > > > > >> On Thu, Aug 16, 2012 at 5:48 PM, Simon Urbanek >> **wrote: >> >> >>> On Aug 16, 2012, at 5:08 PM, steven mosher wrote: >>> >>> Hi, >>>> >>>> I have two .rda files that I need to include in a package. I've placed >>>> them both in a data directory >>>> after save() the are around 150Kb each. >>>> >>>> When I try to check the package I get the following warning >>>> >>>> Warning: large data file(s) saved inefficiently: >>>> size ASCII compress >>>> zagoskin.rda 137Kb FALSE none >>>> >>>> Note: significantly better compression could be obtained >>>> by using R CMD build --resave-data >>>>old_size new_size compress >>>> modpoll.rda 124Kb 78Kb xz >>>> zagoskin.rda137Kb 6Kbbzip2 >>>> >>>> Both of these files modpoll.rda and zagoskin.rda have already been >>>> compressed from megabytes down to Kb. >>>> >>>> Also,, the instructions"R CMD build --resave-data" doesnt do >>>> >>> anything >>> >>>> that I can see so I must be using it wrong. >>>> >>> >>> R CMD build is how you preferably should be creating your package tar >>> ball, so you simply add the --resave-data argument to your already >>> existing >>> R CMD build call which creates the tar ball from your source directory. >>> So >>> can you elaborate on "doesn't do anything I can see"? In what sense? No >>> output? No compression? >>> >>> Cheers, >>> Simon >>> >>> >>> Is there a piece of the puzzle I am missing or instructions better than >>>> these: I tried LazyDataCompression and my >>>> data.rdb is 90Kb. >>>> >>>> "Package *tools* has a couple of functions to help with data images: >>>> checkRdaFiles reports on the way the image was saved, and resaveRdaFiles >>>> >>> will >>> >>>> re-save with a different type of compression, including choosing the >>>> best >>>> type for that particular image. >>>> >>>> Some packages using LazyData will b
Re: [Rd] Suggestion: Change default to download.file(..., mode="wb") ...instead of mode="w" with some bells and whistles
I would second this suggestion. On Wed, Aug 29, 2012 at 12:27 PM, Henrik Bengtsson wrote: > Hi, > > I keep seeing the problem where people are download binary files as > text (mode="w") when using R's download.file() for FTP/HTTP downloads. > It often results in unnecessary troubleshooting until one concludes > that the downloaded file has been corrupted due to (what I think is) > translated newlines. Search the r-help mailing list and you'll find > other examples of this. This may or may not only be a problem for > Windows users. > > I'd like to suggest to change the default of argument 'mode' of > download.file() to be mode="wb". The "default" is current mode="w" > except when argument 'mode' is missing (not explicitly given), > download.file() tries to be helpful by forcing 'mode' to be "wb" for > certain filename extensions. NB: help("download.file", > package="utils") has a paragraph on all this. BTW, the latter seems > to be done in a case-sensitive way, such that *.zip and *.ZIP will > have different behaviors. > > Wouldn't it just be safer to change the default to mode="wb"? ...or > are there use cases that I'm overseeing - is anyone out there > intentionally using the "text" transfer mode? > > /Henrik > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] R 3.0, Rtools3.0,l Windows7 64-bit, and permission agony
Well, color me confused as heck. I've upgraded to R 3.0 so that I can bring my packages up to date, but the instructions surrounding Rtools30 are not a model of clarity. On Sun, Apr 21, 2013 at 4:04 PM, Gabor Grothendieck wrote: > On Sun, Apr 21, 2013 at 6:17 PM, Henrik Bengtsson > wrote: > > I (as well) keep a specific Rsetup.bat file for launching Windows > > cmd.exe with the proper PATH etc setup for build R packages etc. It's > > only after this thread I gave it a second thought; you can indeed > > temporarily set the PATH via ~/.Rprofile or ~/.Renviron, which *are* > > processed at the very beginning when calling 'R CMD ...'. > > > > EXAMPLE WITH .Rprofile: > > > > ## ~/.Rprofile (e.g. C:/User/foo/.Rprofile): > > path <- unlist(strsplit(Sys.getenv("PATH"), ";")); > > path <- c("C:\\Rtools\\bin", "C:\\Rtools\\gcc-4.6.3\\bin", path); > > Sys.setenv("PATH"=paste(unique(path), collapse=";")); > > > > ## DISABLED: > > x:\> R --no-init-file CMD INSTALL matrixStats_0.6.2.tar.gz > > * installing to library 'C:/Users/hb/R/win-library/3.0' > > * installing *source* package 'matrixStats' ... > > ** libs > > *** arch - i386 > > ERROR: compilation failed for package 'matrixStats' > > * removing 'C:/Users/hb/R/win-library/3.0/matrixStats' > > > > ## ENABLED: > > x:\> R CMD INSTALL matrixStats_0.6.2.tar.gz > > * installing to library 'C:/Users/hb/R/win-library/3.0' > > * installing *source* package 'matrixStats' ... > > ** libs > > *** arch - i386 > > gcc -m32 -I"C:/PROGRA~1/R/R-3.0.0patched/include" -DNDEBUG [...] > > [...] > > * DONE (matrixStats) > > > > > > EXAMPLE WITH .Renviron: > > ## ~/.Renviron (e.g. C:/User/foo/.Renviron): > > # Backslashes are preserved iff put within quotes > > PATH="C:\Rtools\bin;C:\Rtools\gcc-4.6.3\bin;${PATH}" > > > > x:\> R --no-environ CMD INSTALL matrixStats_0.6.2.tar.gz > > => fails > > > > x:\> R CMD INSTALL matrixStats_0.6.2.tar.gz > > => works > > > > As long as R is on the PATH, the above either of the approaches > > removes the need to add Rtools to the PATH via a BAT file and it won't > > clutter up your PATH. This begs the question (as somewhat already > > proposed), instead of users/developers doing this manually, would it > > be possible to have 'R CMD ...' to locate add Rtools to the PATH > > internally. That would certainly lower the barriers for newcomers to > > install packages from source that need compilation. Obviously, this > > doesn't make the tools (e.g. make) in Rtools available outside of R, > > it does not allow you to build R itself from source, but it does cover > > the very common use cases of calling 'R CMD build/INSTALL/check/...'. > > > > /Henrik > > > > PS. Hadley, is this what you meant when you wrote "Better solutions > > (e.g. Rstudio and devtools) temporarily set the path on when you're > > calling R CMD *.", or those approaches are only when you call 'R CMD' > > from the R prompt? I believe the latter, but I just want to make sure > > I didn't miss something. > > That seems like a reasonable approach although the code shown does > entail more setup and ongoing maintenance by the user than R.bat which > does not require that the user edit any files and additionally locates > R itself and has many other features. Also, because R.bat locates R > itself it can be useful even if you are not doing development. On the > other hand if you are looking to do development strictly from within R > then devtools is already developed. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel