Re: [R-pkg-devel] vignette problems: invisible
Thanks a lot - that solved the issue! Best wishes Troels -Oprindelig meddelelse- Fra: Duncan Murdoch Sendt: 1. februar 2019 15:42 Til: Troels Ring ; package-develop Emne: Re: [R-pkg-devel] vignette problems: invisible On 01/02/2019 9:23 a.m., Duncan Murdoch wrote: > On 01/02/2019 8:22 a.m., Troels Ring wrote: >> devtools::install_github("troelsring/ABCharge",force=TRUE,build_vigne >> ttes = >> TRUE) > > That looks like an issue with install_github. The normal way to > install a package is to build the tarball, then install from that. > When I do that with your package, I get the vignette. The issue is that by default, install_github() passes the "--no-build-vignettes" option to R CMD build. Using this command line does a full install: devtools::install_github("troelsring/ABCharge",force=TRUE, build=TRUE, build_opts=NULL) Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] vignette problems: invisible
By the way: devtools::install_github("troelsring/ABCharge",force=TRUE,build_vignettes = TRUE) didn't help BW Troels Fra: Troels Ring Sendt: 1. februar 2019 12:15 Til: package-develop (r-package-devel@r-project.org) Emne: vignette problems: invisible Dear friends - I'm closing in on finalizing the package and its current version is on github/troelsring/ABCharge and it passes ctrl shift E without errors and now also has a vignette. I can see the vignette OK in its directory but issuing after installing from github by devtools, it cannot be called from help(package="ABCharge") or : vignette(package="ABCharge"). > devtools::install_github("troelsring/ABCharge",force=TRUE) Downloading GitHub repo troelsring/ABCharge@master checking for file 'C:\Users\Troels\AppData\Local\Temp\RtmpSa60vS\remotes2b4452b72409\troelsrin g-ABCharge-4b62da6/DESCRIPTION' ... checking for file 'C:\Users\Troels\AppData\Local\Temp\RtmpSa60vS\remotes2b4452b72409\troelsrin g-ABCharge-4b62da6/DESCRIPTION' ... v checking for file 'C:\Users\Troels\AppData\Local\Temp\RtmpSa60vS\remotes2b4452b72409\troelsrin g-ABCharge-4b62da6/DESCRIPTION' - preparing 'ABCharge': checking DESCRIPTION meta-information ... checking DESCRIPTION meta-information ... v checking DESCRIPTION meta-information - checking for LF line-endings in source and make files and shell scripts - checking for empty or unneeded directories - looking to see if a 'data/datalist' file should be added - building 'ABCharge_0.1.0.tar.gz' Installing package into 'C:/Users/Troels/Documents/R/win-library/3.5' (as 'lib' is unspecified) * installing *source* package 'ABCharge' ... ** R ** data ** byte-compile and prepare package for lazy loading ** help *** installing help indices converting help for package 'ABCharge' finding HTML links ... done BCharge html Baeza html Bspecif html CMB html CO2specif html GET_CH html K3 html Kc html Pittsburgh html Schell html Tessman html bromhtml getIhtml getfs html kw html malate html pH_general html ** building package indices ** installing vignettes ** testing if installed package can be loaded *** arch - i386 *** arch - x64 * DONE (ABCharge) In R CMD INSTALL > help(package=ABCharge) starting httpd help server ... done > vignette(package="ABCharge") no vignettes found I believe I have been through the list in Hadley's "Vignettes: long-form documentation" without finding the explanation. Wonder what error I did make: All best wishes Troels Ring, MD [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] vignette problems: invisible
Dear friends - I'm closing in on finalizing the package and its current version is on github/troelsring/ABCharge and it passes ctrl shift E without errors and now also has a vignette. I can see the vignette OK in its directory but issuing after installing from github by devtools, it cannot be called from help(package="ABCharge") or : vignette(package="ABCharge"). > devtools::install_github("troelsring/ABCharge",force=TRUE) Downloading GitHub repo troelsring/ABCharge@master checking for file 'C:\Users\Troels\AppData\Local\Temp\RtmpSa60vS\remotes2b4452b72409\troelsrin g-ABCharge-4b62da6/DESCRIPTION' ... checking for file 'C:\Users\Troels\AppData\Local\Temp\RtmpSa60vS\remotes2b4452b72409\troelsrin g-ABCharge-4b62da6/DESCRIPTION' ... v checking for file 'C:\Users\Troels\AppData\Local\Temp\RtmpSa60vS\remotes2b4452b72409\troelsrin g-ABCharge-4b62da6/DESCRIPTION' - preparing 'ABCharge': checking DESCRIPTION meta-information ... checking DESCRIPTION meta-information ... v checking DESCRIPTION meta-information - checking for LF line-endings in source and make files and shell scripts - checking for empty or unneeded directories - looking to see if a 'data/datalist' file should be added - building 'ABCharge_0.1.0.tar.gz' Installing package into 'C:/Users/Troels/Documents/R/win-library/3.5' (as 'lib' is unspecified) * installing *source* package 'ABCharge' ... ** R ** data ** byte-compile and prepare package for lazy loading ** help *** installing help indices converting help for package 'ABCharge' finding HTML links ... done BCharge html Baeza html Bspecif html CMB html CO2specif html GET_CH html K3 html Kc html Pittsburgh html Schell html Tessman html bromhtml getIhtml getfs html kw html malate html pH_general html ** building package indices ** installing vignettes ** testing if installed package can be loaded *** arch - i386 *** arch - x64 * DONE (ABCharge) In R CMD INSTALL > help(package=ABCharge) starting httpd help server ... done > vignette(package="ABCharge") no vignettes found I believe I have been through the list in Hadley's "Vignettes: long-form documentation" without finding the explanation. Wonder what error I did make: All best wishes Troels Ring, MD [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] package docu
Thanks a lot - I followed your suggestion, and prompt generated under usage: data(kw) - which is not working as kw is just a single number. So I just removed the usage section and no complaints are left. Thanks for all help! BW Troels -Oprindelig meddelelse- Fra: Duncan Murdoch Sendt: 26. januar 2019 22:08 Til: Troels Ring ; 'Michael Dewey' ; 'package-develop' Emne: Re: SV: [R-pkg-devel] package docu On 26/01/2019 9:04 a.m., Troels Ring wrote: > Thanks a lot - I tried with prompt(kw) and that warning disappeared > but instead I got another >> checking for code/documentation mismatches ... WARNING >Data with usage in documentation object 'kw' but not in code: > Kw > > And the code is really full og kw - That message is about the Rd file, not the code. Look for Kw in the \usage section. You haven't pushed this file to Github, so I can't offer any more advice. Duncan Murdoch > > I'm so sorry to bother > BW > Troels > > -Oprindelig meddelelse- > Fra: Duncan Murdoch > Sendt: 26. januar 2019 14:45 > Til: Troels Ring ; 'Michael Dewey' > ; 'package-develop' > > Emne: Re: [R-pkg-devel] package docu > > On 26/01/2019 8:31 a.m., Troels Ring wrote: >> Dear Michael - fantastic: TOTAL is now acknowledged -- so I only need the >> constants kw, K3, and Kc from the utility_acid.r file - how for format their >> documentation - they are available as required inside and outside the >> package. > > Within R, set your working directory to the man directory for your > package, then run > > prompt(kw) > > and it will create kw.Rd in the right format. You just need to edit it to > fill in the details. There will be comments in the file explaining what to > do. Don't put quotes on the name; prompt("kw") is wrong. > > Duncan Murdoch > > >> >> All best wishes >> Troels >> >> -Oprindelig meddelelse- >> Fra: Michael Dewey >> Sendt: 26. januar 2019 13:17 >> Til: Troels Ring ; package-develop >> >> Emne: Re: [R-pkg-devel] package docu >> >> Dear Troels >> >> What happens if you add \alias{TOTAL} >> >> Michael >> >> On 26/01/2019 08:15, Troels Ring wrote: >>> Dear friends - I'm struggling to get the documentation of my package >>> correct. The working package is now (with your help!) at >>> >>> devtools::install_github("troelsring/ABCharge") >>> >>> and in its proto version includes only a single dataset "brom.RData" >>> which has two components, a data.frame "brom" and a matrix TOTAL. >>> These are documented in the brom.RD file shown below. >>> >>> >>> >>> >>> >>> \name{brom} >>> >>> \alias{brom} >>> >>> \docType{data} >>> >>> \title{ >>> >>> bromic acid data from Glaser et al 2014 >>> >>> } >>> >>> \description{ >>> >>> Data to find optimal pK for bromic acid >>> >>> } >>> >>> \usage{data("brom")} >>> >>> \format{ >>> >>> A workspace. >>> >>> \describe{ >>> >>>\item{brom}{Dataframe of Table S4 in Glaser et al.} >>> >>>\item{TOTAL}{Matrix of buffer concentrations.} >>> >>> } >>> >>> } >>> >>> \source{ >>> >>> Glaser RE et al. Dynamical approach to multiequilibria problems for >>> mixtures of >>> >>> acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 >>> >>> } >>> >>> \examples{ >>> >>> data(brom) >>> >>> - a long example - works well >>> >>> >>> >>> Now when running ctrl-shift-E, I get >>> >>> >>> >>>> checking for missing documentation entries ... WARNING >>> >>> Undocumented code objects: >>> >>>'K3' 'Kc' 'kw' >>> >>> Undocumented data sets: >>> >>>'TOTAL' >>> >>> All user-level objects in a package should have documentation entries. >>> >>> See chapter 'Writing R documentation files' in the 'Writing R >>> >>> Extensions' manual. >>> >>> >>> >>> 0 errors v | 1 warning x | 0 notes v >>> >>> Fejl: R CMD check found WARNINGs >>> >>> run stoppet >>> >>> >>> >>> Exited with status 1. >>> >>> >>> >>> I wonder why the specification of TOTAL in the RD file is ignored? >>> >>> >>> >>> Also the three constants kw, Kc, and K3 are not properly documented. >>> They are declared and exported in the utility_acid.r file and I have >>> tried to document them as @params in that file but it seems to be >>> ignored and cause other problems so I have them at present >>> undocumented since I don't know where to put the documentation. >>> >>> >>> [[alternative HTML version deleted]] >>> >>> __ >>> R-package-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-package-devel >>> >> >> -- >> Michael >> http://www.dewey.myzen.co.uk/home.html >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> > > __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] package docu
Thanks a lot - but it is really kw and not Kw everywhere - according to "find in files" etc - thanks a lot for your patience and interest! BW Troels -Oprindelig meddelelse- Fra: Michael Dewey Sendt: 26. januar 2019 15:48 Til: Troels Ring ; 'Duncan Murdoch' ; 'package-develop' Emne: Re: SV: [R-pkg-devel] package docu Well in the usage section it says Kw but elsewhere kw so you need to make them match. Probably some "helpful" part of your system is capitalising things without you noticing. Michael On 26/01/2019 14:04, Troels Ring wrote: > Thanks a lot - I tried with prompt(kw) and that warning disappeared > but instead I got another >> checking for code/documentation mismatches ... WARNING >Data with usage in documentation object 'kw' but not in code: > Kw > > And the code is really full og kw - > > I'm so sorry to bother > BW > Troels > > -Oprindelig meddelelse- > Fra: Duncan Murdoch > Sendt: 26. januar 2019 14:45 > Til: Troels Ring ; 'Michael Dewey' > ; 'package-develop' > > Emne: Re: [R-pkg-devel] package docu > > On 26/01/2019 8:31 a.m., Troels Ring wrote: >> Dear Michael - fantastic: TOTAL is now acknowledged -- so I only need the >> constants kw, K3, and Kc from the utility_acid.r file - how for format their >> documentation - they are available as required inside and outside the >> package. > > Within R, set your working directory to the man directory for your > package, then run > > prompt(kw) > > and it will create kw.Rd in the right format. You just need to edit it to > fill in the details. There will be comments in the file explaining what to > do. Don't put quotes on the name; prompt("kw") is wrong. > > Duncan Murdoch > > >> >> All best wishes >> Troels >> >> -Oprindelig meddelelse- >> Fra: Michael Dewey >> Sendt: 26. januar 2019 13:17 >> Til: Troels Ring ; package-develop >> >> Emne: Re: [R-pkg-devel] package docu >> >> Dear Troels >> >> What happens if you add \alias{TOTAL} >> >> Michael >> >> On 26/01/2019 08:15, Troels Ring wrote: >>> Dear friends - I'm struggling to get the documentation of my package >>> correct. The working package is now (with your help!) at >>> >>> devtools::install_github("troelsring/ABCharge") >>> >>> and in its proto version includes only a single dataset "brom.RData" >>> which has two components, a data.frame "brom" and a matrix TOTAL. >>> These are documented in the brom.RD file shown below. >>> >>> >>> >>> >>> >>> \name{brom} >>> >>> \alias{brom} >>> >>> \docType{data} >>> >>> \title{ >>> >>> bromic acid data from Glaser et al 2014 >>> >>> } >>> >>> \description{ >>> >>> Data to find optimal pK for bromic acid >>> >>> } >>> >>> \usage{data("brom")} >>> >>> \format{ >>> >>> A workspace. >>> >>> \describe{ >>> >>>\item{brom}{Dataframe of Table S4 in Glaser et al.} >>> >>>\item{TOTAL}{Matrix of buffer concentrations.} >>> >>> } >>> >>> } >>> >>> \source{ >>> >>> Glaser RE et al. Dynamical approach to multiequilibria problems for >>> mixtures of >>> >>> acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 >>> >>> } >>> >>> \examples{ >>> >>> data(brom) >>> >>> - a long example - works well >>> >>> >>> >>> Now when running ctrl-shift-E, I get >>> >>> >>> >>>> checking for missing documentation entries ... WARNING >>> >>> Undocumented code objects: >>> >>>'K3' 'Kc' 'kw' >>> >>> Undocumented data sets: >>> >>>'TOTAL' >>> >>> All user-level objects in a package should have documentation entries. >>> >>> See chapter 'Writing R documentation files' in the 'Writing R >>> >>> Extensions' manual. >>> >>> >>> >>> 0 errors v | 1 warning x | 0 notes v >>> >>> Fejl: R CMD check found WARNINGs >>> >>> run stoppet >>> >>> >>> >>> Exited with status 1. >>> >>> >>> >>> I wonder why the specification of TOTAL in the RD file is ignored? >>> >>> >>> >>> Also the three constants kw, Kc, and K3 are not properly documented. >>> They are declared and exported in the utility_acid.r file and I have >>> tried to document them as @params in that file but it seems to be >>> ignored and cause other problems so I have them at present >>> undocumented since I don't know where to put the documentation. >>> >>> >>> [[alternative HTML version deleted]] >>> >>> __ >>> R-package-devel@r-project.org mailing list >>> https://stat.ethz.ch/mailman/listinfo/r-package-devel >>> >> >> -- >> Michael >> http://www.dewey.myzen.co.uk/home.html >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> > > > -- Michael http://www.dewey.myzen.co.uk/home.html __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] package docu
Thanks a lot - I tried with prompt(kw) and that warning disappeared but instead I got another > checking for code/documentation mismatches ... WARNING Data with usage in documentation object 'kw' but not in code: Kw And the code is really full og kw - I'm so sorry to bother BW Troels -Oprindelig meddelelse- Fra: Duncan Murdoch Sendt: 26. januar 2019 14:45 Til: Troels Ring ; 'Michael Dewey' ; 'package-develop' Emne: Re: [R-pkg-devel] package docu On 26/01/2019 8:31 a.m., Troels Ring wrote: > Dear Michael - fantastic: TOTAL is now acknowledged -- so I only need the > constants kw, K3, and Kc from the utility_acid.r file - how for format their > documentation - they are available as required inside and outside the package. Within R, set your working directory to the man directory for your package, then run prompt(kw) and it will create kw.Rd in the right format. You just need to edit it to fill in the details. There will be comments in the file explaining what to do. Don't put quotes on the name; prompt("kw") is wrong. Duncan Murdoch > > All best wishes > Troels > > -Oprindelig meddelelse- > Fra: Michael Dewey > Sendt: 26. januar 2019 13:17 > Til: Troels Ring ; package-develop > > Emne: Re: [R-pkg-devel] package docu > > Dear Troels > > What happens if you add \alias{TOTAL} > > Michael > > On 26/01/2019 08:15, Troels Ring wrote: >> Dear friends - I'm struggling to get the documentation of my package >> correct. The working package is now (with your help!) at >> >> devtools::install_github("troelsring/ABCharge") >> >> and in its proto version includes only a single dataset "brom.RData" >> which has two components, a data.frame "brom" and a matrix TOTAL. >> These are documented in the brom.RD file shown below. >> >> >> >> >> >> \name{brom} >> >> \alias{brom} >> >> \docType{data} >> >> \title{ >> >> bromic acid data from Glaser et al 2014 >> >> } >> >> \description{ >> >> Data to find optimal pK for bromic acid >> >> } >> >> \usage{data("brom")} >> >> \format{ >> >> A workspace. >> >> \describe{ >> >> \item{brom}{Dataframe of Table S4 in Glaser et al.} >> >> \item{TOTAL}{Matrix of buffer concentrations.} >> >> } >> >> } >> >> \source{ >> >> Glaser RE et al. Dynamical approach to multiequilibria problems for >> mixtures of >> >> acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 >> >> } >> >> \examples{ >> >> data(brom) >> >> - a long example - works well >> >> >> >> Now when running ctrl-shift-E, I get >> >> >> >>> checking for missing documentation entries ... WARNING >> >> Undocumented code objects: >> >> 'K3' 'Kc' 'kw' >> >> Undocumented data sets: >> >> 'TOTAL' >> >> All user-level objects in a package should have documentation entries. >> >> See chapter 'Writing R documentation files' in the 'Writing R >> >> Extensions' manual. >> >> >> >> 0 errors v | 1 warning x | 0 notes v >> >> Fejl: R CMD check found WARNINGs >> >> run stoppet >> >> >> >> Exited with status 1. >> >> >> >> I wonder why the specification of TOTAL in the RD file is ignored? >> >> >> >> Also the three constants kw, Kc, and K3 are not properly documented. >> They are declared and exported in the utility_acid.r file and I have >> tried to document them as @params in that file but it seems to be >> ignored and cause other problems so I have them at present >> undocumented since I don't know where to put the documentation. >> >> >> [[alternative HTML version deleted]] >> >> __ >> R-package-devel@r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-package-devel >> > > -- > Michael > http://www.dewey.myzen.co.uk/home.html > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] package docu
Dear Michael - fantastic: TOTAL is now acknowledged -- so I only need the constants kw, K3, and Kc from the utility_acid.r file - how for format their documentation - they are available as required inside and outside the package. All best wishes Troels -Oprindelig meddelelse- Fra: Michael Dewey Sendt: 26. januar 2019 13:17 Til: Troels Ring ; package-develop Emne: Re: [R-pkg-devel] package docu Dear Troels What happens if you add \alias{TOTAL} Michael On 26/01/2019 08:15, Troels Ring wrote: > Dear friends - I'm struggling to get the documentation of my package > correct. The working package is now (with your help!) at > > devtools::install_github("troelsring/ABCharge") > > and in its proto version includes only a single dataset "brom.RData" > which has two components, a data.frame "brom" and a matrix TOTAL. > These are documented in the brom.RD file shown below. > > > > > > \name{brom} > > \alias{brom} > > \docType{data} > > \title{ > > bromic acid data from Glaser et al 2014 > > } > > \description{ > >Data to find optimal pK for bromic acid > > } > > \usage{data("brom")} > > \format{ > > A workspace. > >\describe{ > > \item{brom}{Dataframe of Table S4 in Glaser et al.} > > \item{TOTAL}{Matrix of buffer concentrations.} > >} > > } > > \source{ > > Glaser RE et al. Dynamical approach to multiequilibria problems for > mixtures of > > acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 > > } > > \examples{ > > data(brom) > > - a long example - works well > > > > Now when running ctrl-shift-E, I get > > > >> checking for missing documentation entries ... WARNING > >Undocumented code objects: > > 'K3' 'Kc' 'kw' > >Undocumented data sets: > > 'TOTAL' > >All user-level objects in a package should have documentation entries. > >See chapter 'Writing R documentation files' in the 'Writing R > >Extensions' manual. > > > > 0 errors v | 1 warning x | 0 notes v > > Fejl: R CMD check found WARNINGs > > run stoppet > > > > Exited with status 1. > > > > I wonder why the specification of TOTAL in the RD file is ignored? > > > > Also the three constants kw, Kc, and K3 are not properly documented. > They are declared and exported in the utility_acid.r file and I have > tried to document them as @params in that file but it seems to be > ignored and cause other problems so I have them at present > undocumented since I don't know where to put the documentation. > > > [[alternative HTML version deleted]] > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > -- Michael http://www.dewey.myzen.co.uk/home.html __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] package docu
Dear friends - I'm struggling to get the documentation of my package correct. The working package is now (with your help!) at devtools::install_github("troelsring/ABCharge") and in its proto version includes only a single dataset "brom.RData" which has two components, a data.frame "brom" and a matrix TOTAL. These are documented in the brom.RD file shown below. \name{brom} \alias{brom} \docType{data} \title{ bromic acid data from Glaser et al 2014 } \description{ Data to find optimal pK for bromic acid } \usage{data("brom")} \format{ A workspace. \describe{ \item{brom}{Dataframe of Table S4 in Glaser et al.} \item{TOTAL}{Matrix of buffer concentrations.} } } \source{ Glaser RE et al. Dynamical approach to multiequilibria problems for mixtures of acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 } \examples{ data(brom) - a long example - works well Now when running ctrl-shift-E, I get > checking for missing documentation entries ... WARNING Undocumented code objects: 'K3' 'Kc' 'kw' Undocumented data sets: 'TOTAL' All user-level objects in a package should have documentation entries. See chapter 'Writing R documentation files' in the 'Writing R Extensions' manual. 0 errors v | 1 warning x | 0 notes v Fejl: R CMD check found WARNINGs run stoppet Exited with status 1. I wonder why the specification of TOTAL in the RD file is ignored? Also the three constants kw, Kc, and K3 are not properly documented. They are declared and exported in the utility_acid.r file and I have tried to document them as @params in that file but it seems to be ignored and cause other problems so I have them at present undocumented since I don't know where to put the documentation. [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] submitting to github
Thanks a lot - since this is primarily a practical problem of making an actually working package available through github I used the drag and drop approach suggested by Martin Smith simply taking all project files from the RStudio project into the repository and it worked. Eventually I'll find out about how to integrate better with git, if necessary. But now the package draft is in place and I can go on extending and improving it. Best wishes Troels -Oprindelig meddelelse- Fra: R-package-devel På vegne af Ben Bolker Sendt: 25. januar 2019 14:24 Til: List r-package-devel Emne: Re: [R-pkg-devel] submitting to github It's not something I've experienced myself, but I've heard that Dropbox and Git don't always play nicely together. Maybe try working outside your dropbox folder? https://www.anishathalye.com/2015/08/19/git-remote-dropbox/ On Fri, Jan 25, 2019 at 6:45 AM SMITH, MARTIN R. wrote: > > Hi Troels, > > This probably doesn't score points for best practice, but if you only need to > post the files to GitHub, you could always set up a new repository on > github.com<http://github.com> and simply drag and drop the relevant files > from your computer into the browser window. > > - Martin > > -- > > Martin R. Smith > Assistant Professor in Palaeontology > Department of Earth Sciences > Durham University > Mountjoy Site, South Road > Durham DH1 3LE > > T: +44 191 334 2320 > M: +44 774 353 7510 > E: martin.sm...@durham.ac.uk<mailto:martin.sm...@durham.ac.uk> > Skype: martin--smith > > durham.ac.uk/earth.sciences/staff/academic/?id=14260<http://durham.ac. > uk/earth.sciences/staff/academic/?id=14260> > twitter.com/PalaeoSmith<http://twitter.com/PalaeoSmith> > > The information in this e-mail and any attachments is confidential. It is > intended solely for the addressee or addressees. If you are not the intended > recipient please delete the message and any attachments and notify the sender > of mis-delivery. Any use or disclosure of the contents of either is > unauthorised and may be unlawful. > Although steps have been taken to ensure that this e-mail and any attachments > are free from any virus, we advise the recipient to ensure they are indeed > virus free. All liability for viruses is excluded to the fullest extent > permitted by law. > > > On Fri, 25 Jan 2019 at 10:17, Joris Meys > mailto:joris.m...@ugent.be>> wrote: > Hi Troels, > > origin: none means that git created a local repository but didn't link > it to a github account yet. If you're not that familiar with git, I > suggest you take a look at Github Desktop. We use that with our > students, and even I still use it sometimes. Github Desktop allows you > to publish a local repository to github with one click. You just have > to set your credentials after installing. > > More info on adding a remote through shell : > https://help.github.com/articles/adding-an-existing-project-to-github- > using-the-command-line/ More info on Github Desktop : > https://desktop.github.com/ > > Hope this helps > Cheers > Joris > > On Fri, Jan 25, 2019 at 10:22 AM Troels Ring > mailto:tr...@gvdnet.dk>> wrote: > > > Hi Stefan – thanks for the question: I have a newly developed > > package which I need to have on github for a publication. So, while > > there still a minor problems in the package as it is, I started to > > trying to interact with github so really I am trying to put a working > > package onto github. > > > > All best > > > > Troels > > > > > > > > Fra: Stefan McKinnon Høj-Edwards > > mailto:s...@iysik.com>> > > Sendt: 25. januar 2019 09:59 > > Til: Troels Ring mailto:tr...@gvdnet.dk>>; > > package-develop < > > r-package-devel@r-project.org<mailto:r-package-devel@r-project.org>> > > Emne: Re: [R-pkg-devel] submitting to github > > > > > > > > Hej Troels, > > > > > > > > What exactly are you trying to acheive here? I.e., are you trying to > > 1) put a new project onto github, or 2) copy a repository on github > > to your local computer, or 3) do as 2) and then update it your > > current modifications? > > > > > > > > > > Stefan McKinnon Høj-Edwards > > > > Mobile: (+45) 2888 6598 > > > > > > > > > > > > Den fre. 25. jan. 2019 kl. 09.51 skrev Troels Ring > > mailto:tr...@gvdnet.dk> > > <mailto:tr...@gvdnet.dk<mailto:tr...@gvdnet.dk>> >: > > > > Dear friends - I'm sorry to bother but seem to be unable to interact > > constructively with github. > > > &g
Re: [R-pkg-devel] submitting to github
Hi Stefan – thanks for the question: I have a newly developed package which I need to have on github for a publication. So, while there still a minor problems in the package as it is, I started to trying to interact with github so really I am trying to put a working package onto github. All best Troels Fra: Stefan McKinnon Høj-Edwards Sendt: 25. januar 2019 09:59 Til: Troels Ring ; package-develop Emne: Re: [R-pkg-devel] submitting to github Hej Troels, What exactly are you trying to acheive here? I.e., are you trying to 1) put a new project onto github, or 2) copy a repository on github to your local computer, or 3) do as 2) and then update it your current modifications? Stefan McKinnon Høj-Edwards Mobile: (+45) 2888 6598 Den fre. 25. jan. 2019 kl. 09.51 skrev Troels Ring mailto:tr...@gvdnet.dk> >: Dear friends - I'm sorry to bother but seem to be unable to interact constructively with github. I try to follow the instructions from Hadley (thanks) - i.e. I have a small trial-project which functions well. Since I have tried many times I start from shell with rm -rf .git and then select version control using git (tools, project options,git/svn) - and origin is still marked as "none" after restarting RStudio. Then from shell again: git init Yielding Initialized empty Git repository in C:/Users/Troels/Dropbox/Rown/ABCharge/.git/ Rstudio restarted, package reopened: origin still "none" Git panel appears OK. Now from github: add new repository (non present after prior deletions!) Named as package name - repeated in description - repository created Shell opened from RStudio git remote add origin https://github.com/troelsring/ABCharge.git - works without problems - an origin seems correctly accepted in RStudio - but then: git push -u origin master - results in: error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/troelsring/ABCharge.git' below in red I seem (also!) to have problems with the SSH keys - Rstudio marks that I have a key in c:/Users/Troels/.ssh/id_rsa - but when I run file.exists("~/.ssh/id_rsa.pub") [1] FALSE - Is returned - but that is not the issue I guess? I have anyway made a public key as suggested. I have spent hours seeking on the many pages for explanation for this probably simple problem. All best Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] submitting to github
Dear friends - I'm sorry to bother but seem to be unable to interact constructively with github. I try to follow the instructions from Hadley (thanks) - i.e. I have a small trial-project which functions well. Since I have tried many times I start from shell with rm -rf .git and then select version control using git (tools, project options,git/svn) - and origin is still marked as "none" after restarting RStudio. Then from shell again: git init Yielding Initialized empty Git repository in C:/Users/Troels/Dropbox/Rown/ABCharge/.git/ Rstudio restarted, package reopened: origin still "none" Git panel appears OK. Now from github: add new repository (non present after prior deletions!) Named as package name - repeated in description - repository created Shell opened from RStudio git remote add origin https://github.com/troelsring/ABCharge.git - works without problems - an origin seems correctly accepted in RStudio - but then: git push -u origin master - results in: error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/troelsring/ABCharge.git' below in red I seem (also!) to have problems with the SSH keys - Rstudio marks that I have a key in c:/Users/Troels/.ssh/id_rsa - but when I run file.exists("~/.ssh/id_rsa.pub") [1] FALSE - Is returned - but that is not the issue I guess? I have anyway made a public key as suggested. I have spent hours seeking on the many pages for explanation for this probably simple problem. All best Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] how is RData in /data understood
Dear friends - I noticed in Hadley Wickham's comprehensive book on packages under "exported data" that the .RData file in data directory is "containing a single object (with the same name as the file)". However, in the "Writing R extensions" 1.1.6 - when discussing images created by save there is no statement I can see that the RData should only contain a single object? Is that common knowledge? I got a problem when adding the code below to an otherwise well working datasets.R in R directory - wonder if it is connected to the above since Baaeza.RData contains multiple objects. #' routine for multiequilibrium problems #' #' @description Data from Baeza-Baeza et al. #' #' @format A worksheet. #' \describe{ #' \item{Na}{Strong ions} #' } #' #' @examples #' data(Baeza) #' "Baeza" And even though I have Baeza.RData in the /data directory ctrl-shift-B stopped immediately with Updating acidcharge documentation Loading acidcharge error: 'baeza' is not exported object from 'namespace:acidcharge' run stopped Exited with status 1 Best wishes Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] problems documenting data sets
Thank you so much - this is just the first package I've made so I didn't put it out yet. Will follow your suggestion next time BW Troels -Oprindelig meddelelse- Fra: Martin Morgan Sendt: 20. januar 2019 19:14 Til: Troels Ring ; 'Rolf Turner' Cc: 'package-develop' Emne: Re: [R-pkg-devel] problems documenting data sets Did you mention where your package source can be downloaded from, e.g., github? Because obviously it is then much easier for people to help. Martin Morgan On 1/20/19, 12:55 PM, "R-package-devel on behalf of Troels Ring" wrote: Thank you so much - I used the search in files function in RStudio and also looked everywhere as well as I could - but seemingly: no - everywhere only "brom". So since the functions runs as expected and I can make a workable binary package I guess I will just continue improving the functionalities and see if I eventually get a hunch All best wishes Troels -Oprindelig meddelelse- Fra: Rolf Turner Sendt: 19. januar 2019 23:12 Til: Troels Ring Cc: package-develop Emne: Re: [R-pkg-devel] problems documenting data sets It's hard to be sure without seeing your package, but it *sounds* as though you have a data set "Brom" (in /data ?) but you have *documented* a data set named "brom". So you should either change the name of the data set to "brom" or change your help file to document "Brom". It is of course entirely possible that I am misunderstanding what is going on, in which case I apologise for the noise. cheers, Rolf -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 On 1/19/19 11:46 PM, Troels Ring wrote: > Dear friends – I still get some warning although the package runs just fine. > > checking for missing documentation entries ... WARNING > >Undocumented data sets: > > 'Cl' 'K' 'Na' 'TOTAL' 'WA' 'INPUT' 'Alb' 'Ca' 'Lact' 'Mg' 'PCO2' 'S1' > > 'Brom' 'pHOBS' > >All user-level objects in a package should have documentation entries. > >See chapter 'Writing R documentation files' in the 'Writing R > >Extensions' manual. > > > > 0 errors v | 1 warning x | 0 notes v > > Fejl: R CMD check found WARNINGs > > K rsel stoppet (run stopped) > > > > But the only place I have any mentions of brom is here below and in no place I have capital Brom. So what should I make of this? > > > > \name{brom} > > \alias{brom} > > \docType{data} > > \title{ > > Bromic acid data from Glaser et al 2014 > > } > > \description{ > >Data to find optimal pK for bromic acid > > } > > \usage{data("brom")} > > \format{ > > A workspace. > >\describe{ > > \item{brom}{Dataframe of Table S4 in Glaser et al.} > > \item{WA}{List of buffers with list of dissociation constants.} > >} > > } > > \source{ > > Glaser RE et al. Dynamical approach to multiequilibriia problems for > mixtures of > > acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 > > } > > \examples{ > > data(brom) > > ## maybe str(brom) ; plot(brom) ... > > } > > \keyword{datasets} __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] problems documenting data sets
Thank you so much - I used the search in files function in RStudio and also looked everywhere as well as I could - but seemingly: no - everywhere only "brom". So since the functions runs as expected and I can make a workable binary package I guess I will just continue improving the functionalities and see if I eventually get a hunch All best wishes Troels -Oprindelig meddelelse- Fra: Rolf Turner Sendt: 19. januar 2019 23:12 Til: Troels Ring Cc: package-develop Emne: Re: [R-pkg-devel] problems documenting data sets It's hard to be sure without seeing your package, but it *sounds* as though you have a data set "Brom" (in /data ?) but you have *documented* a data set named "brom". So you should either change the name of the data set to "brom" or change your help file to document "Brom". It is of course entirely possible that I am misunderstanding what is going on, in which case I apologise for the noise. cheers, Rolf -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 On 1/19/19 11:46 PM, Troels Ring wrote: > Dear friends – I still get some warning although the package runs just fine. > > checking for missing documentation entries ... WARNING > >Undocumented data sets: > > 'Cl' 'K' 'Na' 'TOTAL' 'WA' 'INPUT' 'Alb' 'Ca' 'Lact' 'Mg' 'PCO2' 'S1' > > 'Brom' 'pHOBS' > >All user-level objects in a package should have documentation entries. > >See chapter 'Writing R documentation files' in the 'Writing R > >Extensions' manual. > > > > 0 errors v | 1 warning x | 0 notes v > > Fejl: R CMD check found WARNINGs > > K rsel stoppet (run stopped) > > > > But the only place I have any mentions of brom is here below and in no place > I have capital Brom. So what should I make of this? > > > > \name{brom} > > \alias{brom} > > \docType{data} > > \title{ > > Bromic acid data from Glaser et al 2014 > > } > > \description{ > >Data to find optimal pK for bromic acid > > } > > \usage{data("brom")} > > \format{ > > A workspace. > >\describe{ > > \item{brom}{Dataframe of Table S4 in Glaser et al.} > > \item{WA}{List of buffers with list of dissociation constants.} > >} > > } > > \source{ > > Glaser RE et al. Dynamical approach to multiequilibriia problems for > mixtures of > > acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 > > } > > \examples{ > > data(brom) > > ## maybe str(brom) ; plot(brom) ... > > } > > \keyword{datasets} __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] problems documenting data sets
Thanks a lot - I tried your script but it didn't turn up anything like Brom but in one place I had Bromic acid - which I changed to bromic acid to no avail. So I continue trying to find out what goes on BW Troels Fra: Berry Boessenkool Sendt: 19. januar 2019 23:47 Til: Troels Ring ; R package devel Emne: Re: [R-pkg-devel] problems documenting data sets I was first thinking there could be an occurence of Brom with a capital B in the package somewhere. In which case you could run from the current package main directory: cat("All files in R folder\n", file="AllFiles.R") for(f in dir("R",full=T)) cat(readLines(f), file="AllFiles.R", sep="\n", append=TRUE) and search for Brom in that file... But Rolf is likely right. I was thinking the wrong way around... Berry _ From: R-package-devel mailto:r-package-devel-boun...@r-project.org> > on behalf of Troels Ring mailto:tr...@gvdnet.dk> > Sent: Saturday, January 19, 2019 11:46 To: package-develop Subject: [R-pkg-devel] problems documenting data sets Dear friends - I still get some warning although the package runs just fine. checking for missing documentation entries ... WARNING Undocumented data sets: 'Cl' 'K' 'Na' 'TOTAL' 'WA' 'INPUT' 'Alb' 'Ca' 'Lact' 'Mg' 'PCO2' 'S1' 'Brom' 'pHOBS' All user-level objects in a package should have documentation entries. [SNIP] [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] problems documenting data sets
Dear friends – I still get some warning although the package runs just fine. checking for missing documentation entries ... WARNING Undocumented data sets: 'Cl' 'K' 'Na' 'TOTAL' 'WA' 'INPUT' 'Alb' 'Ca' 'Lact' 'Mg' 'PCO2' 'S1' 'Brom' 'pHOBS' All user-level objects in a package should have documentation entries. See chapter 'Writing R documentation files' in the 'Writing R Extensions' manual. 0 errors v | 1 warning x | 0 notes v Fejl: R CMD check found WARNINGs K�rsel stoppet (run stopped) But the only place I have any mentions of brom is here below and in no place I have capital Brom. So what should I make of this? \name{brom} \alias{brom} \docType{data} \title{ Bromic acid data from Glaser et al 2014 } \description{ Data to find optimal pK for bromic acid } \usage{data("brom")} \format{ A workspace. \describe{ \item{brom}{Dataframe of Table S4 in Glaser et al.} \item{WA}{List of buffers with list of dissociation constants.} } } \source{ Glaser RE et al. Dynamical approach to multiequilibriia problems for mixtures of acids and their conjugate bases. J Chem Educ 2014; 91: 1009-1016 } \examples{ data(brom) ## maybe str(brom) ; plot(brom) ... } \keyword{datasets} [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] undocumented data sets
Thanks a lot T -Oprindelig meddelelse- Fra: Iñaki Ucar Sendt: 14. januar 2019 15:50 Til: Troels Ring Cc: package-develop Emne: Re: [R-pkg-devel] undocumented data sets See an example with roxygen2: https://github.com/r-quantities/errors/blob/master/R/data.R And how this is translated if you prefer to write the Rd yourself: https://github.com/r-quantities/errors/blob/master/man/datasets.Rd Iñaki On Mon, 14 Jan 2019 at 15:45, Troels Ring wrote: > > Dear friends - with your help I'm almost through developing a package > and Ctrl-shit-E now only has a single warning > > > checking for missing documentation entries ... WARNING > > Undocumented data sets: > > 'Cl' 'K' 'Na' 'TOTAL' 'WA' 'INPUT' 'Alb' 'Ca' 'Lact' 'Mg' 'PCO2' 'S1' > > 'Brom' 'pHOBS' > > All user-level objects in a package should have documentation entries. > > See chapter 'Writing R documentation files' in the 'Writing R > > Extensions' manual. > > > > But in 2.1.2.Documenting data sets in Writing R extensions it is said > that \arguments is not needed and in the template on p 72 in the > manual I see no entry directly making for this documentation. > Everything runs just well - but I must have it clean now! > > I also tried the RStudio option of generating a Rd file on data, and > there was an entry I filled out like this > > > > \describe{ > > \item{\code{Brom}}{Dataframe of Table S4 in Glaser et al} > > > > But t didn't cure the warning (Brom entry) above? > > > > All best wishes > > Troels > > > [[alternative HTML version deleted]] > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Iñaki Úcar __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] RData files with identical objects in package
Thanks a lot - for my purpose right now I seem to prosper from not loading lazy All best Troels -Oprindelig meddelelse- Fra: peter dalgaard Sendt: 14. januar 2019 15:17 Til: Troels Ring Cc: Michael Dewey ; package-develop Emne: Re: [R-pkg-devel] RData files with identical objects in package There is (of course) a difference between what is the default for a (missing) field in DESCRIPTION and what shells like RStudio put into the field by default... I don't think there is a discrepancy between what is in the official documentation and what R and R CMD * actually does. -pd > On 14 Jan 2019, at 07:10 , Troels Ring wrote: > > Thank you so much! Perhaps it could be mentioned in the official > documentation on writing R extensions - even if - if I can read > English - the default is to avoid "lazyData" loading - and "laxyData" > loading is in some opposition to loading using data() - whereas - if > we use RStudio, and make an R documentation file for data, we have it > ending with: > \examples{ > data(ddd) > ## maybe str(ddd) ; plot(ddd) ... > } > \keyword{datasets} > > At the same time as "lazyData" is used default in DESCRIPTION ? > > 1.1.6 Data in packages > The data subdirectory is for data files, either to be made available > via lazy-loading or for loading using data(). (The choice is made by > the 'LazyData' field in the DESCRIPTION file: the default is not to do > so.) It should not be used for other data files needed by the package, > and the convention has grown up to use directory inst/extdata for such files. > > All best wishes > Troels > > > -Oprindelig meddelelse- > Fra: peter dalgaard > Sendt: 13. januar 2019 22:00 > Til: Troels Ring > Cc: Michael Dewey ; package-develop > > Emne: Re: [R-pkg-devel] RData files with identical objects in package > > I think it is illegal if you use the lazyload database, because that > is indexed by name and contains every object that would be created by data(). > This creates an obvious issue if two objects share a name. > > Once you use the lazyload database, loading the package creates an > environment which is initially full of promises, one for each object. > Evaluating one of these makes the actual object appear in the environment. > > Using data() causes the corresponding promise(s) to be created in the > global environment. IIRC, there is a registry that says which objects > are created by which arguments to data(), but as they are still taken > from the lazydata database, the last one created with a given name still wins. > > -ps > >> On 13 Jan 2019, at 14:13 , Troels Ring wrote: >> >> Thanks a lot - I'm sure you are right that I could just use different >> names but I cannot understand why it could cause problem to have two >> different well formated .RData files in the /data directory both with >> an "x" - is that really illegal? I cannot see it stated in the >> official munual - but it is long (wrting r extensions) -BW Troels >> >> -Oprindelig meddelelse- >> Fra: Michael Dewey >> Sendt: 13. januar 2019 12:56 >> Til: Troels Ring ; package-develop >> >> Emne: Re: [R-pkg-devel] RData files with identical objects in package >> >> Dear Troels >> >> Perhaps I misunderstand what you are trying to do but would it be >> possible to put each x and y into a list or a dataframe with >> different names and then modify your usgae to pull them from there? >> Then there would be no danger of users getting the wrong x and y >> >> Michael >> >> On 13/01/2019 08:38, Troels Ring wrote: >>> Dear friends - I have a package under creation making heavy >>> calculations on chemical/clinical data and I plan to include as >>> "examples" the use of some literature data used in my papers. To >>> illustrate what then occurs, I made two RData files consisting only >>> of x and y with different values for x and y like >>> >>> X <- 100 >>> >>> Y <- 1000 >>> >>> save(x,y,file="first.RData") >>> >>> and then a new x and y in "second" with x <- 45 and y <- 32 >>> >>> When I put these in a "data" directory of a new package without >>> further ado in RStudio >>> >>> Ctrl-shift-L >>> >>> Ctrl-shift-B >>> >>> >>> >>> .there is a warning >>> >>> * installing *source* package 'try' ... >>> >>> ** R >>> >>> ** data >>> >
[R-pkg-devel] undocumented data sets
Dear friends - with your help I'm almost through developing a package and Ctrl-shit-E now only has a single warning > checking for missing documentation entries ... WARNING Undocumented data sets: 'Cl' 'K' 'Na' 'TOTAL' 'WA' 'INPUT' 'Alb' 'Ca' 'Lact' 'Mg' 'PCO2' 'S1' 'Brom' 'pHOBS' All user-level objects in a package should have documentation entries. See chapter 'Writing R documentation files' in the 'Writing R Extensions' manual. But in 2.1.2.Documenting data sets in Writing R extensions it is said that \arguments is not needed and in the template on p 72 in the manual I see no entry directly making for this documentation. Everything runs just well - but I must have it clean now! I also tried the RStudio option of generating a Rd file on data, and there was an entry I filled out like this \describe{ \item{\code{Brom}}{Dataframe of Table S4 in Glaser et al} But t didn't cure the warning (Brom entry) above? All best wishes Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] RData files with identical objects in package
Thank you so much! Perhaps it could be mentioned in the official documentation on writing R extensions - even if - if I can read English - the default is to avoid "lazyData" loading - and "laxyData" loading is in some opposition to loading using data() - whereas - if we use RStudio, and make an R documentation file for data, we have it ending with: \examples{ data(ddd) ## maybe str(ddd) ; plot(ddd) ... } \keyword{datasets} At the same time as "lazyData" is used default in DESCRIPTION ? 1.1.6 Data in packages The data subdirectory is for data files, either to be made available via lazy-loading or for loading using data(). (The choice is made by the 'LazyData' field in the DESCRIPTION file: the default is not to do so.) It should not be used for other data files needed by the package, and the convention has grown up to use directory inst/extdata for such files. All best wishes Troels -Oprindelig meddelelse- Fra: peter dalgaard Sendt: 13. januar 2019 22:00 Til: Troels Ring Cc: Michael Dewey ; package-develop Emne: Re: [R-pkg-devel] RData files with identical objects in package I think it is illegal if you use the lazyload database, because that is indexed by name and contains every object that would be created by data(). This creates an obvious issue if two objects share a name. Once you use the lazyload database, loading the package creates an environment which is initially full of promises, one for each object. Evaluating one of these makes the actual object appear in the environment. Using data() causes the corresponding promise(s) to be created in the global environment. IIRC, there is a registry that says which objects are created by which arguments to data(), but as they are still taken from the lazydata database, the last one created with a given name still wins. -ps > On 13 Jan 2019, at 14:13 , Troels Ring wrote: > > Thanks a lot - I'm sure you are right that I could just use different > names but I cannot understand why it could cause problem to have two > different well formated .RData files in the /data directory both with > an "x" - is that really illegal? I cannot see it stated in the > official munual - but it is long (wrting r extensions) -BW Troels > > -Oprindelig meddelelse- > Fra: Michael Dewey > Sendt: 13. januar 2019 12:56 > Til: Troels Ring ; package-develop > > Emne: Re: [R-pkg-devel] RData files with identical objects in package > > Dear Troels > > Perhaps I misunderstand what you are trying to do but would it be > possible to put each x and y into a list or a dataframe with different > names and then modify your usgae to pull them from there? Then there > would be no danger of users getting the wrong x and y > > Michael > > On 13/01/2019 08:38, Troels Ring wrote: >> Dear friends - I have a package under creation making heavy >> calculations on chemical/clinical data and I plan to include as >> "examples" the use of some literature data used in my papers. To >> illustrate what then occurs, I made two RData files consisting only >> of x and y with different values for x and y like >> >> X <- 100 >> >> Y <- 1000 >> >> save(x,y,file="first.RData") >> >> and then a new x and y in "second" with x <- 45 and y <- 32 >> >> When I put these in a "data" directory of a new package without >> further ado in RStudio >> >> Ctrl-shift-L >> >> Ctrl-shift-B >> >> >> >> .there is a warning >> >> * installing *source* package 'try' ... >> >> ** R >> >> ** data >> >> *** moving datasets to lazyload DB >> >> warning: objects 'x', 'y' are created by more than one data call >> >> ** byte-compile and prepare package for lazy loading >> >> ** help >> >> converting help for package 'try' >> >> *** installing help indices >> >> finding HTML links ...hello html >> >> done >> >> >> >> Now, when I clear the workspace: >> >>> ls() >> character(0) >>> devtools::load_all(".") >> Loading try >> >> Restarting R session... >> >>> library(try) >>> ls() >> character(0) >>> x #-- so even if workspace Is empty x is still kept >> [1] 45 >>> data(first) # and "first" is not seen x >> [1] 45 >> >> >> >> x is still present - and y >> >> >> >> I have been reading and searching in "Writing R extensions" but so >> far didn't find the clue. >> >> Seemingly it is the file w
Re: [R-pkg-devel] RData files with identical objects in package
Thanks a lot - I'm sure you are right that I could just use different names but I cannot understand why it could cause problem to have two different well formated .RData files in the /data directory both with an "x" - is that really illegal? I cannot see it stated in the official munual - but it is long (wrting r extensions) -BW Troels -Oprindelig meddelelse- Fra: Michael Dewey Sendt: 13. januar 2019 12:56 Til: Troels Ring ; package-develop Emne: Re: [R-pkg-devel] RData files with identical objects in package Dear Troels Perhaps I misunderstand what you are trying to do but would it be possible to put each x and y into a list or a dataframe with different names and then modify your usgae to pull them from there? Then there would be no danger of users getting the wrong x and y Michael On 13/01/2019 08:38, Troels Ring wrote: > Dear friends - I have a package under creation making heavy > calculations on chemical/clinical data and I plan to include as > "examples" the use of some literature data used in my papers. To > illustrate what then occurs, I made two RData files consisting only of > x and y with different values for x and y like > > X <- 100 > > Y <- 1000 > > save(x,y,file="first.RData") > > and then a new x and y in "second" with x <- 45 and y <- 32 > > When I put these in a "data" directory of a new package without > further ado in RStudio > > Ctrl-shift-L > > Ctrl-shift-B > > > > .there is a warning > > * installing *source* package 'try' ... > > ** R > > ** data > > *** moving datasets to lazyload DB > > warning: objects 'x', 'y' are created by more than one data call > > ** byte-compile and prepare package for lazy loading > > ** help > >converting help for package 'try' > > *** installing help indices > > finding HTML links ...hello html > > done > > > > Now, when I clear the workspace: > >> ls() > character(0) >> devtools::load_all(".") > Loading try > > Restarting R session... > >> library(try) >> ls() > character(0) >> x #-- so even if workspace Is empty x is still kept > [1] 45 >> data(first) # and "first" is not seen x > [1] 45 > > > > x is still present - and y > > > > I have been reading and searching in "Writing R extensions" but so far > didn't find the clue. > > Seemingly it is the file with the last name that is assessed - when I rename > first.RData to "xfile.RData" we get 100 and 1000. > > Now and then when running ctrl-shift-L and - B we see > > > > Attaches package: 'try' > > The following objects are masked _by_ '.GlobalEnv': > x, y > > > > Sorry for these problems - > > BW > Troels > > > [[alternative HTML version deleted]] > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > -- Michael http://www.dewey.myzen.co.uk/home.html __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] RData files with identical objects in package
Thanks a lot - here's is what I get: A single object matching ‘x’ was found It was found in the following places package:try with value [1] 100 Now put in the last "xfile.RData" - and "afile.RData" is still muted Restarting R session... > library(try) > x [1] 100 > getAnywhere("x") A single object matching ‘x’ was found It was found in the following places package:try with value [1] 100 > data(afile) > x [1] 100 Whereas we know x in afile.RData is 45 So something is very wrong Sorry to be so helpless BW Troels -Oprindelig meddelelse- Fra: Duncan Murdoch Sendt: 13. januar 2019 12:46 Til: Troels Ring ; package-develop Emne: Re: [R-pkg-devel] RData files with identical objects in package On 13/01/2019 3:38 a.m., Troels Ring wrote: > Dear friends - I have a package under creation making heavy > calculations on chemical/clinical data and I plan to include as > "examples" the use of some literature data used in my papers. To > illustrate what then occurs, I made two RData files consisting only of > x and y with different values for x and y like > > X <- 100 > > Y <- 1000 > > save(x,y,file="first.RData") > > and then a new x and y in "second" with x <- 45 and y <- 32 > > When I put these in a "data" directory of a new package without > further ado in RStudio > > Ctrl-shift-L > > Ctrl-shift-B > > > > .there is a warning > > * installing *source* package 'try' ... > > ** R > > ** data > > *** moving datasets to lazyload DB > > warning: objects 'x', 'y' are created by more than one data call > > ** byte-compile and prepare package for lazy loading > > ** help > >converting help for package 'try' > > *** installing help indices > > finding HTML links ...hello html > > done > > > > Now, when I clear the workspace: > >> ls() > character(0) >> devtools::load_all(".") > Loading try > > Restarting R session... > >> library(try) >> ls() > character(0) >> x #-- so even if workspace Is empty x is still kept > [1] 45 >> data(first) # and "first" is not seen x > [1] 45 > > > > x is still present - and y > > > > I have been reading and searching in "Writing R extensions" but so far > didn't find the clue. > > Seemingly it is the file with the last name that is assessed - when I rename > first.RData to "xfile.RData" we get 100 and 1000. > > Now and then when running ctrl-shift-L and - B we see > > > > Attaches package: 'try' > > The following objects are masked _by_ '.GlobalEnv': > x, y > Does that every happen when ls() returns character(0)? It seems likely that you have copies of them in the global workspace, and the message is correct. In the earlier situation (ls() *does* return character(0), but x is still found), you can find where it was found using getAnywhere("x") For example, > x <- 2 > getAnywhere("x") A single object matching ‘x’ was found It was found in the following places .GlobalEnv with value [1] 2 Duncan Murdoch __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] RData files with identical objects in package
Dear friends - I have a package under creation making heavy calculations on chemical/clinical data and I plan to include as "examples" the use of some literature data used in my papers. To illustrate what then occurs, I made two RData files consisting only of x and y with different values for x and y like X <- 100 Y <- 1000 save(x,y,file="first.RData") and then a new x and y in "second" with x <- 45 and y <- 32 When I put these in a "data" directory of a new package without further ado in RStudio Ctrl-shift-L Ctrl-shift-B .there is a warning * installing *source* package 'try' ... ** R ** data *** moving datasets to lazyload DB warning: objects 'x', 'y' are created by more than one data call ** byte-compile and prepare package for lazy loading ** help converting help for package 'try' *** installing help indices finding HTML links ...hello html done Now, when I clear the workspace: > ls() character(0) > devtools::load_all(".") Loading try Restarting R session... > library(try) > ls() character(0) > x #-- so even if workspace Is empty x is still kept [1] 45 > data(first) # and "first" is not seen > x [1] 45 x is still present - and y I have been reading and searching in "Writing R extensions" but so far didn't find the clue. Seemingly it is the file with the last name that is assessed - when I rename first.RData to "xfile.RData" we get 100 and 1000. Now and then when running ctrl-shift-L and - B we see Attaches package: 'try' The following objects are masked _by_ '.GlobalEnv': x, y Sorry for these problems - BW Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] using @inheritParams in documenting data
Hi Dirk - thank you for your kind mail - I can see I better follow the basic ways! Also since I seem by my shortcuts to have accomplished a major problem: I had two *.RData files with similar variables of same names in /data - if I included both and had no rda files to document data, I had this previously mentioned problem of "following objects are masked by "glovalEnv" - but if I used the rda files on data directly from RStudio the data were kept to be from only one of the RData files, I think the first one - load("*.RData") of course was still correct. Thanks a lot for your patience Troels -Oprindelig meddelelse- Fra: Dirk Eddelbuettel På vegne af Dirk Eddelbuettel Sendt: 12. januar 2019 13:45 Til: Troels Ring Cc: package-develop Emne: Re: [R-pkg-devel] using @inheritParams in documenting data Hi Troels, Always good to see someone work on packaging with so much energy. On 12 January 2019 at 08:46, Troels Ring wrote: | BUT where and how to put the @inheritParams CMB I cannot find documented. | Otherwise it seems to run OK I fear you are getting confused between 'roxygen2' and base R. 'roxygen2' is a very handy and powerful add-on package extending R. But none of its variables, (which conveniently all start with a @) will be documented in the proper manual, Writing R Extension. You question about \describe, however, is about Rd which is base R. And that very command is 'shadowed' by roxygen2 which generates that section. That is not unlike your previous question about exporting / registration. Personally, I see value in working old-school here, and continue to argue that one should be familiar with the _basic_ and _portable_ commands in Writing R Extensions before putting another layer on top. Just how I find it helps to explain what Rcpp does if one has a mental image of the underlying 'SEXP .Call(funcname, SEXP, SEXP)' it is working with. So I do use roxygen to create Rd files but I also spent a decade or so writing Rd files -- and quite a few people (hi, Duncan) still recommend doing it by hand. I think it helps. And you can mix and match. Also, a decent trick is to search on GitHub with 'user:cran' to restrict your search to the mirror (thanks, Gabor!) of CRAN packages. For just about any question, it quite likely that there will be someone who has been there before among the now (almost) 13,700 packages out there. Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] using @inheritParams in documenting data
Thanks a lot! I stumbled over the RStudio way of producing *.rda files for data sets individually instead of making a *.R file as Hadley writes in the book if I understand it correctly. It certainly is fun to find out about !! All best wishes Troels Fra: Alexandre Courtiol Sendt: 12. januar 2019 14:28 Til: Troels Ring Cc: package-develop Emne: Re: [R-pkg-devel] using @inheritParams in documenting data Hi Troels, If you want to create a R package (using roxygen2), I would highly recommend you to read Hadley Wickham's book on the topic. The book is easy, short, practical and legally free (here: http://r-pkgs.had.co.nz/). If you follow it step by step, everything should work fine. For anything not covered by the book, as Dirk said, look for examples of packages you know in GitHub. ++ Alex On Sat, 12 Jan 2019 at 08:46, Troels Ring mailto:tr...@gvdnet.dk> > wrote: Dearfriends , with your help I'm rapidly improving package development. When documenting data, I seem to be helped mpst by making the rda directly from RStudio via file, new file, R documentation then choosing data. However, my data files have a lot of params, so I thought I might use @inheritParams since these params are already documented elsewhere in the package. Hence, in the rda file created directly from RStudio I tried to add @inheritParams CMB (since the params are already documented in CMB) but I cannot find exactly how to put it in the rda file. The skeleton has \describe{ \item{\code(x)}{vector} And if I put some the params in a comma separated row instead of x they are acknowledged in the final rda file - BUT where and how to put the @inheritParams CMB I cannot find documented. Otherwise it seems to run OK All best wishes Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org <mailto:R-package-devel@r-project.org> mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Alexandre Courtiol http://sites.google.com/site/alexandrecourtiol/home "Science is the belief in the ignorance of experts", R. Feynman [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] using @inheritParams in documenting data
Dearfriends , with your help I'm rapidly improving package development. When documenting data, I seem to be helped mpst by making the rda directly from RStudio via file, new file, R documentation then choosing data. However, my data files have a lot of params, so I thought I might use @inheritParams since these params are already documented elsewhere in the package. Hence, in the rda file created directly from RStudio I tried to add @inheritParams CMB (since the params are already documented in CMB) but I cannot find exactly how to put it in the rda file. The skeleton has \describe{ \item{\code(x)}{vector} And if I put some the params in a comma separated row instead of x they are acknowledged in the final rda file - BUT where and how to put the @inheritParams CMB I cannot find documented. Otherwise it seems to run OK All best wishes Troels [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] NAMESPACE importFrom("stats", "uniroot")
Thanks a lot for your help - now it is fine! BW Troels -Oprindelig meddelelse- Fra: Iñaki Ucar Sendt: 11. januar 2019 18:37 Til: Troels Ring Emne: Re: [R-pkg-devel] NAMESPACE importFrom("stats", "uniroot") See an example of usage here: https://github.com/r-simmer/simmer/blob/f75e52fe1e71c7eda594f6cd41adbbed95b05c23/R/monitor-class.R#L124 And how this is processed by roxygen2 and added to the NAMESPACE automatically: https://github.com/r-simmer/simmer/blob/956bb03ac355052c60e5341c0d16b0dc81ee736c/NAMESPACE#L181 Iñaki On Fri, 11 Jan 2019 at 18:30, Troels Ring wrote: > > Thanks a lot - I have added > @importFrom stats uniroot > And #' @importFrom stats uniroot in the NAMESPACE otherwise generated > by roxygen - I can't make it work - the first is not processed and the > next makes no difference apart from deleting the former NAMESPACE > file. I have tried adding the lines to the r file running uniroot - I > seem to be misunderstanding what goes on > > Best wishes > Troels > > -Oprindelig meddelelse- > Fra: Iñaki Ucar > Sendt: 11. januar 2019 17:40 > Til: Troels Ring > Cc: package-develop > Emne: Re: [R-pkg-devel] NAMESPACE importFrom("stats", "uniroot") > > On Fri, 11 Jan 2019 at 17:31, Troels Ring wrote: > > > > Dear friends - I'm slowly learning to make packages in RStudio and > > it seems impressive. I managed now to have my acidbase package pass > > the check-package test with this result > > > > > > > > > checking R code for possible problems ... NOTE > > > > pH_general: no visible global function definition for 'uniroot' > > > > Undefined global functions or variables: > > > > uniroot > > > > Consider adding > > > > importFrom("stats", "uniroot") > > > > to your NAMESPACE file. > > > > > > > > 0 errors v | 0 warnings v | 1 note x > > > > > > > > R CMD check succeeded > > > > > > > > So I have much use of uniroot in the package but get this "note" > > above and a suggestion to augment the NAMESPACE file - so even > > though it was issuing : # Generated by roxygen2: do not edit by hand > > > > I of course tried adding by hand - and in the next run the NAMESPACE > > file was quite empty and without any exports and the added import > > while before it exported a number of functions. So I deleted this > > unwelcome NAMESPACE and got the old one back. > > > > I also tried adding importFrom("stats", "uniroot") as #' > > @importFrom("stats", "uniroot") to the r file with the routine using > > uniroot but that didn't change the NAMESPACE or remove the note when > > checking. It may be no big problem - but I'd like to see no notes or > > warnings > > The syntax is "@importFrom stats uniroot". See roxygen2's docs: > > https://cran.r-project.org/web/packages/roxygen2/vignettes/namespace.h > tml#imports > > If you don't use this function many many times, it is even better to use > stats::uniroot instead. > > Iñaki > -- Iñaki Úcar __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] NAMESPACE importFrom("stats", "uniroot")
Dear friends - I'm slowly learning to make packages in RStudio and it seems impressive. I managed now to have my acidbase package pass the check-package test with this result > checking R code for possible problems ... NOTE pH_general: no visible global function definition for 'uniroot' Undefined global functions or variables: uniroot Consider adding importFrom("stats", "uniroot") to your NAMESPACE file. 0 errors v | 0 warnings v | 1 note x R CMD check succeeded So I have much use of uniroot in the package but get this "note" above and a suggestion to augment the NAMESPACE file - so even though it was issuing : # Generated by roxygen2: do not edit by hand I of course tried adding by hand - and in the next run the NAMESPACE file was quite empty and without any exports and the added import while before it exported a number of functions. So I deleted this unwelcome NAMESPACE and got the old one back. I also tried adding importFrom("stats", "uniroot") as #' @importFrom("stats", "uniroot") to the r file with the routine using uniroot but that didn't change the NAMESPACE or remove the note when checking. It may be no big problem - but I'd like to see no notes or warnings Best wishes Troels - on Windows version 3.5.1 (2018-07-02) [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] objects are masked _by_ '.GlobalEnv'
Dear friends - this is really a question I'm sorry about since it doesn't follow the requirements. I have made a R package via RStudio and it causes problems when I try to load some data from within the package. I'm on windows, R version 3.5.1 (2018-07-02). When I am in the directory with the package project (also with plain R) > data(Schell) > library(chaRBAL) Attaches package: 'chaRBAL'my translation from Danish The following objects are masked _by_ '.GlobalEnv': Na, TOTAL, WA # BUT: the values are correct from data(Schell): > Na [1] 0.008 0.024 0.044 0.064 0.082 0.098 0.114 0.128 0.142 0.154 0.166 0.176 0.188 0.198 0.206 0.214 0.224 0.232 [19] 0.242 0.252 0.264 0.278 0.292 0.310 0.330 0.348 0.364 0.374 0.384 0.390 > TOTAL [,1] [,2] [1,] 0.004 0.098 [2,] 0.012 0.094 [3,] 0.022 0.089 [4,] 0.032 0.084 [5,] 0.041 0.079 25 more so > WA $`buffs` $`buffs`[[1]] [1] "Phos" $`buffs`[[2]] [1] "Cit" $KA $KA[[1]] [1] 6.918310e-03 6.165950e-08 4.786301e-13 $KA[[2]] [1] 7.413102e-04 1.737801e-05 3.981072e-07 # Which is all OK # But when now I make the same call again > data(Schell) ls() # [1] "Alb" "Ca""Cl""K" "Lact" "Mg""Na""PCO2" "S1" #[10] "TOTAL" "WA" TOTAL # [,1] [,2] [,3] # [1,] 0.0267 0.0267 0.0267 # [2,] 0.0200 0.0200 0.0200 # which is wrong and belongs to another included dataset. How did that happen to be caught in globalenvironment, how can I avoid that and get rid # of it? I can see I need to know more about environments. What do you think happens? All best wishes Troels Ring, MD Aalborg [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel