Discussion:
[Rcpp-devel] Error creating package with RcppArmadillo
mike guggis
2018-10-12 18:59:28 UTC
Permalink
I am running into an error when building the default package with Rcpp
armadillo in Rstudio.



In rstudio if I go to New Project > New directory> R Package using
RcppArmadillo. Then create a project with a random nam,e “gh”. If I click
“check” under the build tab to check the package I get an error when
rstudio gets to the “checking examples” part. It gives me the error



- checking examples ... (434ms)

** running examples for arch 'i386' ... ERROR

Running examples in 'gh-Ex.R' failed
base::assign(".ptime", proc.time(), pos = "CheckExEnv")
### Name: gh-package
### Title: What the package does (short line)
### Aliases: gh-package gh
### Keywords: package
### ** Examples
~~ simple examples of the most important functions ~~
Error: unexpected symbol in "~~ simple examples"

Execution halted

** running examples for arch 'x64' ... ERROR

Running examples in 'gh-Ex.R' failed
base::assign(".ptime", proc.time(), pos = "CheckExEnv")
### Name: gh-package
### Title: What the package does (short line)
### Aliases: gh-package gh
### Keywords: package
### ** Examples
~~ simple examples of the most important functions ~~
My Rstudio version is 1.1.456. My session info with RCpp and RCppArmadillo
loaded is
sessionInfo()
R version 3.5.1 (2018-07-02)

Platform: x86_64-w64-mingw32/x64 (64-bit)

Running under: Windows >= 8 x64 (build 9200)



Matrix products: default



locale:

[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252

[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[5] LC_TIME=English_United States.1252



attached base packages:

[1] stats graphics grDevices utils datasets methods base



other attached packages:

[1] RcppArmadillo_0.9.100.5.0 Rcpp_0.12.19



loaded via a namespace (and not attached):

[1] compiler_3.5.1 rsconnect_0.8.8 tools_3.5.1 yaml_2.2.0



Any help you can provide would be appreciated.
Dirk Eddelbuettel
2018-10-12 20:18:10 UTC
Permalink
On 12 October 2018 at 14:59, mike guggis wrote:
| I am running into an error when building the default package with Rcpp
| armadillo in Rstudio.
|
|
|
| In rstudio if I go to New Project > New directory> R Package using
| RcppArmadillo. Then create a project with a random nam,e “gh”. If I click
| “check” under the build tab to check the package I get an error when
| rstudio gets to the “checking examples” part. It gives me the error
|
|
|
| - checking examples ... (434ms)
|
| ** running examples for arch 'i386' ... ERROR
|
| Running examples in 'gh-Ex.R' failed
|
| The error most likely occurred in:
|
|
|
| > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
|
| > ### Name: gh-package
|
| > ### Title: What the package does (short line)
|
| > ### Aliases: gh-package gh
|
| > ### Keywords: package
|
| >
|
| > ### ** Examples
|
| >
|
| > ~~ simple examples of the most important functions ~~
|
| Error: unexpected symbol in "~~ simple examples"
|
| Execution halted
|
| ** running examples for arch 'x64' ... ERROR
|
| Running examples in 'gh-Ex.R' failed
|
| The error most likely occurred in:
|
|
|
| > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
|
| > ### Name: gh-package
|
| > ### Title: What the package does (short line)
|
| > ### Aliases: gh-package gh
|
| > ### Keywords: package
|
| >
|
| > ### ** Examples
|
| >
|
| > ~~ simple examples of the most important functions ~~
|
|
|
|
|
| My Rstudio version is 1.1.456. My session info with RCpp and RCppArmadillo
| loaded is

Thanks for posting versions. This sounds ... weird.

1) The issue of 'failing' over these left-overs from the skeleton annoyed me
so much (many years ago!!) that I wrote a new helper package 'pkgKitten'.

2) 'pkgKitten' is used (if present) by
Rcpp.package.skeleton() # in Rcpp
RcppArmadillo.package.skeleton() # in RcppArmadillo

3) They work.

4) I just tried your example (of using RStudio's facilities -- which I also
use regularly) and COULD NOT reproduce this on
RStudio 1.1.456
RStudio 1.2.1030

So I am stumped. Kevin: Any idea?

Dirk


| > sessionInfo()
|
| R version 3.5.1 (2018-07-02)
|
| Platform: x86_64-w64-mingw32/x64 (64-bit)
|
| Running under: Windows >= 8 x64 (build 9200)
|
|
|
| Matrix products: default
|
|
|
| locale:
|
| [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
| States.1252
|
| [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
|
| [5] LC_TIME=English_United States.1252
|
|
|
| attached base packages:
|
| [1] stats graphics grDevices utils datasets methods base
|
|
|
| other attached packages:
|
| [1] RcppArmadillo_0.9.100.5.0 Rcpp_0.12.19
|
|
|
| loaded via a namespace (and not attached):
|
| [1] compiler_3.5.1 rsconnect_0.8.8 tools_3.5.1 yaml_2.2.0
|
|
|
| Any help you can provide would be appreciated.
| _______________________________________________
| Rcpp-devel mailing list
| Rcpp-***@lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Kevin Ushey
2018-10-13 17:42:43 UTC
Permalink
I can reproduce if the 'pkgKitten' package is not installed. In that
case, I see in man/<pkg>-package.Rd:

\examples{
~~ simple examples of the most important functions ~~
}

which of course is just a stub and not valid example code (and so
fails during check).

I think this is just gunk that gets inserted by R's own
package.skeleton(), which pkgKitten normally tries to clean up for
you. See e.g.

https://github.com/wch/r-source/blob/ff36007c3562e8c7a8517ae15196429fd9f8fb6d/src/library/utils/R/prompt.R#L379-L380

tl;dr: install pkgKitten and make your life easier.

Best,
Kevin
Post by Dirk Eddelbuettel
| I am running into an error when building the default package with Rcpp
| armadillo in Rstudio.
|
|
|
| In rstudio if I go to New Project > New directory> R Package using
| RcppArmadillo. Then create a project with a random nam,e “gh”. If I click
| “check” under the build tab to check the package I get an error when
| rstudio gets to the “checking examples” part. It gives me the error
|
|
|
| - checking examples ... (434ms)
|
| ** running examples for arch 'i386' ... ERROR
|
| Running examples in 'gh-Ex.R' failed
|
|
|
|
| > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
|
| > ### Name: gh-package
|
| > ### Title: What the package does (short line)
|
| > ### Aliases: gh-package gh
|
| > ### Keywords: package
|
| >
|
| > ### ** Examples
|
| >
|
| > ~~ simple examples of the most important functions ~~
|
| Error: unexpected symbol in "~~ simple examples"
|
| Execution halted
|
| ** running examples for arch 'x64' ... ERROR
|
| Running examples in 'gh-Ex.R' failed
|
|
|
|
| > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
|
| > ### Name: gh-package
|
| > ### Title: What the package does (short line)
|
| > ### Aliases: gh-package gh
|
| > ### Keywords: package
|
| >
|
| > ### ** Examples
|
| >
|
| > ~~ simple examples of the most important functions ~~
|
|
|
|
|
| My Rstudio version is 1.1.456. My session info with RCpp and RCppArmadillo
| loaded is
Thanks for posting versions. This sounds ... weird.
1) The issue of 'failing' over these left-overs from the skeleton annoyed me
so much (many years ago!!) that I wrote a new helper package 'pkgKitten'.
2) 'pkgKitten' is used (if present) by
Rcpp.package.skeleton() # in Rcpp
RcppArmadillo.package.skeleton() # in RcppArmadillo
3) They work.
4) I just tried your example (of using RStudio's facilities -- which I also
use regularly) and COULD NOT reproduce this on
RStudio 1.1.456
RStudio 1.2.1030
So I am stumped. Kevin: Any idea?
Dirk
| > sessionInfo()
|
| R version 3.5.1 (2018-07-02)
|
| Platform: x86_64-w64-mingw32/x64 (64-bit)
|
| Running under: Windows >= 8 x64 (build 9200)
|
|
|
| Matrix products: default
|
|
|
|
| [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
| States.1252
|
| [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
|
| [5] LC_TIME=English_United States.1252
|
|
|
|
| [1] stats graphics grDevices utils datasets methods base
|
|
|
|
| [1] RcppArmadillo_0.9.100.5.0 Rcpp_0.12.19
|
|
|
|
| [1] compiler_3.5.1 rsconnect_0.8.8 tools_3.5.1 yaml_2.2.0
|
|
|
| Any help you can provide would be appreciated.
| _______________________________________________
| Rcpp-devel mailing list
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
--
_______________________________________________
Rcpp-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Dirk Eddelbuettel
2018-10-13 17:53:20 UTC
Permalink
On 13 October 2018 at 10:42, Kevin Ushey wrote:
| I can reproduce if the 'pkgKitten' package is not installed. In that
| case, I see in man/<pkg>-package.Rd:
|
| \examples{
| ~~ simple examples of the most important functions ~~
| }
|
| which of course is just a stub and not valid example code (and so
| fails during check).
|
| I think this is just gunk that gets inserted by R's own
| package.skeleton(), which pkgKitten normally tries to clean up for
| you. See e.g.
|
| https://github.com/wch/r-source/blob/ff36007c3562e8c7a8517ae15196429fd9f8fb6d/src/library/utils/R/prompt.R#L379-L380
|
| tl;dr: install pkgKitten and make your life easier.

Now *that* is a recommendation I can get behind :)

It is in fact a suggested package for Rcpp too.

And ...

| On Fri, Oct 12, 2018 at 1:18 PM Dirk Eddelbuettel <***@debian.org> wrote:
[...]
| > Thanks for posting versions. This sounds ... weird.
| >
| > 1) The issue of 'failing' over these left-overs from the skeleton annoyed me
| > so much (many years ago!!) that I wrote a new helper package 'pkgKitten'.
| >
| > 2) 'pkgKitten' is used (if present) by
| > Rcpp.package.skeleton() # in Rcpp
| > RcppArmadillo.package.skeleton() # in RcppArmadillo

Now we are reminded that RStudio's package generator uses it too.

| > 3) They work.
| >
| > 4) I just tried your example (of using RStudio's facilities -- which I also
| > use regularly) and COULD NOT reproduce this on
| > RStudio 1.1.456
| > RStudio 1.2.1030

... because I keep pkgKitten around on my systems.

All good, Dirk

| > So I am stumped. Kevin: Any idea?
| >
| > Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
William Dunlap
2018-10-13 18:13:45 UTC
Permalink
But do replace pkgKitten's boilerplate before submitting the package to
CRAN, lest CRAN people decide to insist on meaningful content.

./RApiDatetime/man/RApiDatetime-package.Rd: This section should provide a
more detailed overview of how to use the
./SimplifyStats/man/SimplifyStats-package.Rd: This section should provide
a more detailed overview of how to use the
./googlePolylines/man/sfencode-package.Rd: This section should provide a
more detailed overview of how to use the
./multistateutils/man/des-package.Rd: This section should provide a more
detailed overview of how to use the
./mrbsizeR/man/mrbsizer-package.Rd: This section should provide a more
detailed overview of how to use the
./xtensor/man/xtensor-package.Rd: This section should provide a more
detailed overview of how to use the


Bill Dunlap
TIBCO Software
wdunlap tibco.com
Post by Dirk Eddelbuettel
| I can reproduce if the 'pkgKitten' package is not installed. In that
|
| \examples{
| ~~ simple examples of the most important functions ~~
| }
|
| which of course is just a stub and not valid example code (and so
| fails during check).
|
| I think this is just gunk that gets inserted by R's own
| package.skeleton(), which pkgKitten normally tries to clean up for
| you. See e.g.
|
| https://github.com/wch/r-source/blob/ff36007c3562e8c7a8517ae1519642
9fd9f8fb6d/src/library/utils/R/prompt.R#L379-L380
|
| tl;dr: install pkgKitten and make your life easier.
Now *that* is a recommendation I can get behind :)
It is in fact a suggested package for Rcpp too.
And ...
[...]
| > Thanks for posting versions. This sounds ... weird.
| >
| > 1) The issue of 'failing' over these left-overs from the skeleton annoyed me
| > so much (many years ago!!) that I wrote a new helper package 'pkgKitten'.
| >
| > 2) 'pkgKitten' is used (if present) by
| > Rcpp.package.skeleton() # in Rcpp
| > RcppArmadillo.package.skeleton() # in RcppArmadillo
Now we are reminded that RStudio's package generator uses it too.
| > 3) They work.
| >
| > 4) I just tried your example (of using RStudio's facilities -- which I also
| > use regularly) and COULD NOT reproduce this on
| > RStudio 1.1.456
| > RStudio 1.2.1030
... because I keep pkgKitten around on my systems.
All good, Dirk
| > So I am stumped. Kevin: Any idea?
| >
| > Dirk
--
_______________________________________________
Rcpp-devel mailing list
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
Dirk Eddelbuettel
2018-10-13 18:35:50 UTC
Permalink
Hi Bill,

On 13 October 2018 at 11:13, William Dunlap wrote:
| But do replace pkgKitten's boilerplate before submitting the package to
| CRAN, lest CRAN people decide to insist on meaningful content.
|
| ./RApiDatetime/man/RApiDatetime-package.Rd: This section should provide a
| more detailed overview of how to use the
| ./SimplifyStats/man/SimplifyStats-package.Rd: This section should provide
| a more detailed overview of how to use the
| ./googlePolylines/man/sfencode-package.Rd: This section should provide a
| more detailed overview of how to use the
| ./multistateutils/man/des-package.Rd: This section should provide a more
| detailed overview of how to use the
| ./mrbsizeR/man/mrbsizer-package.Rd: This section should provide a more
| detailed overview of how to use the
| ./xtensor/man/xtensor-package.Rd: This section should provide a more
| detailed overview of how to use the

Fair point that you raise here. I hope you don't mind if I reply:

1. Pointing users to a helper tool which produces non-working output is
counter-productive and a slap in their face. I tried many times to convince
Duncan Murdoch (who, while an R Core member, would at least at times listen
to proles like myself). I failed, and all I could do is write pkgKitten.
But this is, as the saying goes, "a hill I willing to die on". What R does
here is wrong.

2. Your critique is valid, but I have neither carrot nor stick to push on. In
my mind R CMD check could (and should !!) check for this not-replaced-stanza
text. But you know how it goes about changes in CRAN / R Core.

3. You list several packages. One is mine. It should not even exists if R
Core was not so paranoid about about their API. Another is one I helped with
so guilty as charged.

4. You list six packages. Rights now Rcpp has 1460 reverse dependencies. I
take six out of 1460 (surely upward biased as not all use package creators)
if it means the first point above is taken care of.

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
mike guggis
2018-10-15 13:00:10 UTC
Permalink
I installed pkgKitten and it passed the check. Thank you very much.
Post by Dirk Eddelbuettel
Hi Bill,
| But do replace pkgKitten's boilerplate before submitting the package to
| CRAN, lest CRAN people decide to insist on meaningful content.
|
| ./RApiDatetime/man/RApiDatetime-package.Rd: This section should provide a
| more detailed overview of how to use the
| ./SimplifyStats/man/SimplifyStats-package.Rd: This section should provide
| a more detailed overview of how to use the
| ./googlePolylines/man/sfencode-package.Rd: This section should provide a
| more detailed overview of how to use the
| ./multistateutils/man/des-package.Rd: This section should provide a more
| detailed overview of how to use the
| ./mrbsizeR/man/mrbsizer-package.Rd: This section should provide a more
| detailed overview of how to use the
| ./xtensor/man/xtensor-package.Rd: This section should provide a more
| detailed overview of how to use the
1. Pointing users to a helper tool which produces non-working output is
counter-productive and a slap in their face. I tried many times to convince
Duncan Murdoch (who, while an R Core member, would at least at times listen
to proles like myself). I failed, and all I could do is write pkgKitten.
But this is, as the saying goes, "a hill I willing to die on". What R does
here is wrong.
2. Your critique is valid, but I have neither carrot nor stick to push on. In
my mind R CMD check could (and should !!) check for this
not-replaced-stanza
text. But you know how it goes about changes in CRAN / R Core.
3. You list several packages. One is mine. It should not even exists if R
Core was not so paranoid about about their API. Another is one I helped with
so guilty as charged.
4. You list six packages. Rights now Rcpp has 1460 reverse dependencies. I
take six out of 1460 (surely upward biased as not all use package creators)
if it means the first point above is taken care of.
Dirk
--
Dirk Eddelbuettel
2018-10-15 13:43:30 UTC
Permalink
On 15 October 2018 at 09:00, mike guggis wrote:
| I installed pkgKitten and it passed the check. Thank you very much.

Great, and thanks for reporting back and closing the loop.

Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | ***@debian.org
Jeff Newmiller
2018-10-13 18:15:05 UTC
Permalink
I am not going to defend it, but making a package skeleton that fails if you don't fix all the boilerplate just represents a different philosophy of assistance. If you don't actually take ownership of all parts of the package eventually then you will share bogus packages. It is like strict type checking... early warnings can prevent problems during runtime (use).

So yes, if you are the kind of person who actually does follow through, a less noisy tool can get the job done with less friction. Otherwise, you should be updating the Rd files anyway....
Post by Dirk Eddelbuettel
| I can reproduce if the 'pkgKitten' package is not installed. In that
|
| \examples{
| ~~ simple examples of the most important functions ~~
| }
|
| which of course is just a stub and not valid example code (and so
| fails during check).
|
| I think this is just gunk that gets inserted by R's own
| package.skeleton(), which pkgKitten normally tries to clean up for
| you. See e.g.
|
|
https://github.com/wch/r-source/blob/ff36007c3562e8c7a8517ae15196429fd9f8fb6d/src/library/utils/R/prompt.R#L379-L380
|
| tl;dr: install pkgKitten and make your life easier.
Now *that* is a recommendation I can get behind :)
It is in fact a suggested package for Rcpp too.
And ...
[...]
| > Thanks for posting versions. This sounds ... weird.
| >
| > 1) The issue of 'failing' over these left-overs from the skeleton annoyed me
| > so much (many years ago!!) that I wrote a new helper package 'pkgKitten'.
| >
| > 2) 'pkgKitten' is used (if present) by
| > Rcpp.package.skeleton() # in Rcpp
| > RcppArmadillo.package.skeleton() # in RcppArmadillo
Now we are reminded that RStudio's package generator uses it too.
| > 3) They work.
| >
| > 4) I just tried your example (of using RStudio's facilities -- which I also
| > use regularly) and COULD NOT reproduce this on
| > RStudio 1.1.456
| > RStudio 1.2.1030
... because I keep pkgKitten around on my systems.
All good, Dirk
| > So I am stumped. Kevin: Any idea?
| >
| > Dirk
--
Sent from my phone. Please excuse my brevity.
Loading...