Re: [R-pkg-devel] sf subsetting with square bracket

2019-02-03 Thread Duncan Murdoch

On 03/02/2019 3:02 p.m., Berry Boessenkool wrote:


Hi,

if sf is not loaded, subsetting an sf object with square brackets loses the sf 
class in the geometry column:
sfobj[somerows,]
For usage in a package, I do not want to call library(sf) first.

[ is an S3 method in sf:
https://github.com/r-spatial/sf/blob/master/NAMESPACE#L6
https://github.com/r-spatial/sf/blob/master/R/sf.R#L299

In my package (with an sf object from osmplotr), using
sf:::"[.sf"(obj, somerows, allcolumns)
works fine, but of course Rcmd check complains about the Unexported object 
imported by a ':::' call.

How can I use the sf [ method without completely loading sf?
(and also without depending on dplyr::select)

I guess I'm missing some really clever method import.
Can someone point me in the right direction?


You need to show us something reproducible if you want help.  Is your 
package on Github or some other public repository?


Duncan Murdoch

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


Re: [R-pkg-devel] Problem installing built vignettes

2019-02-03 Thread Alexandre Courtiol
Hi Chris,
I solved the issue directly in the code after forking your repos and send
you a pull request.
The folder vignette was at the wrong place and I added the .asis files as
well as updated the description file.
I hope it will work on your system.
++

On Sun, 3 Feb 2019 at 08:33, Chris Brien  wrote:

> Hi list members,
>
> I am having a problem installing vignettes for my asremlPlus package (
> https://github.com/briencj/asremlPlus - see VIgnettes branch) and have
> run into a brick wall in my efforts to solve it.  So any help would be
> greatly appreciated.
>
> The basic problem is that the R.rsp package cannot be found by
> loadVignetteBuilder when checking or building the package. Here are the
> details.
>
> I am running R 3.5.1 under Windows 10.
>
> I have compiled the Rmd sources to pdf files and I need to incorporate the
> pdfs without rebuilding them. The reasons are that they rely on having a
> package that is not available from a public R repo, namely asreml, and the
> R code take too much time to run on the CRAN servers.
>
> To deal with this I have tried to use the package R.rsp. Following the
> instructions, for example for WheatVignette.pdf, I have included the
> WheatVignette.pdf.asis with contents
>
> %\VignetteIndexEntry{Wheat data: a spatial analysis example}
> %\VignetteEngine{R.rsp::asis}
> %\VignetteAuthor{Chris Brien}
> %\VignetteKeyword{asremlPlus}
>
> I have the following lines in the DESCRIPTION file:
>
> Suggests: testthat, lattice, emmeans, lmerTest, pbkrtest, R.rsp
> Enhances: asreml
> VignetteBuilder: R.rsp
>
> When I run the following devtools::check call on the package
>
> devtools::check("asremlPlus", manual=TRUE, check_dir="D:/Analyses/R",
> document=FALSE,
> args="--as-cran")
>
> I get the following error message
>
> -  saving partial Rd database (7.6s)
>Error in loadVignetteBuilder(pkgdir, TRUE) :
>  vignette builder 'R.rsp' not found
>Execution halted
> Error in run(bin, args = real_cmdargs, stdout_line_callback =
> real_callback(stdout),  :
>   System command error
>
> To check the availability of R.rsp I did the following:
>
> > .libPaths();find.package("R.rsp")
> [1] "D:/Analyses/R library"   "D:/Analyses/R oldpkg"
>
> [3] "C:/Program Files/StatSoft/R/R-3.5.1/library"
> [1] "D:/Analyses/R library/R.rsp"
>
> I also note that in my HOME directory I have an .Renviron file with the
> following line:
>
> R_LIBS_USER="D:\\Analyses\\R library"
>
> Cheers,
>
>  Chris
>
>  Chris Brien | Adjunct Associate Professor in Statistics
> -
> School of Information Technology &  Mathematical Sciences
> University of South Australia
> GPO Box 2471
> ADELAIDE  5001  South Australia
> Phone:  +61 8 8302 5535   Fax:  +61 8 8302 5785
> Email:   chris.br...@unisa.edu.au
> WEB page:  
> CRICOS No 00121B
>
> __
> 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