Displaying 20 results from an estimated 30000 matches similar to: "package `methods' has persistent effects even if detached (PR#1715)"
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".
>
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",
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.
2019 Nov 18
2
Inappropriate class(o)[!inherits(o,"AsIs")] in get_all_vars
>>>>> Martin Maechler
>>>>> on 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
2004 Oct 28
1
Another problem with next method
I have another problem with NextMethod. Not sure if its related
to the last problem.
In this example, we have a generic called ff with methods
for AsIs and test classes. We call the generic with an
object of AsIs class. The corresponding method adds 1 to it
and then changes the class to test followed by issuing a
NextMethod. However, that results in this error (using R
2.0.0, 2004-10-04
2024 Jul 14
2
xftrm is more than 100x slower for AsIs than for character vectors
? Fri, 12 Jul 2024 17:35:19 +0200
Hilmar Berger via R-devel <r-devel at r-project.org> ?????:
> This can be finally traced to base::rank() (called from
> xtfrm.default), where I found that
>
> "NB: rank is not itself generic but xtfrm is, and rank(xtfrm(x), ....)
> will have the desired result if there is a xtfrm method. Otherwise,
> rank will make use of ==, >,
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
2020 Oct 30
2
Change to I() in R 4.1
Hi Martin,
On 10/26/20 04:52, Martin Maechler wrote:
>>
>> 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,
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 behind this behaviour?
Could we have it supported so AsIs class is ignored when
2005 Mar 17
1
Binding one column of characters into a dataframe factors other numeric columns
Hi all,
I searched through the archives, but couldn't find a fix...
Basically, I've got a bunch of 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
2020 Oct 30
1
[External] Re: Change to I() in R 4.1
On Fri, 30 Oct 2020, Pages, Herve wrote:
>
> On 10/29/20 23:08, Pages, Herve wrote:
> ...
>>
>> I can think of 2 ways to move forward:
>>
>> 1. Keep I()'s current implementation but suppress the warning. We'll
>> make the necessary adjustments to DataFrame() to repair columns supplied
>> as I(<S4>) objects. Note that we would still be in
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
2009 Nov 02
1
two small wishes (with code sugegstions) for R-core
Dear R developers,
It would be great if you could implement the two minor code changes suggested below, which would help processing large objects in R.
Jens Oehlschl?gel
# Wish no. 1: let [.AsIs return the class AFTER subsetting, not the class of the original object
# Wish no. 2: adjust write.csv and write.csv2 for multiple calls in chunked writing
# Rationale no. 1: a couple of packages
2002 May 21
1
I() fails on objects of class POSIXct (PR#1587)
Although the documentation is somewhat sketchy, I() can be used to create
objects of class AsIs:
> I("a")
[1] "a"
attr(,"class")
[1] "AsIs" "character"
> I(4)
[1] 4
attr(,"class")
[1] "AsIs" "numeric"
> I(4 + 0i)
[1] 4+0i
attr(,"class")
[1] "AsIs" "complex"
>
This
2006 Mar 15
5
Surv object in data.frame
Dear All,
a Surv object I put in a data frame behaves somehow unexpected (see example).
If I do a Cox regression on the original Surv object it works. If I put it
in a data.frame and do the regression on the data frame it does not work.
Seemingly it has to do with the class attribute, because if I change the
class attribute to let "Surv" appeare first, again it works.
Is this known?
2010 Apr 22
2
R2.11.0 - rasterImage() and barplot fill-patterns
Hello Peter,
Thank you, and the R core team, for the new release.
I see that in R 2.11.0 there is now support for rendering of raster (bitmap)
images through rasterImage().
I am wondering - can this be used to create a texture/fill-pattern for
hist()/barplot() ?
(A request made several times throughout the years on the mailing list.
For example:
2007 Mar 16
3
corAR1 in a random effects panel
Hi everyone,
I am interested in estimating this type of random effects panel:
y_it = x'_it * beta + u_it + e_it
u_it = rho * u_it-1 + d_it rho belongs to (-1, 1)
where:
u and e are independent and normally zero-mean distributed.
d is also independently normally zero-mean distributed.
So, I want random effects for group i to be correlated in t, following an
AR(1) process.
I am
2016 Dec 20
3
Unexpected I(NULL) output
Hi all,
I believe there is an issue with passing NULL to the function I().
class(NULL) # "NULL" (as expected)
print(NULL) # NULL (as expected)
is.null(NULL) # TRUE (as expected)
According to the documentation I() should return a copy of its input
with class "AsIs" preprended:
class(I(NULL)) # "AsIs" (as expected)
print(I(NULL)) # list() (not expected!
2010 Jan 16
1
order() fails on a chr object of class "AsIs" with "\265" in it
Here's an example (session info at the end).
> 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"
2010 Mar 12
2
Data frame question
Hi,
I have the following question about creating data frames. I want to
create a data frame with 2 components: a vector and a matrix.
Let me use a simple example:
y <- rnorm(10)
x <- matrix(rnorm(150), nrow=10)
Now if I do
dd <- data.frame(x=x, y=y)
I get a data frame with 16 colums, but if, according to the documentation,
I do
dd <- data.frame(x=I(x), y=y)
then str(dd)