search for: envir

Displaying 20 results from an estimated 356 matches for "envir".

2007 Nov 13
1
`eval' and environment question
my understanding of `eval' behaviour is obviously incomplete. my question: usually `eval(expr)' and `eval(expr, envir=parent.frame())' should be identical. why does the last `eval' (yielding `r3') in this code _not_ evaluate in the local environment of function `f' but rather in the global environment (if `f' is called from there)? #--------------------------------------------------...
2008 Oct 14
1
library MICE warning message
...al 10: In any(predictorMatrix[j, ]) ... : coercing argument of type 'double' to logical 11: In any(predictorMatrix[, j]) ... : coercing argument of type 'double' to logical 12: In any(predictorMatrix[j, ]) ... : coercing argument of type 'double' to logical 13: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 14: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 15: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm! 16: In eval(expr, envir, enclos) ... : non-integer #successes in a binomial glm!...
2011 Oct 12
2
goofy class question
Dear R People: Here is a really goofy question. I have some objects which have 2 classes: data.frame and ucr. Also, the classes will always be in that order. I have tried all sorts of things, but to no avail. listucrModels <- function(envir=.GlobalEnv, ...) { objects <- ls(envir=envir, ...) if (length(objects) == 0) NULL else objects[sapply(objects, function(.x) "ucr"== (class(eval(parse(text=.x), envir=envir))[2]))] } > listucrModels() [1] NA NA NA NA NA N...
2012 Sep 26
1
how to know where you've been sourced from
...;) > cat("source(\"test.r\")",file="source_test.r") > cat("source(\"source_test.r\")",file="source_test_parent.r") > source("source_test_parent.r") [[1]] source("source_test_parent.r") [[2]] eval.with.vis(ei, envir) [[3]] eval.with.vis(expr, envir, enclos) [[4]] source("source_test.r") [[5]] eval.with.vis(ei, envir) [[6]] eval.with.vis(expr, envir, enclos) [[7]] source("test.r") [[8]] eval.with.vis(ei, envir) [[9]] eval.with.vis(expr, envir, enclos) [[10]] print(sys.calls())
2011 Mar 23
2
) Error in eval(expr, envir, enclos) : object '' not found
....sex y.sex.age.region.c.n 1 1980,F,A,N,-18.15,13.61 2 1980,F,A,N,-18.61,13.04 3 1980,F,A,N,-18.81,12.32 4 1990,F,A,N,-21.12,11.7 5 1990,F,A,N,-20.77,11.58 6 1990,F,A,N,-21.6,13.34 7 1990,F,A,N,-21.78,12.6 > model.anova<-aov(c~age*sex,data=data.sex) Error in eval(expr, envir, enclos) : object 'age' not found i just wanna do a anova test. but the error message is as above,,, what should i do to shoot this problem ? Should i define the age? -- View this message in context: http://r.789695.n4.nabble.com/Error-in-eval-expr-envir-enclos-object-...
2010 Dec 10
1
WriteXLS error:Error in get(x, envir = envir) : variable names are limited to 256 bytes
Hello all, I don't understand why this won't work. I have entered: WriteXLS(alldata,'test.xls') and I get this error message: Error in get(x, envir = envir) : variable names are limited to 256 bytes. My variable names are not very long, and are accepted by write.csv. alldata is a list containing 4 dataframes, with each dataframe having the the same variable names, which are: > names(avg8302) [1] "ID" "cluster&q...
2013 Feb 13
1
WriteXLS: 'object not found' error within function
...SheetNames = tableList, perl = "perl", verbose = FALSE, Encoding = c("UTF-8", "latin1"), row.names = TRUE, col.names = TRUE, AdjWidth = TRUE, AutoFilter = FALSE, BoldHeaderRow = FALSE, FreezeRow = 0, FreezeCol = 0, envir = parent.frame()) ...where "tables" is the name of a list of data.frames which are the tables to go into my sheets. I am having no problem running my code unless it is within a function in which case I get the error: "Error in get(as.character(x), envir = envir) : object 'tabl...
2005 Apr 30
2
Warning from Rcmd check - data could not find data set
This is rw2010 from CRAN. When running Rcmd check on a package I get: Warning in utils::data(list = al, envir = data_env) : data set 'vowel.test' not found Warning in utils::data(list = al, envir = data_env) : data set 'vowel.train' not found Warning in utils::data(list = al, envir = data_env) : data set 'waveform.test' not found Warning in utils::data(list = al, envi...
2005 Apr 30
2
Warning from Rcmd check - data could not find data set
This is rw2010 from CRAN. When running Rcmd check on a package I get: Warning in utils::data(list = al, envir = data_env) : data set 'vowel.test' not found Warning in utils::data(list = al, envir = data_env) : data set 'vowel.train' not found Warning in utils::data(list = al, envir = data_env) : data set 'waveform.test' not found Warning in utils::data(list = al, envi...
2009 Dec 17
2
issue with using rm: cannot generate on-the-fly list
...delList<-list() for(varname in c("rv1","rv2", "rv3", "rv4")) { if(exists(varname)) { delList<-append(delList, varname) } } if(length(delList)>0) { rm(list=delList, pos=-1) #rm(list=delList, envir=parent.env(environment())) #rm(list=delList, envir=globalenv()) } } Unfortunately, this fails to work - it aborts with the following error: Error in rm(list = delList, pos = -1) : invalid first argument if I use rm(list=delList, pos=-1) Or with the following error: Error in rm(list =...
2005 Dec 21
2
Newbie - Summarize function
...ean to the largest "top" elements within one of the vectors (X). I would like to process this summary statistic by groups. At this stage I have been trying to use the "summarize" function within the Hmisc library but I am getting the following error "Error in eval(expr, envir, enclos) : numeric 'envir' arg not of length one In addition: Warning message: no finite arguments to max; returning -Inf". Any suggetsions on how I can fix this would be greatly appreciated. Kind regards Andrew test <- read.table("test.csv", header=TRUE, sep=",...
2008 Aug 13
1
Arguments to lm() within a function - object not found
...;m doing wrong. I have the following: lmwrap <- function(...) { wts <- somefunction() print(wts) # This works, wts has the values I expect fit <- lm(weights=wts,...) return(fit) } If I call my function lmwrap, I get the the following error: > lmwrap(a~b) Error in eval(expr, envir, enclos) : object "wts" not found A traceback gives me the following: 8: eval(expr, envir, enclos) 7: eval(extras, data, env) 6: model.frame.default(formula = ..1, weights = wts, drop.unused.levels = TRUE) 5: model.frame(formula = ..1, weights = wts, drop.unused.levels = TRUE) 4: eval(e...
2003 Aug 07
0
predict(lm(etc.), some_data) -> "numeric envir arg not of length one " ???
...l fit the data well. summary(tl) and summary(tlo) seem reasonable. As do plots such as: plot(predict(tl),df$flow) plot(predict(tlo),df$flow) I want to replace missing values of df$flow from df$flow1: > p <- is.na(df$flow) > df$flow[p] <- predict(tl,df$flow1[p]) Error in eval(expr, envir, enclos) : numeric envir arg not of length one ??? > df$flow[p]<- predict(tlo,df$flow1[p]) This loess prediction works however. Could someone explain the linear model's "numeric envir arg not of length one" error for me? Thanks in advance ... Bruce L. ________________________...
2006 Feb 27
1
help with step()
...oing a forward variable selection using step() First, I fit an initial model: fit0 <- glm ( est~1 , data=all, subset=c(n>=25) ) then I invoke step(): fit1 <- step( fit0 , scope=list(upper=est~ pcped + pchosp + pfarm ,lower=est~1)) I get the error message: Error in eval(expr, envir, enclos) : invalid 'envir' argument I looked at the documention on step(). There is no 'envir' arguement. Can anyone shed light on what I'm doing wrong? Thanks, Phil Smith CDC [[alternative HTML version deleted]]
2013 Jun 24
0
sys.source() does not provide the parsing info to eval()
...hat the parsing information attached to expressions parsed by the parse() function when keep.source=TRUE is not provided to the eval() function. Please consider this code: path <- tempfile() code <- '(function() print( str( sys.calls() ) ))()' writeLines(code, path) sys.source(path, envir=globalenv(), keep.source=TRUE) > OUTPUT: Dotted pair list of 4 $ : language sys.source(path, envir = globalenv(), keep.source = TRUE) $ : language eval(i, envir) $ : language eval(expr, envir, enclos) $ : language (function() print(str(sys.calls())))() NULL then: eval(parse(text=code)) &gt...
2007 May 27
2
Question about "evalq"
The help page of eval says: The 'evalq' form is equivalent to 'eval(quote(expr), ...)'. But the following is not equivalent. Can anyone give me some explaination? Thanks very much. > f1 <- function(x,digits=5) lapply(x, f2) > f2 <- function(x) eval(quote(print(x+1,digits=digits)),list(x=x),parent.frame(2)) > f1(list(x1=1)) [1] 2 $x1 [1] 2 > > f1 <-
2008 Oct 18
3
Select only cases with negative values
Hello, I was wondering if there was a way to only select cases my from data frame that contained a negative value? > c<-c(1,2,3,4,5,6,7,8,9,10) > d<- c(-1,2,-3,-4,5,6,-7,8,-9,10) > f <- cbind(c,d) > dat <-data.frame(f) > dat.lm <-lm(c~d) If I wanted to only use the rows that had a negative value in column d for my regression, how could I make that selection?
2017 Jul 30
1
problem in run cmsaf script
...a in R. I run this script and have some error like this:Error in if (startdate < dates[1]) (dums <- 1) : missing value where TRUE/FALSE needed In addition: Warning messages: 1: running command 'tar.exe -tf "D:/CM SAF/ORD24552.tar"' had status 2 2: In eval(ei, envir) : NAs introduced by coercion 3: In eval(ei, envir) : NAs introduced by coercion 4: In eval(ei, envir) : NAs introduced by coercion 5: running command 'tar.exe -tf "D:/CM SAF/ORD24552.tar"' had status 2 6: In eval(ei, envir) : NAs introduced by coercion I dont know how t...
2010 Dec 08
1
Error in eval.with.vis(expr, envir, enclos) : subscript out of bounds
...R") This file runs through without any problems, so the program completes the loop one time. However, when the loop starts a second time and it comes time to call the file "estimation.R" again, program stops and prints the following error message: "Error in eval.with.vis(expr, envir, enclos) : subscript out of bounds" This happens every time I try to run the program. What could cause it? [[alternative HTML version deleted]]
2017 Sep 21
1
Add wrapper to Shiny in R package
Thank you Thierry. I'm trying to following your suggestion in the example below, but getting: Error in get("xs", envir = my.env) : object 'my.env' not found. library(shiny) library(shinydashboard) myApp <- function(x, ...) { xs <- scale(x) my.env <- new.env() assign("xs", xs, envir = my.env) shiny::runApp(app) } app = shinyApp( ui = fluidPage( sidebarLayout( s...