search for: y24

Displaying 3 results from an estimated 3 matches for "y24".

Did you mean: 24
2024 Feb 29
1
[EXT] Initializing vector and matrices
Hello Eik: Thanks. I do not need to sample. Essentially, I have a do loop which produces 24 vectors of length of some length (say k=300) and 24 matrices of 300x300. Then, I simply need to? take the averages of these 24 vectors and matrices: x=(x1+x2+...+x24)/k y=(y1+y2+...+y24)/k I am just looking for ways to do this in a do loop, which requires initialization (to 0's) of x and y. My struggle is not knowning length of x until x1 is produced in the first of the loop. Thanks. Steven On 2/28/2024 6:22 PM, Eik Vettorazzi wrote: > Hi Steven, > It's not enti...
2024 Feb 28
1
[EXT] Initializing vector and matrices
Hi Steven, It's not entirely clear what you actually want to achieve in the end. As soon as you "know" x1, and assuming that the different "xi" do not differ in length in the real application, you know the length of the target vector. Instead of the loop, you can use 'Reduce' without having to initialize a starting vector. # generate sample vectors, put them in
2000 Aug 14
5
Writing a workable function
After searching in R- Introduction, FAQ, help... I don't understand this: I write a function in a file (.R): tt <- function(mc) { date() mc<-read.csv2("machines.txt",na.strings="") date() } I source it in R and I type tt(). The answer is > tt() [1] "Mon Aug 14 11:18:25 2000" > The instructions following the first "date()" are ignored. Why?