On Tue, 24 Jan 2023 17:16:44 -0500
Andrew Simmons wrote:
> I tried this again with R 2.15.3, the oldest version I have installed,
> and I still got the same behaviour. It extracts the first exact match,
> then the only partial match, then NULL.
Thanks for that.
I am *sure* that I had problems
I tried this again with R 2.15.3, the oldest version I have installed,
and I still got the same behaviour. It extracts the first exact match,
then the only partial match, then NULL.
On Tue, Jan 24, 2023 at 5:04 PM Rolf Turner wrote:
>
>
> Has something changed, but I missed it?
>
> My recollectio
junk$y extracts the element named "y" because it found an exact match for
the name.
junk$yu extracts nothing because it does not find an exact match and finds
multiple partial matches.
junk$yuc or junk$yur would work because it finds no exact match and then
exactly one partial match.
On Tue, Jan
Has something changed, but I missed it?
My recollection is that $ extraction used partial matching.
E.g. if one did
junk <- list(yuck=1,yurk=2,y=3)
junk$y
then one would get 1 as the result; probably *not* the desired result.
See fortunes::fortune("toad").
To get the desired result,
There is a modifyList function in pkg utils that is used extensively in
the code for lattice graphics:
var$options <- modifyList(var$options, list( misc=list(abc = "123"),
mi= list(something = 13))
)
#---
> var
$options
$optio
?identical
?rapply might also be useful to get more granular diagnostics. (??)
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, May 27, 2020 at 1:13 PM Joh
Awesome thanks.
On Wed, May 27, 2020 at 1:31 PM William Dunlap wrote:
> all.equal()
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
>
> On Wed, May 27, 2020 at 1:13 PM John Harrold
> wrote:
>
>> Thankyou Bert and Bill.
>>
>> I have one last question. Is there a tool that will recursively
all.equal()
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, May 27, 2020 at 1:13 PM John Harrold
wrote:
> Thankyou Bert and Bill.
>
> I have one last question. Is there a tool that will recursively compare
> two lists to find differences in both their structure and contents?
>
> I'm afrai
Thankyou Bert and Bill.
I have one last question. Is there a tool that will recursively compare two
lists to find differences in both their structure and contents?
I'm afraid that in the process of converting code from $ to [[]] formats I
may inadvertently introduce some errors. And I'd like to Q
Hmmm... yes. I read (past tense) that passage as meaning that **when
extracting** partial matching is only done with $. I did not read it as
also saying that with assignment, partial matching with $ is not done, but
I see how you could. As Bill D.'s example showed, even R seems confused
about how
Hello Bert,
I've read the documentation and I didn't think it applied here. Perhaps
it's my reading of that documentation I'm confused by. I stays *only when
extracting*. What I'm doing here is assigning values. Is the expected
behavior really to create a copy of the "misc" element in "mi" and the
Another symptom of this problem is:
> {x <- list(Abc=list(Pqr="Old Abc$Pqr")); x$Ab$Pqr <- "New Ab$Pqr" ; x}
R version 3.6.2 (2019-12-12) | R version 4.0.0 (2020-04-24)
List of 2| List of 2
$ Abc:List of 1 | $ Abc:List of 1
..$ Pqr: chr "Old Abc$Pqr" | ..$ Pqr
I can't answer your question (about your R programming skills) but the
behavior you complain about is as documented. In particular:
"Thus the default behaviour is to use partial matching only when extracting
from recursive objects (except environments) by $. Even in that case,
warnings can be swit
Hello,
I'm testing some code in R 4.0, and I'm having an issue with the following"
# -
rm(list=ls())
graphics.off()
#load("/tmp/post.RData")
var = list();
# If I uncomment this it fixes things:
# var$options = list(mi = list(),
#misc = list())
#
var$options$misc
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 16/03/12 15:05, Sarah Goslee wrote:
>>> It's also a really good reason to use [[ in functions or anywhere there
>>> might be a chance
>>> of confusion.
>>
>> Absolutely - I think I have to change my habit. I always prefered using $ as
>> it seeme
Sarah Goslee gmail.com> writes:
>
> R: lots of ways to do the same thing, but some of them are booby-trapped.
Fortune candidate!
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http
>> It's also a really good reason to use [[ in functions or anywhere there
>> might be a chance of
>> confusion.
>
> Absolutely - I think I have to change my habit. I always prefered using $ as
> it seemed to me more
> logical.
I started out that way because it's shorter and nicer-looking code,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 16/03/12 14:54, Sarah Goslee wrote:
> Hi Rainer,
>
> On Fri, Mar 16, 2012 at 9:45 AM, Rainer M Krug wrote:
>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
>>
>> Hi
>>
>> I have the following code:
>>
>> x <- data.frame(x1=1, x2=2, y1=3) x$y [1
Hi Rainer,
On Fri, Mar 16, 2012 at 9:45 AM, Rainer M Krug wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi
>
> I have the following code:
>
> x <- data.frame(x1=1, x2=2, y1=3)
> x$y
> [1] 3
> x$x
> NULL
>
> I was surprised (and definitely irritated?) when I realised that partia
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi
I have the following code:
x <- data.frame(x1=1, x2=2, y1=3)
x$y
[1] 3
x$x
NULL
I was surprised (and definitely irritated?) when I realised that partial
matching also works for
the $. Is this intended?
I assume the reason is that $ is in
On Sat, Jun 4, 2011 at 6:44 PM, Abraham Mathew wrote:
> Let's say that I have a string and I want to know if a single word
> is present in the string. I've written the following function to see if
> the word "Geico" is mentioned in the string "Cheap Geico car insurance".
> However, it doesn't work
Let's say that I have a string and I want to know if a single word
is present in the string. I've written the following function to see if
the word "Geico" is mentioned in the string "Cheap Geico car insurance".
However, it doesn't work, and I assume it has something to do with the any()
function.
Try
grep( "\\.x$", c("a.x" ,"b.x","a.xx"),value=TRUE)
The $ means end-of-line (while ^ means start-of-line). And special
characters like dot needs to be escaped twice.
Regards, Adai
Vito Muggeo (UniPa) wrote:
dear all,
This is a probably a silly question.
If I type
> grep("x",c("a.x"
Is this what you want: depends on it occurring at the endo of the string:
> grep("\\.x[^x]*$",c("a.x" ,"b.x","a.xx"),value=TRUE)
[1] "a.x" "b.x"
On Mon, Nov 2, 2009 at 9:57 AM, Vito Muggeo (UniPa)
wrote:
> dear all,
> This is a probably a silly question.
> If I type
>> grep("x",c("a.x" ,"b.x",
On Nov 2, 2009, at 9:57 AM, Vito Muggeo (UniPa) wrote:
dear all,
This is a probably a silly question.
If I type
> grep("x",c("a.x" ,"b.x","a.xx"),value=TRUE)
[1] "a.x" "b.x" "a.xx"
> grep("\\.x\\b",c("a.x" ,"b.x","a.xx"),value=TRUE)
[1] "a.x" "b.x"
Or:
> grep("\\.x$",c("a.x" ,"b.x","a.xx")
dear all,
This is a probably a silly question.
If I type
> grep("x",c("a.x" ,"b.x","a.xx"),value=TRUE)
[1] "a.x" "b.x" "a.xx"
Instead, I would like to obtain only
"a.x" "b.x"
How is it possible to get this result with grep()?
many thanks for your attention,
best,
vito
--
On Sun, 5 Oct 2008, roger koenker wrote:
I'm writing a new predict method and would like to be able to pass an
argument
called "se" via the "..." mechanism. However, predict has a "se.fit"
argument that
But it doesn't! Some of its methods such as predict.lm and predict.glm
do. So without
I'm writing a new predict method and would like to be able to pass an
argument
called "se" via the "..." mechanism. However, predict has a "se.fit"
argument that
wants to interpret my specification of "se" as a partially matched
version of se.fit.
Surely there a standard treatment for this
28 matches
Mail list logo