[R-pkg-devel] using @inheritParams in documenting data

2019-01-11 Thread Troels Ring
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] R CMD INSTALL succeeds while R CMD BUILD fails

2019-01-11 Thread Uwe Ligges

Please report.

Best,
Uwe Ligges

On 11.01.2019 22:15, Sam Albers wrote:

Oh you are totally right. And similarly, an .rds file bonks with R CMD build:

$ R CMD build foo.rds
* checking for file 'foo.rds/DESCRIPTION' ... OK
* preparing 'foo.rds':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
Warning in gzfile(file, "rb") :
   cannot open compressed file 'foo.rds', probable reason 'Permission denied'
Error in gzfile(file, "rb") : cannot open the connection
Execution halted

However this seems like a bug doesn't it? I am able to install a *.rds
or *.rdata package but unable to build it. Seems like a) I should be
able to install and b) these could be added to the list of unavailable
package names. Asking in the context of whether this is worth
reporting as a bug.

Sam

On Fri, Jan 11, 2019 at 12:00 PM Hong Ooi  wrote:


It looks like the ".rdata" in your package name is confusing R CMD BUILD into thinking 
there is a .rdata file involved. Consider renaming it to "bcmaps.data" or something 
similar.


-Original Message-
From: R-package-devel  On Behalf Of Sam 
Albers
Sent: Friday, 11 January, 2019 2:07 PM
To: r-package-devel@r-project.org
Subject: [R-pkg-devel] R CMD INSTALL succeeds while R CMD BUILD fails

Hello all,

I am experiencing some issues with building a package that we are hosting on 
GitHub. The package itself is quite large.  It is a data package with a bunch 
of spatial files stored as .rds files.

The repo is located here: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbcgov%2Fbcmaps.rdatadata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=GosuFnTADrpxapDMNQSMxKoI9B4aPtIw7LwPwoCmYxU%3Dreserved=0

If we clone that package to local machine via:
git clone 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbcgov%2Fbcmaps.rdatadata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=GosuFnTADrpxapDMNQSMxKoI9B4aPtIw7LwPwoCmYxU%3Dreserved=0

The first oddity is that the package installs successfully using this:

$ R CMD INSTALL "./bcmaps.rdata"

But fails when I try to build the package:

$ R CMD BUILD "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmaps.rdata':
* checking DESCRIPTION meta-information ... OK
* 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 Warning in gzfile(file, 
"rb") :
   cannot open compressed file 'bcmaps.rdata', probable reason 'Permission 
denied'
Error in gzfile(file, "rb") : cannot open the connection Execution halted


The second oddity is that if I remove the . from the Package name in the 
DESCRIPTION file, the build proceeds smoothly:

$ R CMD build "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmapsrdata':
* checking DESCRIPTION meta-information ... OK
* 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 'bcmapsrdata_0.2.0.tar.gz'

I am assuming that R CMD install builds the package internally so I find it 
confusing that I am not able to build it myself. Similarly confusing is the 
lack of a . in the package name indicative of anything?

Does anyone have any idea what's going on here? Am I missing something obvious?

Thanks in advance,

Sam

__
R-package-devel@r-project.org mailing list
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-develdata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=0r%2FFfRH6eYqRPLAAFLprWAttPip02VKV0GIqBOtVhI8%3Dreserved=0


__
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] R CMD INSTALL succeeds while R CMD BUILD fails

2019-01-11 Thread Sam Albers
Oh you are totally right. And similarly, an .rds file bonks with R CMD build:

$ R CMD build foo.rds
* checking for file 'foo.rds/DESCRIPTION' ... OK
* preparing 'foo.rds':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
Warning in gzfile(file, "rb") :
  cannot open compressed file 'foo.rds', probable reason 'Permission denied'
Error in gzfile(file, "rb") : cannot open the connection
Execution halted

However this seems like a bug doesn't it? I am able to install a *.rds
or *.rdata package but unable to build it. Seems like a) I should be
able to install and b) these could be added to the list of unavailable
package names. Asking in the context of whether this is worth
reporting as a bug.

Sam

On Fri, Jan 11, 2019 at 12:00 PM Hong Ooi  wrote:
>
> It looks like the ".rdata" in your package name is confusing R CMD BUILD into 
> thinking there is a .rdata file involved. Consider renaming it to 
> "bcmaps.data" or something similar.
>
>
> -Original Message-
> From: R-package-devel  On Behalf Of 
> Sam Albers
> Sent: Friday, 11 January, 2019 2:07 PM
> To: r-package-devel@r-project.org
> Subject: [R-pkg-devel] R CMD INSTALL succeeds while R CMD BUILD fails
>
> Hello all,
>
> I am experiencing some issues with building a package that we are hosting on 
> GitHub. The package itself is quite large.  It is a data package with a bunch 
> of spatial files stored as .rds files.
>
> The repo is located here: 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbcgov%2Fbcmaps.rdatadata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=GosuFnTADrpxapDMNQSMxKoI9B4aPtIw7LwPwoCmYxU%3Dreserved=0
>
> If we clone that package to local machine via:
> git clone 
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbcgov%2Fbcmaps.rdatadata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=GosuFnTADrpxapDMNQSMxKoI9B4aPtIw7LwPwoCmYxU%3Dreserved=0
>
> The first oddity is that the package installs successfully using this:
>
> $ R CMD INSTALL "./bcmaps.rdata"
>
> But fails when I try to build the package:
>
> $ R CMD BUILD "./bcmaps.rdata"
> * checking for file './bcmaps.rdata/DESCRIPTION' ... OK
> * preparing 'bcmaps.rdata':
> * checking DESCRIPTION meta-information ... OK
> * 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 Warning in 
> gzfile(file, "rb") :
>   cannot open compressed file 'bcmaps.rdata', probable reason 'Permission 
> denied'
> Error in gzfile(file, "rb") : cannot open the connection Execution halted
>
>
> The second oddity is that if I remove the . from the Package name in the 
> DESCRIPTION file, the build proceeds smoothly:
>
> $ R CMD build "./bcmaps.rdata"
> * checking for file './bcmaps.rdata/DESCRIPTION' ... OK
> * preparing 'bcmapsrdata':
> * checking DESCRIPTION meta-information ... OK
> * 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 'bcmapsrdata_0.2.0.tar.gz'
>
> I am assuming that R CMD install builds the package internally so I find it 
> confusing that I am not able to build it myself. Similarly confusing is the 
> lack of a . in the package name indicative of anything?
>
> Does anyone have any idea what's going on here? Am I missing something 
> obvious?
>
> Thanks in advance,
>
> Sam
>
> __
> R-package-devel@r-project.org mailing list
> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-develdata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=0r%2FFfRH6eYqRPLAAFLprWAttPip02VKV0GIqBOtVhI8%3Dreserved=0

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] shadowing a method from the stats package

2019-01-11 Thread qxacur
Hello,

I created a package for working with a new probability
distribution called unifed. The source code can be found at
https://gitlab.com/oquijano/unifed .

This distribution is suitable for GLMs. I have included a a
function called unifed in the package that returns a family that can
be used with the glm function.

For a unifed glm, it is necessary for the dispersion parameter to
be equal to one. The summary method of the glm class does this
automatically for the poisson and binomial distributions and I would
like the same for the unifed. In order to achieve this, I am
including a summary.glm function in the package so it shadows
stats::summary.glm when the package is attached. This function is
actually just a wrapper around stats::summary.glm.  It simply checks
if the family is unifed; If this is the case it calls
stats::summary.glm with dispersion=1 and otherwise it simply calls
stats::summary.glm with the same parameters.  Therefore introducing
this in the namespace does not break or change the behavior of any
existing code that uses summary.glm
 
 According to the CRAN policies I need permission from the
maintainer of the package for doing this. The maintainer of the package
is the R core team. To whom should I write to ask for this permission?
Otherwise is there a different way in which I could achieve the right
default behavior and respect the CRAN policies?


Thank you for your time.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] R CMD INSTALL succeeds while R CMD BUILD fails

2019-01-11 Thread Hong Ooi via R-package-devel
--- Begin Message ---
It looks like the ".rdata" in your package name is confusing R CMD BUILD into 
thinking there is a .rdata file involved. Consider renaming it to "bcmaps.data" 
or something similar.


-Original Message-
From: R-package-devel  On Behalf Of Sam 
Albers
Sent: Friday, 11 January, 2019 2:07 PM
To: r-package-devel@r-project.org
Subject: [R-pkg-devel] R CMD INSTALL succeeds while R CMD BUILD fails

Hello all,

I am experiencing some issues with building a package that we are hosting on 
GitHub. The package itself is quite large.  It is a data package with a bunch 
of spatial files stored as .rds files.

The repo is located here: 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbcgov%2Fbcmaps.rdatadata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=GosuFnTADrpxapDMNQSMxKoI9B4aPtIw7LwPwoCmYxU%3Dreserved=0

If we clone that package to local machine via:
git clone 
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbcgov%2Fbcmaps.rdatadata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=GosuFnTADrpxapDMNQSMxKoI9B4aPtIw7LwPwoCmYxU%3Dreserved=0

The first oddity is that the package installs successfully using this:

$ R CMD INSTALL "./bcmaps.rdata"

But fails when I try to build the package:

$ R CMD BUILD "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmaps.rdata':
* checking DESCRIPTION meta-information ... OK
* 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 Warning in 
gzfile(file, "rb") :
  cannot open compressed file 'bcmaps.rdata', probable reason 'Permission 
denied'
Error in gzfile(file, "rb") : cannot open the connection Execution halted


The second oddity is that if I remove the . from the Package name in the 
DESCRIPTION file, the build proceeds smoothly:

$ R CMD build "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmapsrdata':
* checking DESCRIPTION meta-information ... OK
* 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 'bcmapsrdata_0.2.0.tar.gz'

I am assuming that R CMD install builds the package internally so I find it 
confusing that I am not able to build it myself. Similarly confusing is the 
lack of a . in the package name indicative of anything?

Does anyone have any idea what's going on here? Am I missing something obvious?

Thanks in advance,

Sam

__
R-package-devel@r-project.org mailing list
https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-develdata=02%7C01%7Chongooi%40microsoft.com%7C6ac8c309c7b84a8de4d208d677fef252%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636828334223679364sdata=0r%2FFfRH6eYqRPLAAFLprWAttPip02VKV0GIqBOtVhI8%3Dreserved=0

--- End Message ---
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] R CMD INSTALL succeeds while R CMD BUILD fails

2019-01-11 Thread Sam Albers
Hello all,

I am experiencing some issues with building a package that we are
hosting on GitHub. The package itself is quite large.  It is a data
package with a bunch of spatial files stored as .rds files.

The repo is located here: https://github.com/bcgov/bcmaps.rdata

If we clone that package to local machine via:
git clone https://github.com/bcgov/bcmaps.rdata

The first oddity is that the package installs successfully using this:

$ R CMD INSTALL "./bcmaps.rdata"

But fails when I try to build the package:

$ R CMD BUILD "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmaps.rdata':
* checking DESCRIPTION meta-information ... OK
* 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
Warning in gzfile(file, "rb") :
  cannot open compressed file 'bcmaps.rdata', probable reason
'Permission denied'
Error in gzfile(file, "rb") : cannot open the connection
Execution halted


The second oddity is that if I remove the . from the Package name in
the DESCRIPTION file, the build proceeds smoothly:

$ R CMD build "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmapsrdata':
* checking DESCRIPTION meta-information ... OK
* 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 'bcmapsrdata_0.2.0.tar.gz'

I am assuming that R CMD install builds the package internally so I
find it confusing that I am not able to build it myself. Similarly
confusing is the lack of a . in the package name indicative of
anything?

Does anyone have any idea what's going on here? Am I missing something obvious?

Thanks in advance,

Sam

__
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")

2019-01-11 Thread Troels Ring
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


Re: [R-pkg-devel] NAMESPACE importFrom("stats", "uniroot")

2019-01-11 Thread Iñaki Ucar
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.html#imports

If you don't use this function many many times, it is even better to
use stats::uniroot instead.

Iñaki

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] NAMESPACE importFrom("stats", "uniroot")

2019-01-11 Thread Troels Ring
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