search for: asis

Displaying 20 results from an estimated 575 matches for "asis".

Did you mean: apis
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?cl...
2019 Nov 18
2
Inappropriate class(o)[!inherits(o,"AsIs")] in get_all_vars
...Mon, 18 Nov 2019 12:15:38 +0100 writes: >>>>> suharto anggono--- via R-devel >>>>> on Sun, 17 Nov 2019 10:34:31 +0000 writes: >> 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...
2010 Feb 25
1
error in lmLists in lme4 package (bug?)
...lme4_0.999375-32 Matrix_0.999375-31 lattice_0.17-26 loaded via a namespace (and not attached): [1] grid_2.10.0 tools_2.10.0 > fm1Orth.lis<-lmList(distance~age|Subject, data=Orthodont) > fm2Orth.lis<-lmList(distance~I(age-11)|Subject, data=Orthodont) Error in unique(c("AsIs", oldClass(x))) : object 'age' not found Error in unique(c("AsIs", oldClass(x))) : object 'age' not found Error in unique(c("AsIs", oldClass(x))) : object 'age' not found Error in unique(c("AsIs", oldClass(x))) : object 'age' not fo...
2020 Mar 29
2
is.vector could handle AsIs class better
Dear R-devel, AsIs class seems to be well handled by `typeof` and `mode` function. Those two functions are being referred when explaining `is.vector` behaviour in manual. Yet `is.vector` does not seem to be handling AsIs class the same way. is.vector(1L) #[1] TRUE is.vector(I(1L)) #[1] FALSE Is there any reason beh...
2002 May 29
1
warning message for setAs when using class AsIs
This seemed too advanced for r-help and is related to the recent discussion of character vectors in dataframes. Following Brian Ripley's most excellent advice, we are moving to a world in which character vectors in dataframes are always of class AsIs. The cool way of doing this seemed to be the following: > cat(c("x", "y", "z"), file = "test.txt", sep = "\n") > x <- read.table("test.txt") > class(x$V1) [1] "factor" This is what we expect. > library(methods)...
2024 Jul 14
2
xftrm is more than 100x slower for AsIs than for character vectors
...>, is.na and extraction methods for classed > objects, possibly rather slowly. " The problem is indeed that the vector reaches base::rank in both cases, but since it has a class, the function has to construct and evaluate a call to .gt every time it wants to compare two elements. xtfrm.AsIs even tries to remove the 'AsIs' class before continuing the method dispatch process: >> if (length(cl <- class(x)) > 1) oldClass(x) <- cl[-1L] It doesn't work in the (very contrived) case when 'AsIs' is not the first class and it doesn't remove 'AsIs'...
2024 Jul 12
1
xftrm is more than 100x slower for AsIs than for character vectors
Good evening, I recently have observed slow merges when combining multiple data frames derived from DataFrame and base::data.frame. I observed that the index column of intermediate tables was of class <AsIs> (automatically converted from character). The problem occurred mainly when using the sorted = T option in base::merge. This can be traced to xtfrm.AsIs being more than 100 times slower than the comparable function for character vectors. x = paste0("A_", 1:1e5) system.time({o <- x...
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:...
2020 Mar 30
1
is.vector could handle AsIs class better
Thank you Gabriel, Agree, although I think that could be relaxed in this single case and AsIs class could be ignored. Best, Jan On Sun, Mar 29, 2020 at 7:09 PM Gabriel Becker <gabembecker at gmail.com> wrote: > > Jan, > > I believe it's because it has "a non-NULL attribute other than names" as per the documentation. In this case its class of "AsIs"...
2012 Mar 06
1
sourcearg function is there a better way already built into R
Hi list: I work with a lot of laboratory analytical data and I often have inconsistent names of files and variables within those files so I wrote this sourcearg function to facilitate handling file and variable names as both character and R names. The source of the function is given below sourcearg=function(arg){ su=sprintf("%s\n",arg) sink("TMPTMPRarg")
2002 May 20
0
No documentation for class AsIs (PR#1582)
There is no documentation for class AsIs, that is ?AsIs gives you nothing. Relatedly, there is no discussion of the use of I() to create objects of class AsIs on the help page for I(). This means that it is hard to find information in the help pages about the following usage. > test <- data.frame(x = I(letters[1:3])) > test x...
2020 Oct 30
2
Change to I() in R 4.1
...vel intentional? >> >> library(Matrix) >> m <- as(matrix(c(0, 1)), "sparseMatrix") >> >> isS4(m) >> # [1] TRUE >> >> x <- I(m) >> # Warning message: >> # In `class<-`(x, unique.default(c("AsIs", oldClass(x)))) : >> # Setting class(x) to multiple strings ("AsIs", "dgCMatrix", ...); >> result will no longer be an S4 object >> >> isS4(x) >> # [1] FALSE >> >> This works fine in R 4.0.3 i.e. no warning and I() do...
2010 Jan 26
2
hdf files
hello, I have a problem to open an hdf file. i have downloaded the package 'hdf5' as it was advised on R seek. But when i try to load the file, the R console sends me an eror message: setwd("C:/Documents and Settings/Karine/Bureau/data/") #install.packages('hdf5') library("hdf5") sea_ice <- hdf5load("asi-s6250-20090704-v5i.hdf", load =
2020 Oct 23
2
Change to I() in R 4.1
Hi there, Is that change in R-devel intentional? library(Matrix) m <- as(matrix(c(0, 1)), "sparseMatrix") isS4(m) # [1] TRUE x <- I(m) # Warning message: # In `class<-`(x, unique.default(c("AsIs", oldClass(x)))) : # Setting class(x) to multiple strings ("AsIs", "dgCMatrix", ...); result will no longer be an S4 object isS4(x) # [1] FALSE This works fine in R 4.0.3 i.e. no warning and I() doesn't turn off the S4 bit of the object. This change brea...
2005 Mar 17
1
Binding one column of characters into a dataframe factors other numeric columns
...f numeric vectors and one character vector that I want to bind into a data frame. When I include the character vector as a column in the data frame, all the numeric columns get factored in the data frame, which makes it tough to call those columns for calculations later on. I've tried using AsIs to prevent this, but without luck...in the examples below, the object named "c" is the one that is the character column. The others are numeric. df_without_char <- data.frame(cbind(rl, gl, cp), row.names = rownames(r)) #without char vector df_without_char <- data.frame(cbind(rl...
2010 Jan 16
1
order() fails on a chr object of class "AsIs" with "\265" in it
...tmpv <- c('\265g/L','Bq/L') > order(tmpv) [1] 2 1 > tmpv <- I(tmpv) > order(tmpv) Error in if (xi > xj) 1L else -1L : missing value where TRUE/FALSE needed > foov <- gsub('\265','',tmpv) > order(foov) [1] 2 1 > str(tmpv) Class 'AsIs' chr [1:2] "\265g/L" "Bq/L" > str(foov) Class 'AsIs' chr [1:2] "g/L" "Bq/L" I can easily work around this in my scripts, but shouldn't order() succeed with such an object? (I suppose this could be Mac-specific, but I'm assuming it&...
2006 Mar 15
5
Surv object in data.frame
...event) ## Cox-regression coxph(survobj~group) # this works ## put Surv object in data.frame df.test <- data.frame(survobj=I(survobj), group) ## Cox-regression on data.frame coxph(survobj~group, data=df.test) # this does not work attr(df.test$survobj, 'class') # survobject has class "AsIs", "Surv" attr(df.test$survobj, 'class') <- c('Surv', 'AsIs') # put Surv first attr(df.test$survobj, 'class') # survobject has class "Surv", "AsIs" coxph(survobj~group, data=df.test) # now it works
2012 Jan 23
3
How can I access information stored after I run a command in R?
Dear all, Supposed I run the following command: ############################### #install.packages("Rassoc", dependencies=TRUE) library("Rassoc") ca=c(139,249,112) co=c(136,244,120) a=rbind(ca,co) MAX3(a,"asy",1) ############################## I get: The MAX3 test using the asy method data: a statistic = 0.5993, p-value = 0.7933 How can one save the result
2008 May 19
0
as.POSIX{ct,lt} fail on class "AsIs"
...SIXlt\"", deparse(substitute(x)))) 5: as.POSIXlt.default(x, tz, ...) 4: as.POSIXlt(x, tz, ...) 3: as.POSIXct(as.POSIXlt(x, tz, ...), tz, ...) 2: as.POSIXct.default(I("2008-01-01")) 1: as.POSIXct(I("2008-01-01")) > class( I('2008-01-01') ) [1] "AsIs" > is.character( I('2008-01-01') ) [1] TRUE It looks to me as though as.POSIXlt() does not recognize the object as being also a character object because it calls as.POSIXlt.default() instead of as.POSIXlt.character(). > sessionInfo() R version 2.7.0 (2008-04-22) powerpc-app...
2000 Sep 21
1
"[.data.frame" forgets about "AsIs" (PR#665)
Short example: > str(d <- data.frame(a = I(letters[1:5]))) `data.frame': 5 obs. of 1 variable: $ a:Class 'AsIs' chr [1:5] "a" "b" "c" "d" ... > str(d[TRUE,,drop = FALSE]) `data.frame': 5 obs. of 1 variable: $ a: chr "a" "b" "c" "d" ... The real problem about this is, that as soon as the data.frame is further &...