I\'ve created an object obs in the loop shown below and the loop returns obs. However when I try to print obs i get the message that obs is not found. I\'m new to programming R
Objects defined in a function are not available outside the function. If you return a value from a function, you must store the result somewhere. Try
obs <- complete("specdata", ID<-c(2,4,8,10,12))
print(obs)
This prevents you from having to know the name of variables inside function that you may not have written yourself.