Displaying 1 result from an estimated 1 matches for "median_cotautx".
2010 Jan 29
1
create an R object in a loop
...ow
select <- file[file$SPECSHOR==spec & file$BONE==bone, ]
#Separate the data from each numeric variable in seq.num (select[,k])
into groups from levels in select[cat] and store into list mode.
for(i in 1:length(seq.num)) {
k <- seq.num[i]
name.num <- names(file)[k]
TO_POS_Asfc.median_cotautx <- fac2list(select[,k], select[cat])
names(TO_POS_Asfc.median_cotautx) <- levels(factor(select[[cat]]))
}
-----
What I want to do is, instead of giving manually the name of the list
(here TO_POS_Asfc.median_cotautx), I would like the name of the list to
be created in the loop too, so tha...