SHARE
TWEET

Untitled

a guest Jun 25th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(here)
  2. library(readr)
  3. library(stringr)
  4.  
  5. file_survey <- here("my_survey_2019.rds")
  6.  
  7. my_read_rds <- function(file){
  8.   name <- deparse(substitute(file))
  9.   name <- stringr::str_remove(name, "^file_")
  10.   eval(name) <- readr::read_rds(file) # Does not work
  11. }
  12.  
  13. my_read_rds(file_survey) # would ideally create a dataframe named `survey`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top