Displaying 20 results from an estimated 78 matches for "akshay_e4".
2023 Jan 09
1
return value of {....}
...he evaluation of the function body early. However, if you
don't use return, R just returns the value from evaluating the function
body, and if your function body starts with {, it will return the last
expression from the function body, as desired.
On Mon, Jan 9, 2023, 12:15 akshay kulkarni <akshay_e4 at hotmail.com> wrote:
> Dear Valentin,
> But why should {....} "return" a value? It could
> just as well evaluate all the expressions and store the resulting objects
> in whatever environment the interpreter chooses, and then it would be left
>...
2023 Mar 19
1
lexical scoping for scripts......
Again, the answer is "interactivity does not matter".
On March 19, 2023 12:54:28 PM PDT, akshay kulkarni <akshay_e4 at hotmail.com> wrote:
>Dear Jeff,
> I will not be running R command in the shell prompt. So there is no banner, no > prompt. Just running "myscript.R" from the shell prompt. or from crontab in Linux. I think you get the context.....
>
>thanking you,
>...
2023 Jan 13
1
return value of {....}
...y <- x**2
> }
>
> And we'd need to do something like:
>
> f(10)
> y <- somehow_get_last_env_of_f$y
>
> So having a compound statement evaluate to a value clearly has a benefit.
>
> Best Regards,
> Valentin
>
> 09.01.2023 18:05:58 akshay kulkarni <akshay_e4 at hotmail.com>:
>
> > Dear Valentin,
> > But why should {....} "return" a value? It
> could just as well evaluate all the expressions and store the resulting
> objects in whatever environment the interpreter chooses, and then it would
>...
2023 Apr 04
1
on lexical scoping....
...g it right!?
>
> Thanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
> ------------------------------------------------------------------------
> *From:* Duncan Murdoch <murdoch.duncan at gmail.com>
> *Sent:* Tuesday, April 4, 2023 8:21 PM
> *To:* akshay kulkarni <akshay_e4 at hotmail.com>; Deepayan Sarkar
> <deepayan.sarkar at gmail.com>
> *Cc:* R help Mailing list <r-help at r-project.org>
> *Subject:* Re: [R] on lexical scoping....
> You can't change the basic way R searches, but you can ask for a
> different kind of search.? For...
2023 Mar 19
1
lexical scoping for scripts......
...n Linux. I think you get the context.....
thanking you,
yours sincerely
AKSHAY M KULKARNI
________________________________
From: Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
Sent: Monday, March 20, 2023 1:01 AM
To: r-help at r-project.org <r-help at r-project.org>; akshay kulkarni <akshay_e4 at hotmail.com>; Duncan Murdoch <murdoch.duncan at gmail.com>; R help Mailing list <r-help at r-project.org>
Subject: Re: [R] lexical scoping for scripts......
What do _you_ mean when you use the term "interactive"? Because R distinguishes between executing code in a funct...
2023 Apr 04
1
on lexical scoping....
...ply...!
So the takeaway is that define the symbol in the same environment before using it right!?
Thanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Duncan Murdoch <murdoch.duncan at gmail.com>
Sent: Tuesday, April 4, 2023 8:21 PM
To: akshay kulkarni <akshay_e4 at hotmail.com>; Deepayan Sarkar <deepayan.sarkar at gmail.com>
Cc: R help Mailing list <r-help at r-project.org>
Subject: Re: [R] on lexical scoping....
You can't change the basic way R searches, but you can ask for a
different kind of search. For example, to see if "x&qu...
2023 Apr 04
1
on lexical scoping....
...from one of the loaded packages? any packages for that?
>
> THanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
> ________________________________
> From: Deepayan Sarkar <deepayan.sarkar at gmail.com>
> Sent: Tuesday, April 4, 2023 7:51 PM
> To: akshay kulkarni <akshay_e4 at hotmail.com>
> Cc: R help Mailing list <r-help at r-project.org>
> Subject: Re: [R] on lexical scoping....
>
>
>
> On Tue, Apr 4, 2023 at 7:26?PM akshay kulkarni <akshay_e4 at hotmail.com<mailto:akshay_e4 at hotmail.com>> wrote:
> Dear Members,
>...
2023 Jan 12
4
return value of {....}
...ould look like this:
f <- function(n) {
x <- runif(n)
y <- x**2
}
And we'd need to do something like:
f(10)
y <- somehow_get_last_env_of_f$y
So having a compound statement evaluate to a value clearly has a benefit.
Best Regards,
Valentin
09.01.2023 18:05:58 akshay kulkarni <akshay_e4 at hotmail.com>:
> Dear Valentin,
> ? ? ? ? ? ? ? ? ? ? ? ? ? But why should {....} "return" a value? It could just as well evaluate all the expressions and store the resulting objects in whatever environment the interpreter chooses, and then it would be left to the user to mani...
2023 Apr 04
1
on lexical scoping....
...global environment but takes on a value from one of the loaded packages? any packages for that?
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Deepayan Sarkar <deepayan.sarkar at gmail.com>
Sent: Tuesday, April 4, 2023 7:51 PM
To: akshay kulkarni <akshay_e4 at hotmail.com>
Cc: R help Mailing list <r-help at r-project.org>
Subject: Re: [R] on lexical scoping....
On Tue, Apr 4, 2023 at 7:26?PM akshay kulkarni <akshay_e4 at hotmail.com<mailto:akshay_e4 at hotmail.com>> wrote:
Dear Members,
I have the f...
2023 Apr 09
1
extracting pdf tables...
...e first row is getting parsed as the column name. How do you make that the first row of IDT[[4]]?
Thanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
Sent: Monday, April 10, 2023 12:27 AM
To: akshay kulkarni <akshay_e4 at hotmail.com>; r-help at r-project.org <r-help at r-project.org>
Subject: Re: [R] extracting pdf tables...
Your code used cbind. My first answer was appropriate for rbind.
So you still need to figure out how to deal with the different columns in the tables, which requires more knowledg...
2023 Jan 10
1
return value of {....}
...can return multiple things, if you wish, in other ways.
Such as making a list:
vals <- list(1+2, sin(.7), cos(.7))
> vals[2:3]
[[1]]
[1] 0.6442177
[[2]]
[1] 0.7648422
You get the idea. R returns ONE thing and it ca have parts, named or not.
From: akshay kulkarni <akshay_e4 at hotmail.com>
Sent: Tuesday, January 10, 2023 9:33 AM
To: avi.e.gross at gmail.com
Cc: 'R help Mailing list' <r-help at r-project.org>
Subject: Re: [R] return value of {....}
Dear Avi,
Thanks for your reply...your exhortations are indeed
justified...! But o...
2023 Mar 19
1
lexical scoping for scripts......
...o you... how do you save them now? (Depending on auto-saving to .Rdata files is not a good idea in any case, but if you choose to use save() to specific filename.Rdata files works the same whether you type it interactively or use R CMD BATCH.
On March 19, 2023 11:55:37 AM PDT, akshay kulkarni <akshay_e4 at hotmail.com> wrote:
>Dear Duncun,
> What if there is no interactive "session" running? I will be running my scripts automatically from crontab in Linux.
>
>THanking you,
>Yours sincerely,
>AKSHAY M KULKARNI
>
>_________________________...
2023 Jan 09
3
return value of {....}
...e team might,I suppose, have a definite reason for"returning" the last value. Any comments?
Thanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Valentin Petzel <valentin at petzel.at>
Sent: Monday, January 9, 2023 9:18 PM
To: akshay kulkarni <akshay_e4 at hotmail.com>
Cc: R help Mailing list <r-help at r-project.org>
Subject: Re: [R] return value of {....}
Hello Akshai,
I think you are confusing {...} with local({...}). This one will evaluate the expression in a separate environment, returning the last expression.
{...} simply evaluat...
2023 Apr 12
1
converting to date object...
lubridate::dmy("12 APR 2023")
On Wed, Apr 12, 2023 at 5:34?PM akshay kulkarni <akshay_e4 at hotmail.com>
wrote:
> dear members,
> I want to convert "12 APR 2023" into a Date
> object. I tried as_Date() from lubridate, but it is not working:
>
> > as_date("12 APR 2023")
> [1] NA
> Warning message:
> All forma...
2023 Mar 19
2
lexical scoping for scripts......
...e "session" running? I will be running my scripts automatically from crontab in Linux.
THanking you,
Yours sincerely,
AKSHAY M KULKARNI
________________________________
From: Duncan Murdoch <murdoch.duncan at gmail.com>
Sent: Monday, March 20, 2023 12:20 AM
To: akshay kulkarni <akshay_e4 at hotmail.com>; R help Mailing list <r-help at r-project.org>
Subject: Re: [R] lexical scoping for scripts......
On 19/03/2023 2:33 p.m., akshay kulkarni wrote:
> Dear Duncun,
> thanks for the reply....
>
> So when I run a script in the system comman...
2023 Apr 12
1
converting to date object...
...n then use format() to alter the output format as you may need for other purposes, in which case, the formatted output is coerced back to a character vector, even though the internal storage is still a Date class object.
Regards,
Marc Schwartz
On April 12, 2023 at 10:34:26 AM, akshay kulkarni (akshay_e4 at hotmail.com (mailto:akshay_e4 at hotmail.com)) wrote:
> dear members,
> I want to convert "12 APR 2023" into a Date object. I tried as_Date() from lubridate, but it is not working:
>
> > as_date("12 APR 2023")
> [1] NA
> Warning message:
> All formats...
2023 Apr 05
1
on lexical scoping....
...ding of this
error message reminds us:
> utils::y
Error: 'y' is not an exported object from 'namespace:utils'
So when package/namespace goes onto the environment stack,
it's only the *exported* bindings that become visible.
On Wed, 5 Apr 2023 at 01:56, akshay kulkarni <akshay_e4 at hotmail.com> wrote:
> Dear Members,
> I have the following code typed at the
> console prompt:
>
> y <- x*10
>
> X has not been defined and the above code throws an object not found
> error. That is, the global environment does not...
2023 Mar 19
1
lexical scoping for scripts......
...doch
>
> THanking you,
> Yours sincerely,
> AKSHAY M KULKARNI
>
> ------------------------------------------------------------------------
> *From:* Duncan Murdoch <murdoch.duncan at gmail.com>
> *Sent:* Monday, March 20, 2023 12:20 AM
> *To:* akshay kulkarni <akshay_e4 at hotmail.com>; R help Mailing list
> <r-help at r-project.org>
> *Subject:* Re: [R] lexical scoping for scripts......
> On 19/03/2023 2:33 p.m., akshay kulkarni wrote:
>> Dear Duncun,
>>? ? ? ? ? ? ? ? ? ? ? ? ? ?thanks for the reply....
>>
>> So when I...
2023 Jan 11
1
return value of {....}
...39;s what curly braces are FOR.
When you want some expressions evaluated in a
specific order, that's why and when you use curly
braces. If that's not what you want, don't use them.
Complaining about it is like complaining that + adds.
On Tue, 10 Jan 2023 at 03:47, akshay kulkarni <akshay_e4 at hotmail.com> wrote:
> Dear members,
> I have the following code:
>
> > TB <- {x <- 3;y <- 5}
> > TB
> [1] 5
>
> It is consistent with the documentation: For {, the result of the last
> expression evaluated. This has the v...
2023 Jan 09
2
return value of {....}
...re are of course many available
references on the internet.
I believe your mental model for how R works is flawed, and you have some
homework to do to correct it. I may be wrong, naturally, but you can judge
by looking at some tutorials.
-- Bert
On Mon, Jan 9, 2023 at 6:47 AM akshay kulkarni <akshay_e4 at hotmail.com>
wrote:
> Dear members,
> I have the following code:
>
> > TB <- {x <- 3;y <- 5}
> > TB
> [1] 5
>
> It is consistent with the documentation: For {, the result of the last
> expression evaluated. This has the v...