[R] readRDS problem

Duncan Murdoch murdoch.duncan at gmail.com
Wed Feb 24 13:00:14 CET 2016


On 24/02/2016 4:26 AM, Sigbert Klinke wrote:
> Hi,
>
> I have two scripts, one creates a data structure (a list of data frames
> + some attributes) and saves it via saveRDS.
>
> The second script reads the RDS file (outside of any function) and
>
> data <- readRDS (name)
>
> works, but
>
> data <<- readRDS (name)
>
> creates the error
>
> Error: cannot change value of locked binding for 'data'
>
> Any idea what goes wrong?

"data <<-" looks for an existing object named data in a parent 
environment and changes it.  But the existing object is in the utils 
namespace, and you're not allowed to change things there.

Duncan Murdoch



More information about the R-help mailing list