Dear Jesse,
You can use a "list" to do what you want:
# Data
mylist1=list(x=1:5,y=rnorm(10),z=letters[1:15])
mylist2=list(x=1:15,y=rnorm(5),z=letters[1:5])
# Length of each object in mylist1
l1=sapply(mylist1,length)
# The same for mylist2
l2=sapply(mylist2,length)
# Ratio
l1/l2
x y
On 17/09/2008, at 7:48 AM, j daniel wrote:
Greetings,
I need to compare the ratios of vector sizes like this:
length(object1) / length(object2)
I have many vector objects to compare, so I would like to do it in
a loop.
I created a loop like this:
mat1 <- matrix()
for (i in 1:6)
{
f
Greetings,
I need to compare the ratios of vector sizes like this:
length(object1) / length(object2)
I have many vector objects to compare, so I would like to do it in a loop.
I created a loop like this:
mat1 <- matrix()
for (i in 1:6)
{
for (j in 1:6)
{
mat1[i,j] <-
3 matches
Mail list logo