Follow

all right, how do I access a dataset from a package, but programmatically? I am trying to write a function with input ans, where ans[1] is the name of the package, and ans[2] is the name of the dataset in that package.

The obvious data(ans[2], package = ans[1]) fails with
Warning in data(ans[2], package = ans[1]) : data set ‘ans[2]’ not found
and even if it worked, I'd have an object in my environment whose name is the text stored in ans[2], and I'd then have to get at this.

· Edited · · Phanpy · 5 · 1 · 2