Displaying 3 results from an estimated 3 matches for "my_vector".
Did you mean:
mc_vector
2004 Dec 13
2
lists within a list / data-structure problem
Dear all,
this is a rather basic question; i am not sure how to structure my data
well:
I want to extraxt various measures from my raw-data. These measures are
of different sizes, so I decided to store them in a list, like:
run1 <- list(Dom = (my_vector), mean = (my_single_number))
I can do that in a for loop for 40 runs, ending up with 40 lists: run1,
run2, ..., run40.
To have all the measurements neatly together I thought of making another
list, containing 40 sub-lists:
> ALL <- list(run1, run2,..., run40)
> ALL
[[1]]
[[1]]$Dom
[1]...
2011 Aug 24
3
Efficient way to Calculate the squared distances for a set of vectors to a fixed vector
I am pretty new to R. So this may be an easy question for most of you.
?
I would like to calculate the squared distances of a large set (let's say 20000) of vectors (let's say dimension of 5) to a fixed vector.
?
Say I have a data frame MY_VECTORS with 20000 rows and 5 columns, and one 5x1 vector y. I would like to efficiently calculate the squared distances?between each of the 20000 vectors in MY_VECTORS and y.
?
The squared distance between two vectors x and y can be calculated:
distance <- crossprod(x-y)
?
Without looping, what is?the...
2004 Jul 28
3
Best way to store negative indexes
Hi,
I'm trying to figure out how to properly construct a graph of
frequencies of a difference between 2 values, that is | i | - | j |.
I'd like to know the best way to store the actual data because of course
doing my_vector[i -j] will not work because the index could be negative.
I know there's no hash table so what's the best solution,
simplicity-wise ? Use a list of pair of values {index, i - j} ? Or can I
somehow use negative index, perhaps using 0array ? Any help would be
appreciated :)
ATM, I use as....