Solve the save() function in R language to save the collection of objects – & GT; The Art of R programming, P195
>ls()
[1] "j" "joe" "k" "o" "print.employee" "z"
> z<-rnorm(100000)
> hz<-hist(z)
> save(hz,"hzfile.RData")
Error in save(hz, "hzfile.RData") : The target object 'hzfile.Rdata' does not exist.
> save(hz,"hzfile")
Error in save(hz, "hzfile") : The target 'hzfile' does not exist.
> save(hz,file="hzfile.RData")
> ls()
[1] "hz" "j" "joe" "k" "o" "print.employee" "z"
> rm(hz)
> ls()
[1] "j" "joe" "k" "o" "print.employee" "z"
> load("hzfile")
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file 'hzfile', probable reason 'No such file or directory'
> load("hzfile.RData")
> ls()
[1] "hz" "j" "joe" "k" "o" "print.employee" "z"
As shown below:
When you use save(), you use the “file” parameter, and the suffix of the file is “.rdata “. If you use load(), the suffix of the file is “.rdata”
Read More:
- Trivia: How does R language solve Error in ts(x):’ts’ object must have one or more observations
- R language notes – sample() function
- R language-Error in file(out, “wt”): Unable to open the link problem solved
- R language error:‘ namespace:lazyeval There is no exit_ The object is eval
- Analysis of R language error replacement has length zero problem
- Installing R’s “mvtnorm” package in Windows system: solving the problem of the R package “mvtnorm” is not installed
- Edit the file to be edited by GEDIT. After saving, the warning set document metadata failed: setting attribute metadata:: GEDIT position no appears
- Edit the file to be edited by gedit. After saving, a warning of Set document metadata failed: Setting attribute metadata::gedit-position no appears
- The solution of “error in NLS loop more than 50” in R language
- VirtualBox problem solving set -[drm:vmw_host_log [vmwgfx]] *ERROR* Failed to send host log message
- Solving the problem of joi. Validate is not a function
- Call to undefined function oci_ Connect() problem solving
- Renaming the column name of data frame in R language
- Usage and examples of three important functions of tidyr package in R language: gather, spread and separate
- R language error in hist.default ():’x’must be a value
- R language error in match.names (clabs, names(xi)) :
- Keras saves save() and save in the model_ weights()
- Error analysis of multiple linear regression in R language model.frame.default
- R language – path setting and working directory modification
- In R language, for loop or array truncation, the following error occurs only 0’s may be mixed with negative subscripts