Re: [Rd] Import data set from another package?

2015-03-02 Thread Jeroen Ooms
You could add something like this to your package: .onLoad <- function(libname, pkgname){ data(ergoStool, package="nlme", envir = environment(.onLoad)); } This should basically do the same as importFrom(nlme, "ergoStool") but then for a lazy load dataset. On Mon, Mar 2, 2015 at 2:48 PM, Thern

Re: [Rd] Import data set from another package?

2015-03-02 Thread Hadley Wickham
How about just nlme::ergoStool ? Hadley On Mon, Mar 2, 2015 at 4:48 PM, Therneau, Terry M., Ph.D. wrote: > I've moved nlme from Depends to Imports in my coxme package. However, a few > of the examples for lmekin use one of the data sets from nlme. This is on > purpose, to show how the results a

Re: [Rd] Import data set from another package?

2015-03-02 Thread Brian G. Peterson
On 03/02/2015 04:48 PM, Therneau, Terry M., Ph.D. wrote: I've moved nlme from Depends to Imports in my coxme package. However, a few of the examples for lmekin use one of the data sets from nlme. This is on purpose, to show how the results are the same and how they differ. If I use data(nlme

[Rd] Import data set from another package?

2015-03-02 Thread Therneau, Terry M., Ph.D.
I've moved nlme from Depends to Imports in my coxme package. However, a few of the examples for lmekin use one of the data sets from nlme. This is on purpose, to show how the results are the same and how they differ. If I use data(nlme::ergoStool) the data is not found, data(nlme:::ergoStoo

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Hervé Pagès
On 03/02/2015 01:00 PM, Hervé Pagès wrote: Hi, On 03/02/2015 12:18 PM, Dénes Tóth wrote: On 03/02/2015 04:37 PM, Martin Maechler wrote: On 2 March 2015 at 09:09, Duncan Murdoch wrote: | I generally recommend that people use Rcpp, which hides a lot of the | details. It will generate your .

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Hervé Pagès
Hi, On 03/02/2015 12:18 PM, Dénes Tóth wrote: On 03/02/2015 04:37 PM, Martin Maechler wrote: On 2 March 2015 at 09:09, Duncan Murdoch wrote: | I generally recommend that people use Rcpp, which hides a lot of the | details. It will generate your .Call calls for you, and generate the | C++ c

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Martin Morgan
On 03/02/2015 11:39 AM, Dirk Eddelbuettel wrote: On 2 March 2015 at 16:37, Martin Maechler wrote: | | > On 2 March 2015 at 09:09, Duncan Murdoch wrote: | > | I generally recommend that people use Rcpp, which hides a lot of the | > | details. It will generate your .Call calls for you, and genera

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Dénes Tóth
On 03/02/2015 04:37 PM, Martin Maechler wrote: On 2 March 2015 at 09:09, Duncan Murdoch wrote: | I generally recommend that people use Rcpp, which hides a lot of the | details. It will generate your .Call calls for you, and generate the | C++ code that receives them; you just need to think a

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Dirk Eddelbuettel
On 2 March 2015 at 16:37, Martin Maechler wrote: | | > On 2 March 2015 at 09:09, Duncan Murdoch wrote: | > | I generally recommend that people use Rcpp, which hides a lot of the | > | details. It will generate your .Call calls for you, and generate the | > | C++ code that receives them; you ju

[Rd] Errors on Windows with grep(fixed=TRUE) on UTF-8 strings

2015-03-02 Thread Winston Chang
On Windows, grep(fixed=TRUE) throws errors with some UTF-8 strings. Here's an example (must be run on Windows to reproduce the error): Sys.setlocale("LC_CTYPE", "chinese") y <- rawToChar(as.raw(c(0xe6, 0xb8, 0x97))) Encoding(y) <- "UTF-8" y # [1] "渗" grep("\n", y, fixed = TRUE) # Error in grep("\n

Re: [Rd] clarification on import/depends for a method

2015-03-02 Thread Hadley Wickham
That makes sense to me. Hadley On Mon, Mar 2, 2015 at 8:45 AM, Therneau, Terry M., Ph.D. wrote: > User of the coxme library (mixed effects Cox models) are instructed to use > ranef(), fixed(), VarCorr(), etc to retrieve bits out of a fitted model; it > purposely uses the same methods as nlme and/

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Martin Maechler
> On 2 March 2015 at 09:09, Duncan Murdoch wrote: > | I generally recommend that people use Rcpp, which hides a lot of the > | details. It will generate your .Call calls for you, and generate the > | C++ code that receives them; you just need to think about the real > | problem, not the interf

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread sarah manderni
Thanks! I went through the online posts which supports the power of .Call over .C. But my probably naive question is why does this work for my code with R but not R-devel? And another question is related to using .Call. Based on the manual page, I do not need to change the function parameters when

[Rd] clarification on import/depends for a method

2015-03-02 Thread Therneau, Terry M., Ph.D.
User of the coxme library (mixed effects Cox models) are instructed to use ranef(), fixed(), VarCorr(), etc to retrieve bits out of a fitted model; it purposely uses the same methods as nlme and/or lmer. The current behavior is to "depend" on nlme. If I defined the methods myself in coxme, th

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Dirk Eddelbuettel
On 2 March 2015 at 09:09, Duncan Murdoch wrote: | I generally recommend that people use Rcpp, which hides a lot of the | details. It will generate your .Call calls for you, and generate the | C++ code that receives them; you just need to think about the real | problem, not the interface. It h

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Duncan Murdoch
On 02/03/2015 8:46 AM, sarah manderni wrote: Thanks! I went through the online posts which supports the power of .Call over .C. But my probably naive question is why does this work for my code with R but not R-devel? Because of the change mentioned in the NEWS file. And another question is re

Re: [Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread Duncan Murdoch
On 02/03/2015 3:50 AM, sarah manderni wrote: > Hi, > > Within my R code, I am using a C++ function as below: > > overlaps <- matrix(0, nrow=B, ncol=length(N)) > overlaps.P <- matrix(0, nrow=B, ncol=length(N)) > >.C("speedUp", D, S, pD, pS, nrow(D), as.integer(N), length(N),

[Rd] R-devel does not update the C++ returned variables

2015-03-02 Thread sarah manderni
Hi, Within my R code, I am using a C++ function as below: overlaps <- matrix(0, nrow=B, ncol=length(N)) overlaps.P <- matrix(0, nrow=B, ncol=length(N)) .C("speedUp", D, S, pD, pS, nrow(D), as.integer(N), length(N), ssq[i], i, as.integer(B), overlaps, overlaps.P, DU

Re: [Rd] Fixing ambiguous corrections and reattempting to submit package to R

2015-03-02 Thread Duncan Murdoch
On 01/03/2015 10:09 PM, Luck Buttered wrote: > Hello: > > I recently submitted a package to R using devtools:release(). > > I received no errors, warnings, or notes in R CMD check. > > However, I received two notes in devtools::release(): > > 1) checking CRAN incoming feasibility ... NOTE > 2)