[Rd] Example input data with example output using relative pathway in vignette of R package?
I'm putting together an R package. I would like to show example code in the vignette, where example data files (included in the package) are used to generate an (example) output file. I read about using example data in Hadley Wickham's post ( http://r-pkgs.had.co.nz/data.html), and believe I should keep my example data as raw data, as it must be parsed to generate the output. So, I created a directory in my package structure /Users/userName/myPackage/inst/extdata/ with subdirectories InputFiles and OutputFiles. And I put the example file (exampleData.csv) inside of the InputFiles subdirectory (/Users/userName/myPackage/inst/extdata/InputFiles). My vignette is located in: /Users/userName/myPackage/vignettes/myPackage.Rnw It contains the following syntax: <>= fileString = "/Users/userName/myPackage/inst/extdata/InputFiles/exampleData.csv" doFunction1(fileString) doFunction2(fileString) doFunction3(fileString, output ="Users/userName/myPackage/inst/extdata/OutputFiles")@ I am having two problems with developing this vignette and its example datasets: 1) I am unsure if my use of the extdata file is appropriate. This seemed to be the best directory name and location to place my example files, according to the aforementioned Hadley Wickham reference. 2) I am unsure how to make the pathways relative, instead of absolute, as I have them currently. This example code does not run automatically, as you can see. Instead, I have it under an R chunk of eval=FALSE so that it is simply listed there for the users to test themselves. After running the example code, the users can also check that the output file was indeed created in (/Users/userName/myPackage/inst/extdata/OutputFiles). What is the best way for me to allow the user to not have to use an absolute path when following the example? Is it possible to just follow a relative path from within the package directory myPackage? I cannot create a help manual (AFAIK) because this example code is not just an example of running one function; instead, it is an example of running several functions and then viewing the output. If it would make more sense for me to just run the R chunk with eval=TRUE, I would have the same question: How could I get it to automatically run with just relative pathways? Thank you for any advice! [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Submitting an updated package version to CRAN (Warning: non-ASCII characters)
Dear all: I am updating the version of an R package I submitted last year on CRAN and came across two questions that I would be grateful to seek any input about: 1) In the updated version of the package, I am adding a second example dataset. This example dataset is a subset of a public database that contains thousands of names. Upon running devtools::check(), I am only getting one warning. ("Warning: found non-ASCII strings"). It seems this warning is coming from special characters in some of the names. As it is ideal that the names should not be altered, I did not know what approach to take. Should I simply include a note in my CRAN submission indicating that the non-ASCII characters are meaningfully inherent to the example data? Or, should I convert the names to ASCII characters (if that is easily possible for so many cases), and indicate to users that names have been altered (special characters removed)? 2) I have never submitted an updated version of a package to CRAN. I am considering following a similar process to what I did to submit my original version of the package to CRAN. That is, using devtools::release() and including a note in a file called cran-comments.md to indicate that this is not an original version submission, but rather, an updated version submission. I found these advice on Hadley Wickhams site ( http://r-pkgs.had.co.nz/release.html), but could not determine if this was appropriate for version update submissions as well. Thank you for sharing any advice! [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Submitting an updated package version to CRAN (Warning: non-ASCII characters)
Thank you, Prof Brian Ripley. That is a helpful resource! Since my only non-ASCII characters are in an example data frame, I think I will use the iconv() function to convert that example data frame into UTF-8. Then, I will indicate that R version >=2.10 must be in the Depends field of the DESCRIPTION file, as the resource indicates. On Mon, May 23, 2016 at 3:46 AM, Prof Brian Ripley wrote: > On 21/05/2016 21:25, Luck Buttered wrote: > >> Dear all: >> >> I am updating the version of an R package I submitted last year on CRAN >> and >> came across two questions that I would be grateful to seek any input >> about: >> >> 1) In the updated version of the package, I am adding a second example >> dataset. This example dataset is a subset of a public database that >> contains thousands of names. Upon running devtools::check(), I am only >> getting one warning. ("Warning: found non-ASCII strings"). >> >> It seems this warning is coming from special characters in some of the >> names. As it is ideal that the names should not be altered, I did not know >> what approach to take. Should I simply include a note in my CRAN >> submission >> indicating that the non-ASCII characters are meaningfully inherent to the >> example data? Or, should I convert the names to ASCII characters (if that >> is easily possible for so many cases), and indicate to users that names >> have been altered (special characters removed)? >> > > You should follow the advice of the manual: > https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Encoding-issues > . There is not enough detail here to know what you currently do (let alone > what you should do), but that message indicates that the encoding of > non-ASCII stings (what you call 'special characters') has not been declared > (and to be portable they should be in UTF-8). > > 2) I have never submitted an updated version of a package to CRAN. I am >> considering following a similar process to what I did to submit my >> original >> version of the package to CRAN. That is, using devtools::release() and >> including a note in a file called cran-comments.md to indicate that this >> is >> not an original version submission, but rather, an updated version >> submission. I found these advice on Hadley Wickhams site ( >> http://r-pkgs.had.co.nz/release.html), but could not determine if this >> was >> appropriate for version update submissions as well. >> > > There is a list for discussing package preparation, r-package-devel. > > > Thank you for sharing any advice! >> > > > > -- > Brian D. Ripley, rip...@stats.ox.ac.uk > Emeritus Professor of Applied Statistics, University of Oxford > > __ > 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] Fixing ambiguous corrections and reattempting to submit package to R
Hello: I recently submitted a package to R using devtools:release(). I received no errors, warnings, or notes in R CMD check. However, I received two notes in devtools::release(): 1) checking CRAN incoming feasibility ... NOTE 2) checking package dependencies ... NOTE No repository set, so cyclic dependency check skipped After I submitted the package, I was told to fix two things, of which I am unsure: 1) The Title field should be in title case, current version then in title case 2) checking CRAN incoming feasibility ... NOTE For the first issue, I changed my title field in the DESCRIPTION file to be title case, as it had been all lower-case. However, I do not know if that is a sufficient change, given their response wording "The Title field should be in title case, current version then in title case". If all I need to do is change my title field to title case, I would imagine their response would simply be "The Title field should be in title case". When I did research on the second issue (from websites like these): 1) http://stackoverflow.com/questions/23829978/checking-cran-incoming-feasibility-note-maintainer 2) http://grokbase.com/t/r/r-help/129ncmtvga/r-new-submission-to-cran-note The first website tells me to ignore the note, with a reference to CRAN member Uwe Ligges, while the second website tells me to send an e-mail to cran at r-project.org, and state that I agree to the CRAN repository policies. So, would it be correct (of good etiquette) for me to simply change my title field in the DESCRIPTION field to title case, rerun devtools::release(), and then send an e-mail to cran at r-project.org, and state that I agree to the CRAN repository policies (which I did not do the first time I submitted)? Thank you for any advice. Below is the format of my DESCRIPTION file: Package: packageName Version: 0.1.0 Title: Title in Title Case that does not end in Period Description: Statement about methods available. Author: Author One, Author Two Maintainer: Author One License: GPL Depends: R (>= 3.0.2) Imports: ggplot2 (>= 1.0.0), VignetteBuilder: knitr Suggests: knitr, roxygen2 (>= 3.0.0) Roxygen: list(wrap = TRUE) [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel