jean997 / cause

R package for CAUSE
https://jean997.github.io/cause/
52 stars 15 forks source link

readRDS error #15

Closed Carlos-Chau closed 3 years ago

Carlos-Chau commented 3 years ago

Hi, all RDS files in your tutorial failed to be read by my R-4.0.3 nor R-3.6.3 Would you mind sharing the data structure of top_vars please? Thanks

dir.create("example_data")
download.file("https://github.com/jean997/cause/blob/master/example_data/top_ldl_pruned_vars.RDS", destfile = "example_data/top_ldl_pruned_vars.RDS")

top_vars <- readRDS("example_data/top_ldl_pruned_vars.RDS")
# Error in readRDS("example_data/top_ldl_pruned_vars.RDS") : 
#  unknown input format
Carlos-Chau commented 3 years ago

Solved by:

  1. git clone this repo
  2. open the cause.Rproj from repo
  3. Read the RDS file of the repo (as opposed to direct download instructed in the tutorial
jean997 commented 3 years ago

You can solve this issue without cloning the repo by replacing "blob" in your url with "raw" eg

download.file("https://github.com/jean997/cause/raw/master/example_data/top_ldl_pruned_vars.RDS", destfile = "example_data/top_ldl_pruned_vars.RDS")