[R] print and lapply....
    akshay kulkarni 
    @k@h@y_e4 @end|ng |rom hotm@||@com
       
    Mon Nov  7 18:17:30 CET 2022
    
    
  
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 before each of x^2?
Many thanks in advance....
THanking you,
Yours sincerely
AKSHAY M KULKARNI
	[[alternative HTML version deleted]]
    
    
More information about the R-help
mailing list