I was trying out this code. I want to print the first six values of both the dataframes. But this isn't working. Where am I going wrong?
d1 = mtcars
d2 = Arthritis
d = list(d1,d2)
for(i in 1:2)
{
head(d[[i]])
}
I tried it without the for loop and it works. I mean if I put in head(d[[1]]) I get the first six values of mtcars. But with the loop it is not printing anything