Avi,
Please do not mistake my posting as being a BASHING of R. I greatly admire R
and the progress it has made from its roots in S. I thank the may people who
contribute to the development and growth of R.
Just because a language allows a given syntax does not mean (1) that the
language is ba
Again, John, we are comparing different designs in languages that are often
decades old and partially retrofitted selectively over the years.
Is it poor form to use global variables? Many think so. Discussions have
been had on how to use variables hidden in various ways that are not global,
such a
Richard,
I appreciate your observations. As regularly noted, there are many possible
forks in the road to designing a language and it seems someone is determined
to try every possible fork.
Yes, some languages that are compiled, or like JavaScript, read the entire
function before executing it and
Sorry, John. If I understand you correctly, R has no "Global
Variables" in the sense that you seem to indicate. It does have a
"Global environment", but variables referred to in a function but not
found in the function environment are *not* necessarily searched for
in the "Global Environment" -- th
Richard,
I sent my prior email too quickly:
A slight addition to your code shows an important aspect of R, local vs. global
variables:
x <- 137
f <- function () {
a <- x
x <- 42
b <- x
list(a=a, b=b)
}
f()
print(x)
When run the program produces the following:
>
Well, weirdness is in the eyes of the beholder, I think.
In any case, R's scoping procedures are described in ?environment and
?assign and ?function, among other places; and in detail in the R
Language Definition. So no matter the behavior, as long as it is
clearly documented -- and consistent of
Richard,
A slight addition to your code shows an important aspect of R, local vs. global
variables:
x <- 137
f <- function () {
a <- x
x <- 42
b <- x
list(a=a, b=b)
}
f()
print(x)
From: R-help on behalf of Richard O'Keefe
I wonder if the real confusino is not R's scope rules?
(begin .) is not Lisp, it's Scheme (a major Lisp dialect),
and in Scheme, (begin (define x ...) (define y ...) ...)
declares variables x and y that are local to the (begin ...)
form, just like Algol 68. That's weirdness 1. Javascript
had a si
Às 16:54 de 15/01/2023, Sorkin, John escreveu:
I am new to this thread. At the risk of presenting something that has been shown before,
below I demonstrate how a column in a data frame can be dropped using a wild card, i.e. a
column whose name starts with "th" using nothing more than base r fun
John,
As you said, you are new to the discussion so let me catch you up.
The original question was about removing many columns that shared a similar
feature in the naming convention while leaving other columns in-place. Quite a
few replies were given on how to do that including how to use a reg
I am new to this thread. At the risk of presenting something that has been
shown before, below I demonstrate how a column in a data frame can be dropped
using a wild card, i.e. a column whose name starts with "th" using nothing more
than base r functions and base R syntax. While additions to R s
Dear valentin,
Thanks for a comprehensive background
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
From: Valentin Petzel
Sent: Friday, January 13, 2023 4:48 AM
To: akshay kulkarni
Cc: R help Mailing list
Subject: Re: [R] return v
Dear Bill,
Thanks for your reply.
thanking you,
Yours sincerely,
AKSHAY M KULKARNI
From: Bill Dunlap
Sent: Friday, January 13, 2023 10:48 PM
To: Valentin Petzel
Cc: akshay kulkarni ; R help Mailing list
Subject: Re: [R] return value of {...
dear Heinz,
Thanks for your replyreason is as old as the Sun..!
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
From: R-help on behalf of Heinz Tuechler
Sent: Friday, January 13, 2023 4:30 PM
To: r-help@r-project.org
Subject: Re: [R] r
Dear leonard,
I think Avi's repsonse was best...it's just a
design...as he said, there are other possibilities in other programming
languages which augments this design...thanks anyways for your reply...
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
__
Hello Avi,
while something like d$something <- ... may seem like you're directly modifying
the data it does not actually do so. Most R objects try to be immutable, that
is, the object may not change after creation. This guarantees that if you have
a binding for same object the object won't chan
16 matches
Mail list logo