search for: trinace

Displaying 1 result from an estimated 1 matches for "trinace".

Did you mean: trace
2012 Jul 22
2
R Beginner : Loop and adding row to dataframe
...listA Name NACE a 1 b 2 c 3 ListB NACE aaa bbb ccc 1 a a c 1 a a c 1 a a c 2 a a c 2 a a c 3 a a c 4 a a c 4 a a c 4 a a c The output i would like to have NACE aaa bbb ccc 1 a a c 1 a a c 1 a a c 2 a a c 2 a a c 3 a a c Code: listpeer <- function (x) { for (i in 1:length(listA$NACE)) TriNACE[i] <- subset.data.frame(ListB, NACE == NACEsample$NACE[i],) TriNACE } But the result is Warning message: In `[<-.data.frame`(`*tmp*`, i, value = list(NACE = c(3L, 3L, 3L : provided xx variables to replace x variables" I guess there is something wrong "TriNACE[i]", instead...