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
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
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
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,
> THan
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() cache
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,
Actually, I am replacing a big for loop by the lapply()
function, and report the progress:
lapply(TP, function(i) { B
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
y,
> AKSHAY 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:
>
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(i)})
>
> C
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
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:
>
>
À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 outpu
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
1] 4
>
> [[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
> Se
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))})
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
[
AKSHAY 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>&g
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
Subjec
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]]
> [1]
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 output x along with x^2, i.e not at the
beginning but b
20 matches
Mail list logo