[R] converting a character string to an object name

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Fri Mar 29 18:54:36 CET 2019


On Fri, 29 Mar 2019 14:07:16 +0100
Assa Yeroslaviz <frymor using gmail.com> wrote:

> Is there a way to read for each sheet the name from names(wb) and
> convert it to a name for the object?

See `get` and `assign` functions for a way to use strings as object
names. Generally, it might not be a good idea to do that (what if your
spreadsheet contains a sheet named `c` or `q`, or `data.frame`?).

If you want to save yourself some typing, consider using `with` or
`within`, though they suffer from similar problems.

-- 
Best regards,
Ivan



More information about the R-help mailing list