I want to read the data in the following url into R but I couldn't do it. Does anyone have any idea about it?? Thanks! http://web.stanford.edu/~hastie/ElemStatLearn/ I need the data Ozone
Asked
Active
Viewed 81 times
1 Answers
0
The data is hosted at http://web.stanford.edu/~hastie/ElemStatLearn/datasets/ozone.data
The values are tab-separated, so you can read it using read_tsv
from the readr package:
library(readr)
read_tsv("http://web.stanford.edu/~hastie/ElemStatLearn/datasets/ozone.data")
This will read the data directly from the website, so you won't need to download it manually yourself.
![](../../users/profiles/13157536.webp)
RyanFrost
- 1,201
- 5
- 14
-
Thanks! But somehow when i tried to load the readr package, it gave me Error: package or namespace load failed for ‘readr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): namespace ‘rlang’ 0.4.2 is already loaded, but >= 0.4.5 is required error message. But I couldn't update the package. Do you know why? – crazystats Apr 25 '20 at 18:22
-
Did you already try installing/updating the package with `install.packages("readr")`? – RyanFrost Apr 25 '20 at 18:29
-
-
-
I installed rlang and tried to do library(readr) again but it gave me this error message:Error: package or namespace load failed for ‘readr’ in loadNamespace(j – crazystats Apr 25 '20 at 18:54
-
there is no package called ‘cli’............what is cli.....I didn't call a package called cli – crazystats Apr 25 '20 at 18:54
-
readr uses the package 'cli'. One more thing to try: `remove.packages("readr")`, then `install.packages("readr", dependencies = TRUE)` – RyanFrost Apr 25 '20 at 20:59
-
-
You're welcome! Please consider accepting the answer (click the check mark) if it fixed your issue. Thanks! – RyanFrost Apr 25 '20 at 22:37