0

ATL is a group of number 1,2,3,4 that I want to chart for various subjects

When I run the below, the output I get when I call up elements of ATLdata is: "< table of extent 0 >"

ATLdata <- list()

for(subject in Subjects){
    ATL <- paste(subject, ".ATL.Y8.Data.Point.8.1", sep="")
    ATLdata[[subject]] <- table(df$ATL)
 }

However, when I add it outside a loop as below, it works fine

ATLdata$Technology <- table(df$Technology.ATL.Y8.Data.Point.8.1)
ATLdata$Technology

What do I need to do to be able to get this to work inside the loop?

Luqman
  • 1
  • 1
  • 1
    What does `Subjects` look like? Preferably, share the output of `dput(Subjects)`. – A. Stam Dec 13 '17 at 13:02
  • Not `table(df$ATL)` This doesn't work. Use `table(df[[ATL]])`. Also `paste(subject, ".ATL.Y8.Data.Point.8.1", sep="")` could be `paste0(subject, ".ATL.Y8.Data.Point.8.1")`. – lmo Dec 13 '17 at 13:02

0 Answers0