Re: [R] print and lapply....

2022-11-08 Thread akshay kulkarni
Dear Rui, THanks a lot! THanking you, Yours sincerely AKSHAY M KULKARNI From: Rui Barradas Sent: Tuesday, November 8, 2022 8:51 PM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply �s 14:47 de 08/11/2022, akshay

Re: [R] print and lapply....

2022-11-08 Thread Rui Barradas
you insinuated in your reply? THanking you, yours sincerely, AKSHAY M KULKARNI From: Rui Barradas Sent: Tuesday, November 8, 2022 2:20 AM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply Às 19:22 de 07/11/2022, akshay kulkarni

Re: [R] print and lapply....

2022-11-08 Thread akshay kulkarni
Gunter ; Andrew Simmons Cc: R help Mailing list Subject: RE: [R] print and lapply Dear Akshay, I think we have provided several solutions to the question asked. Can you please adjust your question to more closely align with what you need. It would be nice if you can provide sufficient

Re: [R] print and lapply....

2022-11-08 Thread akshay kulkarni
sincerely, AKSHAY M KULKARNI From: Rui Barradas Sent: Tuesday, November 8, 2022 2:20 AM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply �s 19:22 de 07/11/2022, akshay kulkarni escreveu: > Dear Rui, >

Re: [R] print and lapply....

2022-11-08 Thread akshay kulkarni
Dear Bert, Amazing! Very informative...THanks a lot. From: Bert Gunter Sent: Tuesday, November 8, 2022 2:15 AM To: akshay kulkarni Cc: Rui Barradas ; R help Mailing list Subject: Re: [R] print and lapply " The lapply() c

Re: [R] print and lapply....

2022-11-07 Thread Rui Barradas
:24 AM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply Às 18:33 de 07/11/2022, akshay kulkarni escreveu: Dear Rui, Actually, I am replacing a big for loop by the lapply() function, and report the progress: lapply(TP, function(i) { BODY; print

Re: [R] print and lapply....

2022-11-07 Thread Ebert,Timothy Aaron
not quite addressed this problem. Tim -Original Message- From: R-help On Behalf Of akshay kulkarni Sent: Monday, November 7, 2022 1:10 PM To: Bert Gunter ; Andrew Simmons Cc: R help Mailing list Subject: Re: [R] print and lapply [External Email] Dear Bert, Actually, I

Re: [R] print and lapply....

2022-11-07 Thread Bert Gunter
M KULKARNI > ____________ > From: Rui Barradas > Sent: Tuesday, November 8, 2022 12:24 AM > To: akshay kulkarni ; R help Mailing list > > Subject: Re: [R] print and lapply > > Às 18:33 de 07/11/2022, akshay kulkarni escreveu: > > Dear Rui,

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
ist Subject: Re: [R] print and lapply �s 18:33 de 07/11/2022, akshay kulkarni escreveu: > Dear Rui, > Actually, I am replacing a big for loop by the lapply() > function, and report the progress: > > lapply(TP, function(i) { BODY; print(i)}) > > Can you ple

Re: [R] print and lapply....

2022-11-07 Thread Rui Barradas
sincerely, AKSHAY M KULKARNI From: Rui Barradas Sent: Monday, November 7, 2022 11:59 PM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply Às 17:17 de 07/11/2022, akshay kulkarni escreveu: Dear members, I have

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
From: Rui Barradas Sent: Monday, November 7, 2022 11:59 PM To: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply �s 17:17 de 07/11/2022, akshay kulkarni escreveu: > Dear members, > I have the following code and output: > >

Re: [R] print and lapply....

2022-11-07 Thread Rui Barradas
Às 17:17 de 07/11/2022, akshay kulkarni escreveu: Dear members, I have the following code and output: TP <- 1:4 lapply(TP,function(x){print(x);x^2}) [1] 1 [1] 2 [1] 3 [1] 4 [[1]] [1] 1 [[2]] [1] 4 [[3]] [1] 9 [[4]] [1] 16 How do I make the print function

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
From: Bert Gunter Sent: Monday, November 7, 2022 11:16 PM To: Andrew Simmons Cc: akshay kulkarni ; R help Mailing list Subject: Re: [R] print and lapply Well... yes, of course. But assuming the sole purpose is to print the results and not to save them for further processing, the OP's

Re: [R] print and lapply....

2022-11-07 Thread Andrew Simmons
> > [[3]] > [1] 9 > > [[4]] > [1] 16 > > Basically, lapply() is implemented by a for loop. So there must be some way > right? > > tHanking you, > Yours sincerely, > AKSHAY M KULKARNI > > From: Andrew Simmons > Sent: Mo

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
From: Ebert,Timothy Aaron Sent: Monday, November 7, 2022 11:07 PM To: Andrew Simmons ; akshay kulkarni Cc: R help Mailing list Subject: RE: [R] print and lapply Another option is use paste() within print() lapply(TP,function(x){print(paste("x= ",x, " x^2 = ", x^2))})

Re: [R] print and lapply....

2022-11-07 Thread Bert Gunter
Well... yes, of course. But assuming the sole purpose is to print the results and not to save them for further processing, the OP's approach seems rather painful. My preference would be to vectorize: > print(cbind(TP, TPsq =TP^2), print.gap = 3) TP TPsq [1,]1 1 [2,]2 4

Re: [R] print and lapply....

2022-11-07 Thread akshay kulkarni
Y M KULKARNI From: Andrew Simmons Sent: Monday, November 7, 2022 10:50 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] print and lapply put print() around x^2 On Mon, Nov 7, 2022, 12:18 akshay kulkarni mailto:akshay...@hotmail.com>> wr

Re: [R] print and lapply....

2022-11-07 Thread Ebert,Timothy Aaron
Another option is use paste() within print() lapply(TP,function(x){print(paste("x= ",x, " x^2 = ", x^2))}) Tim -Original Message- From: R-help On Behalf Of Andrew Simmons Sent: Monday, November 7, 2022 12:21 PM To: akshay kulkarni Cc: R help Mailing list Su

Re: [R] print and lapply....

2022-11-07 Thread Andrew Simmons
put print() around x^2 On Mon, Nov 7, 2022, 12:18 akshay kulkarni wrote: > Dear members, > I have the following code and output: > > > TP <- 1:4 > > lapply(TP,function(x){print(x);x^2}) > [1] 1 > [1] 2 > [1] 3 > [1] 4 > [[1]] > [1] 1 > > [[2]] > [1] 4 > > [[3]] >