I have a table4 with 25 columns and I do want to subset this table for 7 values in column Job..R to get 7 individual tables.
for(i in 1:7) {
x = NULL
x = list(1 == "14047/2", 2 == "18331/3", 3 == "18331/4", 4 == "24889/3",
5 == "24889/4", 6 == "24889/5", 7 == "24889/9")
View(i)
a = subset(table4, Job..R == x[i])
b = mean(a[ ,13])
View(a)
View(b)
save(b, file="i.Rda") #ideally save .Rda file with used Job..R
}
I created a for loop from 1 to 7 and a list with names 1 to 7 and to each name I have assigned a value from column Job..R I want to subset to.
At the moment this loop does 7 loops (that is what I want) and creates me 7 tables with the 25 columns including headers but without content. How can I get the content into the new tables?
And how can I save the new tables with a specific file name for each table. Ideally the specific file name is the number from column Job..R I used to subset with.
Many thanks in advance!!
Johannes