search for: nacesample

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

Did you mean: micesample
2012 Jul 22
2
R Beginner : Loop and adding row to dataframe
...c 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 i should use something to add rows, but I really don&...