Displaying 20 results from an estimated 10000 matches similar to: "is.vector could handle AsIs class better"
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".
>
2022 Oct 29
1
tools:: extracting pkg dependencies from DCF
Thank you Gabriel,
Just for future readers. Below is a base R way to address this common
problem, as instructed by you (+stopifnot to suppress print).
Rscript -e 'stopifnot(file.copy("DESCRIPTION",
file.path(tdir<-tempdir(), "PACKAGES")));
db<-available.packages(paste0("file://", tdir));
2019 Dec 19
1
head/tail breaking change
Thank you Gabriel,
I agree that new behaviour makes much more sense. Just wanted to confirm
before resolving compatibility of my unit tests.
Best,
Jan
On Wed 18 Dec, 2019, 10:46 PM Gabriel Becker, <gabembecker at gmail.com> wrote:
> Jan,
>
> That is an intentional change as you can see in the documentation for
> head/tail in R-devel. Last time I discussed it with Martin, this
2019 Dec 18
2
head/tail breaking change
Hi R-devel community,
I am aware of changes in R-devel in head/tail methods but I was not
expecting that to be a breaking change.
# R 3.6.1
ar = array(1:27, c(3,3,3))
tail(ar, 1)
#[1] 27
The current output of R-devel is something that I would expect from a
tail(ar, c(1, Inf, Inf))
or
tail(ar, c(1, NA, NA))
calls.
Is it going to stay like this or there are plans to mitigate this
breaking
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"
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
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
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",
2016 Jun 16
3
new function to tools/utils package: dependencies based on DESCRIPTION file
Dear Joris,
So it does looks like the proposed function makes a lot sense then, isn't it?
Cheers,
Jan
On 16 June 2016 at 08:37, Joris Meys <jorismeys at gmail.com> wrote:
> Dear Jan,
>
> It is unavoidable to have OS and R dependencies for devtools. The building
> process for packages is both OS and R dependent, so devtools has to be too
> according to my understanding.
2016 Nov 17
1
new function to tools/utils package: dependencies based on DESCRIPTION file
Hi Michael,
Are you willing to accept patch for this? I'm already using this and
few related functions for a while, it plays well. I could wrap it as
patch to utils, or tools?
Best,
Jan
On 16 June 2016 at 14:00, Michael Lawrence <lawrence.michael at gene.com> wrote:
> I agree that the utils package needs some improvements related to
> this, and hope to make them eventually. This
2016 Jun 14
5
new function to tools/utils package: dependencies based on DESCRIPTION file
Hi all,
Packages tools and utils have a lot of useful stuff for R developers.
I find one task still not as straightforward as it could. Simply to
extract dependencies of a package from DESCRIPTION file (before it is
even installed to library). This would be valuable in automation of CI
setup in a more meta-data driven way.
The simple function below, I know it is short and simple, but having
it to
2020 Jan 01
2
New R function is.nana = is.na & !is.nan
Hello R-devel,
Best wishes in the new year. I am writing to kindly request new R
function so NA_real_ can be more easily detected.
Currently if one wants to test for NA_real_ (but not NaN) then extra
work has to be done: `is.na(x) & !is.nan(x)`
Required functionality is already at C level so to address my request
there is not that much to do.
Kevin Ushey made a nice summary of current R C api
2010 Oct 06
3
Empty data frame does not maintain column type
Does anyone know why a data frame created with empty character columns
converts them to integer columns?
> df<-data.frame(a=character(0),b=character(0))
> df<-rbind(df,c("a","a"))
> typeof(df[1,1])
[1] "integer"
AsIs doesn't help:
> df<-data.frame(a=I(character(0)),b=I(character(0)))
> df<-rbind(df,I(c("a","a")))
2020 Jun 29
2
R-devel internal errors during check produce?
>>>>> Jan Gorecki writes:
> So the unique.default is from the R tools package during checks.
> I don't see those issues on CRAN checks.
I cannot reproduce this locally (and have no clues about docker).
Perhaps you can try to debug this on your end? And see what env_list is
when the error occurs?
Best
-k
> Exact environment where I am reproducing this issue is a
2020 Jan 02
1
New R function is.nana = is.na & !is.nan
"nana" is meant to express "NA, really NA".
Your suggestion sounds good.
On Thu 2 Jan, 2020, 3:38 AM Pages, Herve, <hpages at fredhutch.org> wrote:
> Happy New Year everybody!
>
> The name (is.nana) doesn't make much sense to me. Can you explain it?
>
> One alternative would be to add an extra argument (e.g. 'strict') to
> is.na(). FALSE by
2016 Nov 03
2
Running package tests and not stop on first fail
Hi Martin, Jan,
On 11/03/2016 03:45 AM, Martin Maechler wrote:
>>>>>> Jan Gorecki <J.Gorecki at wit.edu.pl>
>>>>>> on Tue, 1 Nov 2016 22:51:28 +0000 writes:
>
> > Hello community/devs, Is there an option to run package
> > tests during R CMD check and not stop on first error? I
> > know that testing frameworks (testhat
2016 Nov 04
4
Running package tests and not stop on first fail
>>>>> Jan Gorecki <J.Gorecki at wit.edu.pl>
>>>>> on Fri, 4 Nov 2016 11:20:37 +0000 writes:
> Martin, I submitted very simple patch on
> https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17176
> Herve, While I like your idea, I prefer to keep my patch
> simple, it is now exactly what Martin mentions. I think it
> is a
2020 Jun 29
2
R-devel internal errors during check produce?
Thank you both,
You are absolutely correct that example should be minimal, so here it is.
l = list(a=new.env(), b=new.env())
unique(l)
Just for completeness, env_list during check that raises error
env_list <- list(baseenv(),
as.environment("package:graphics"),
as.environment("package:stats"),
as.environment("package:utils"),