Displaying 20 results from an estimated 119 matches for "oldclass".
2010 Feb 25
1
error in lmLists in lme4 package (bug?)
...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 found
Error in uni...
2005 Aug 06
1
oldClass vs. class
Hi,When I read the source of str,i find these code
-----
## Show further classes // Assume that they do NOT have an own Method --
## not quite perfect ! (.Class = 'remaining classes', starting with current)
cl <- oldClass(object); cl <- cl[cl != "data.frame"] #- not THIS class
-----
so I use ?oldClass to try to learn more about oldClass.But after I have reading all the help page ,I still have no idea the diiference between oldClass and class.
Anynone can help me ?
2005-08-06
------
Deparment of Soc...
2017 Nov 29
2
binary form of is() contradicts its unary form
Hi,
The unary forms of is() and extends() report that data.frame
extends list, oldClass, and vector:
> is(data.frame())
[1] "data.frame" "list" "oldClass" "vector"
> extends("data.frame")
[1] "data.frame" "list" "oldClass" "vector"
However, the binary form of...
2008 Jun 05
1
is() and S3 classes
The is() function begins with the following code:
cl <- class(object)
if (length(cl) > 1) {
if (is.na(match(cl[[1]], names(getClass("oldClass")@subclasses))))
return(class2 %in% cl)
As one can see, it uses S3 inheritance if the first element of the class
attribute is an "oldClass". In R prior to 2.7, is() would check S4
inheritance if any (not just the first) classes named in the class attribute
were derived f...
2006 Dec 12
1
strings as factors
...eed to have a data.frame with
a character id variable. however, I am surprised why this seems to be so
hard. In fact I was unable to succeed. Here is what I tried:
>test1 <-expand.grid(ID = 1:2, sex = c("male","female"))
>is(test1[,2])
[1] "factor" "oldClass"
>test2 <-expand.grid(ID = 1:2, sex = c('male','female'))
>is(test2[,2])
[1] "factor" "oldClass"
>test3 <-expand.grid(ID = 1:2, sex = I(c("male","female")))
>is(test3[,2])
[1] "factor" "oldClass"...
2017 Nov 29
2
binary form of is() contradicts its unary form
...;
> Best,
> Mehmet
>
>
>
>
>
> On 29 Nov 2017 19:13, "Herv? Pag?s" <hpages at fredhutch.org
> <mailto:hpages at fredhutch.org>> wrote:
>
> Hi,
>
> The unary forms of is() and extends() report that data.frame
> extends list, oldClass, and vector:
>
> > is(data.frame())
> [1] "data.frame" "list" "oldClass" "vector"
>
> > extends("data.frame")
> [1] "data.frame" "list" "oldClass" &quo...
2024 Jul 14
2
xftrm is more than 100x slower for AsIs than for character vectors
...ank 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' as the only class (making
static int equal(...) take the slower branch). What's going to break if
we allow removing the class attribute altogeth...
2008 Jul 01
1
[.data.frame speedup
...))
return(as.matrix(x)[i])
y <- NextMethod("[")
cols <- names(y)
if (!is.null(cols) && any(is.na(cols)))
stop("undefined columns selected")
if (any(duplicated(cols)))
names(y) <- make.unique(cols)
return(structure(y, class = oldClass(x),
row.names = .row_names_info(x, 0L)))
}
if (missing(i)) {
if (missing(j) && drop && length(x) == 1L)
return(.subset2(x, 1L))
y <- if (missing(j))
x
else .subset(x, j)
if (drop && length(y) == 1L)
return(.subset...
2002 Sep 13
1
design package (plot problems)
...logis(L), 1, 0)
$
$ ddist <- datadist(age, blood.pressure, cholesterol, sex)
$ options(datadist='ddist')
$
$ fit <- lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)),x=T, y=T)
$
$ par(mfrow=c(2,2))
$ plot(fit) # Plot effects of all 4 predictors
Error in "oldClass<-"(*tmp*, value = "keep") :
attempt to set an attribute on NULL
$ par(mfrow=c(1,2))
$ plot(fit, name=c('age','cholesterol')) # Make 2 plots
Error in "oldClass<-"(*tmp*, value = "keep") :
attempt to set an attribute on NULL...
2017 Nov 29
0
binary form of is() contradicts its unary form
...data.frame())
[1] "data.frame"
> is(data.frame(), "data.frame")
[1] TRUE
Best,
Mehmet
On 29 Nov 2017 19:13, "Herv? Pag?s" <hpages at fredhutch.org> wrote:
> Hi,
>
> The unary forms of is() and extends() report that data.frame
> extends list, oldClass, and vector:
>
> > is(data.frame())
> [1] "data.frame" "list" "oldClass" "vector"
>
> > extends("data.frame")
> [1] "data.frame" "list" "oldClass" "vector"
>...
2006 Oct 09
0
dispatch on functions (was: Re: ifelse(logical, function1, function2) does not work)
...> "+.function" <- function(x, y) function(z) x(z) + y(z)
> > sin+cos
> Error in sin + cos : non-numeric argument to binary operator
> > "+.function"(sin, cos)
> function(z) x(z) + y(z)
> <environment: 0x01c4ae7c>
I think that's because
> oldClass(sin)
NULL
?S3groupGeneric says:
Note that a method will used for either one of these groups or one
of its members _only_ if it corresponds to a '"class"' attribute,
as the internal code dispatches on 'oldClass' and not on 'class'.
This is for...
2013 Feb 27
0
How to specify ff object filepaths when reading a CSV file into a ff data frame.
...>>>>>>>>>>>>>>>>>> patching >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
xi <- x[[i]]
AsIs <- inherits(xi, "AsIs")
if (AsIs) {
oldClass(xi) <- oldClass(xi)[-match("AsIs", oldClass(xi))]
ret <- do.call("as.ff", c(list(xi, vmode = vmodes[[i]]),
col_args))
oldClass(ret) <- c("AsIs", oldClass(ret))
ret
}
else {
do.call("as.ff", c(list(xi, vmode = vmodes[[i...
2009 Oct 19
2
how to get rid of 2 for-loops and optimize runtime
...tor 0.44 0.3 2.34 1.8
.subset2 0.38 0.3 0.38 0.3
attr 0.36 0.3 0.36 0.3
is.character 0.28 0.2 0.28 0.2
is.null 0.28 0.2 0.28 0.2
| 0.26 0.2 0.26 0.2
oldClass<- 0.20 0.2 0.20 0.2
is.atomic 0.16 0.1 0.16 0.1
nzchar 0.10 0.1 0.10 0.1
is.numeric 0.06 0.0 0.06 0.0
oldClass 0.06 0.0 0.06 0.0
( 0.04 0.0 0.04 0.0...
2017 Nov 29
0
binary form of is() contradicts its unary form
...gt;
>>
>>
>> On 29 Nov 2017 19:13, "Herv? Pag?s" <hpages at fredhutch.org
>> <mailto:hpages at fredhutch.org>> wrote:
>>
>> Hi,
>>
>> The unary forms of is() and extends() report that data.frame
>> extends list, oldClass, and vector:
>>
>> > is(data.frame())
>> [1] "data.frame" "list" "oldClass" "vector"
>>
>> > extends("data.frame")
>> [1] "data.frame" "list" &qu...
2020 Oct 30
1
[External] Re: Change to I() in R 4.1
...d from the main issue
>> and can be dealt with later.
>
> 1b. A variant of the above could be to use the old implementation for S4
> objects only:
>
> I <- function(x)
> {
> if (isS4(x)) {
> structure(x, class = unique.default(c("AsIs", oldClass(x))))
> } else {
> `class<-`(x, unique.default(c("AsIs", oldClass(x))))
> }
> }
>
> That is probably a good compromise for now.
Not really. The underlying problem is that class<- and attributes<-
(which is what structure() uses) handle t...
2020 Oct 30
2
Change to I() in R 4.1
...nal?
>>
>> 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 o...
2006 May 01
1
code for latex function in Hmisc
Forgive my ignorance, but how I can take a look at the code for the
latex function in the Hmisc library?
I tried just typing "latex" but all I got was this:
> latex
function (object, title = first.word(deparse(substitute(object))),
...)
{
if (!length(oldClass(object)))
oldClass(object) <- data.class(object)
UseMethod("latex")
}
What should I do?
Thanks,
BQ
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 breaks 17 Bioconduct...
2017 Nov 29
2
binary form of is() contradicts its unary form
...gt; On 29 Nov 2017 19:13, "Herv? Pag?s" <hpages at fredhutch.org
>>> <mailto:hpages at fredhutch.org>> wrote:
>>>
>>> Hi,
>>>
>>> The unary forms of is() and extends() report that data.frame
>>> extends list, oldClass, and vector:
>>>
>>> > is(data.frame())
>>> [1] "data.frame" "list" "oldClass" "vector"
>>>
>>> > extends("data.frame")
>>> [1] "data.frame"...
1999 Mar 10
2
.Alias and memory
In an effort to encapsulate my dependence on class in order to deal with
oldclass/class in Splus I defined the functions
tfclass <- class
"tfclass<-" <- function(x, value){ class(x) <- value ; x }
and also the function
classed <- function(x, cls) {class(x) <- cls; x}
This last allows me to end a function definition with
...
classed(...