Re: [R] apply

2024-10-04 Thread Rui Barradas via R-help
Hello, You don't need apply, covariance calculations are so frequent that R or any other statistics package already has pre-programmed functions. This time with two vectors x and y. set.seed(123) n <- 3 x <- rnorm(n) y <- rnorm(n) # the two main diagonal values var(x) #> [1] 1.300025 var(y)

Re: [R] New line in caption with math symbols embedded in expression (paste(

2021-02-18 Thread Rui Barradas via R-help
Hello, First of all the plotmath in your code doesn't need paste, expression alone will do it. I am not sure that the following is what you want. I create the caption beforehand, in order to make the plotting code simpler. The asterisks/tildes make less/more space between the text line's ele