Displaying 1 result from an estimated 1 matches for "listpeer".
Did you mean:
listener
2012 Jul 22
2
R Beginner : Loop and adding row to dataframe
...implified version of what I am doing but it's enough to
help me
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&quo...