search for: get_all_var

Displaying 20 results from an estimated 22 matches for "get_all_var".

Did you mean: get_all_vars
2017 Mar 26
1
Documentation of model.frame() and get_all_vars()
Hi everyone, This is about documentation for the model.frame() page. The get_all_vars() function (added in R 2.5.0) is a great addition, but the behavior of its '...' argument is different from that of model.frame() with which it is documented and this creates ambiguity. The current docs read: \item{\dots}{further arguments such as \code{data}, \code{na.action}, \code{subs...
2009 Mar 25
1
get_all_vars fails with matrices (PR#13624)
Hi, According to the help file for model.frame/get_all_vars, the following should produce the same output from both functions, but it doesn't... > dat <- list(X=matrix(1:15,5,3),z=26:30) > model.frame(~z+X,dat) z X.1 X.2 X.3 1 26 1 6 11 2 27 2 7 12 3 28 3 8 13 4 29 4 9 14 5 30 5 10 15 > get_all_vars(~z+X,dat) [1...
2017 Mar 30
0
get_all_vars() does not handle rhs matrices in formulae
Hello again, It appears that get_all_vars() incorrectly handles model formulae that use a right-hand side (rhs) matrix. For example, consider these two substantively identical models: # model using named variables mpg <- mtcars$mpg wt <- mtcars$wt hp <- mtcars$hp m1 <- lm(mpg ~ wt + hp) # model using matrix y <- mtcars$mp...
2007 Mar 18
1
Error with get_all_vars()
> get_all_vars(dist ~ speed, data = cars) Error in `row.names<-.data.frame`(`*tmp*`, value = c(NA, -50L)) : invalid 'row.names' length > version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status Under deve...
2019 Nov 18
2
Inappropriate class(o)[!inherits(o,"AsIs")] in get_all_vars
...;> SVN revision 77401 changes >> x[isM] <- lapply(x[isM], function(o) `class<-`(o, class(o)[class(o) != "AsIs"])) >> to >> x[isM] <- lapply(x[isM], function(o) `class<-`(o, class(o)[!inherits(o,"AsIs")])) >> in function 'get_all_vars' in src/library/stats/R/models.R in R devel. >> The change is inappropriate. >> class(o)[class(o) != "AsIs"] removes "AsIs" from class(o), giving class(o) without "AsIs". >> On the other hand, inherits(o,"AsIs") is just a...
2019 Nov 17
2
Inappropriate class(o)[!inherits(o,"AsIs")] in get_all_vars
SVN?revision?77401?changes ????????x[isM]?<-?lapply(x[isM],?function(o)?`class<-`(o,?class(o)[class(o)?!=?"AsIs"])) to ????????x[isM]?<-?lapply(x[isM],?function(o)?`class<-`(o,?class(o)[!inherits(o,"AsIs")])) in?function?'get_all_vars'?in?src/library/stats/R/models.R?in?R?devel. The?change?is?inappropriate. class(o)[class(o)?!=?"AsIs"]?removes?"AsIs"?from?class(o),?giving?class(o)?without?"AsIs". On?the?other?hand,?inherits(o,"AsIs")?is?just?a?single?logical?value.?If?"AsIs&qu...
2019 Nov 29
0
Inappropriate class(o)[!inherits(o,"AsIs")] in get_all_vars
class(o)[!inherits(o,"AsIs")] is still in function 'get_all_vars' in R patched (in https://svn.r-project.org/R/branches/R-3-6-branch/src/library/stats/R/models.R). It was ported to R patched by r77402. On Monday, 18 November 2019, 8:12:10 PM GMT+7, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>> Martin Maechler &g...
2011 Aug 17
1
extract variables from model formula
Hi All, I am writing a function to predict values based on a model. It works fine as long as the formula just uses regular variable names. I am having a problem when the variables are wrapped with a function call. For example: m <- lm(mpg ~ factor(cyl), data = mtcars) ## I get the column names using as.character(attr(terms(m), "variables"))[-1L] ## which gives the same column
2012 Jan 03
1
returning information from functions via attributes rather than return list
...rOnlyInteractors=TRUE, centerDV=FALSE, standardize=FALSE, centerContrasts = F){ std <- function(x) { if( !is.numeric(x) ){ stop("center.lm tried to center a factor variable. No Can Do!") } else { scale(x, center = TRUE, scale = standardize) } } rdf <- get_all_vars(formula(model), model$model) #raw data frame t <- terms(model) tl <- attr(t, "term.labels") tmdc <- attr(t, "dataClasses") ##term model data classes isNumeric <- names(tmdc)[ which(tmdc %in% c("numeric"))] isFac <- names(tmdc)[ which(tmdc %i...
2007 Feb 10
1
how to eval subset?
Hi, I have problems with subset when calling a function from inside a function from inside a function. Here is a small example to be called as 'f1()'. 'eval()' in f3 fails with error message Error in eval(expr, envir, enclos) : object "subs" not found Is it possible to supplement subset to data, to be calculated in a different environment than the data itself? Thanks
2019 Dec 12
4
R 3.6.2 is released
...to C stack overflow because of infinite recursion. * R_tryCatch no longer transfers control for all conditions. Reported and patch provided by Lionel Henry in PR#17617. * format(object.size(.), digits=NULL) now works, fixing PR#17628 reported by Jonathan Carroll. * get_all_vars(f, d) now also works for cases, e.g. where d contains a matrix. Reported by Simon Wood in 2009 and patch provided by Ben Bolker in PR#13624. Additionally, it now also works when some variables are data frames, fixing PR#14905, reported by Patrick Breheny. * barplot()...
2019 Dec 12
4
R 3.6.2 is released
...to C stack overflow because of infinite recursion. * R_tryCatch no longer transfers control for all conditions. Reported and patch provided by Lionel Henry in PR#17617. * format(object.size(.), digits=NULL) now works, fixing PR#17628 reported by Jonathan Carroll. * get_all_vars(f, d) now also works for cases, e.g. where d contains a matrix. Reported by Simon Wood in 2009 and patch provided by Ben Bolker in PR#13624. Additionally, it now also works when some variables are data frames, fixing PR#14905, reported by Patrick Breheny. * barplot()...
2019 Dec 12
4
R 3.6.2 is released
...to C stack overflow because of infinite recursion. * R_tryCatch no longer transfers control for all conditions. Reported and patch provided by Lionel Henry in PR#17617. * format(object.size(.), digits=NULL) now works, fixing PR#17628 reported by Jonathan Carroll. * get_all_vars(f, d) now also works for cases, e.g. where d contains a matrix. Reported by Simon Wood in 2009 and patch provided by Ben Bolker in PR#13624. Additionally, it now also works when some variables are data frames, fixing PR#14905, reported by Patrick Breheny. * barplot()...
2019 Dec 12
2
R 3.6.2 is released
...finite recursion. > > * R_tryCatch no longer transfers control for all conditions. > Reported and patch provided by Lionel Henry in PR#17617. > > * format(object.size(.), digits=NULL) now works, fixing PR#17628 > reported by Jonathan Carroll. > > * get_all_vars(f, d) now also works for cases, e.g. where d > contains a matrix. Reported by Simon Wood in 2009 and patch > provided by Ben Bolker in PR#13624. > > Additionally, it now also works when some variables are data > frames, fixing PR#14905, reported by Patrick...
2012 May 03
1
Proposal: model.data
...ula(delete.response(terms(model)))) ## datOrig: original data frame datOrig <- eval(model$call$data, environment(formula(model))) if (is.null(datOrig))stop("model.data: input model has no data frame") ## datOrig: almost right, but includes d in poly(x, d) dat <- get_all_vars(fmla, datOrig) ## Get rid of "d" and other "non variable" variable names that are not in datOrig: keepnames <- intersect(names(dat), names(datOrig)) ## Keep only rows actually used in model fit, and the correct columns dat <- dat[ row.names(model$model) ,...
2019 Dec 12
0
R 3.6.2 is released
...infinite recursion. > > * R_tryCatch no longer transfers control for all conditions. > Reported and patch provided by Lionel Henry in PR#17617. > > * format(object.size(.), digits=NULL) now works, fixing PR#17628 > reported by Jonathan Carroll. > > * get_all_vars(f, d) now also works for cases, e.g. where d > contains a matrix. Reported by Simon Wood in 2009 and patch > provided by Ben Bolker in PR#13624. > > Additionally, it now also works when some variables are data > frames, fixing PR#14905, reported by Patrick B...
2019 Dec 12
0
R 3.6.2 is released
...* R_tryCatch no longer transfers control for all conditions. > > Reported and patch provided by Lionel Henry in PR#17617. > > > > * format(object.size(.), digits=NULL) now works, fixing PR#17628 > > reported by Jonathan Carroll. > > > > * get_all_vars(f, d) now also works for cases, e.g. where d > > contains a matrix. Reported by Simon Wood in 2009 and patch > > provided by Ben Bolker in PR#13624. > > > > Additionally, it now also works when some variables are data > > frames, fixing PR#149...
2018 Jul 20
2
Model formulas with explicit references
...isticated than merely checking the number of rows. Both predict() with newdata provided, and model.frame() with a data argument, should return an informative error message that says that model formulas like this are not supported with new data. Here is what appears to be an easy way to check: > get_all_vars(terms(cars.lm)) Error in eval(inp, data, env) : object 'cyl' not found Thanks Russ Russell V. Lenth? -? Professor Emeritus Department of Statistics and Actuarial Science The University of Iowa ?-? Iowa City, IA 52242? USA? Voice (319)335-0712 (Dept. office)? -? FAX (319)335-3017
2012 Jun 22
0
R 2.15.1 is released
...dates may be skipped (with a warning), when a newer installed version is already going to be used from .libPaths(). (PR#14866) o hclust() is now fast again (as up to end of 2003), with a different fix for the "median"/"centroid" problem. (PR#4195). o get_all_vars() failed when the data came entirely from vectors in the global environment. (PR#14847) o R CMD check with _R_CHECK_NO_RECOMMENDED_ set to a true value (as done by the --as-cran option) could issue false errors if there was an indirect dependency on a recommended package....
2012 Jun 22
0
R 2.15.1 is released
...dates may be skipped (with a warning), when a newer installed version is already going to be used from .libPaths(). (PR#14866) o hclust() is now fast again (as up to end of 2003), with a different fix for the "median"/"centroid" problem. (PR#4195). o get_all_vars() failed when the data came entirely from vectors in the global environment. (PR#14847) o R CMD check with _R_CHECK_NO_RECOMMENDED_ set to a true value (as done by the --as-cran option) could issue false errors if there was an indirect dependency on a recommended package....