Comments (15)
Thanks for the example. It works on my computer. I wonder if this is related to #22.
Can you try clim <- readDWD(file, fread=FALSE)
?
from rdwd.
I think I have a solution. Could you run updateRdwd()
to have version 1.4.1 (2020-08-24) and then run the following two examples?
readDWD(file) # should run fine now with message "Reading file with readDWD.data() and fread=FALSE"
readDWD(file, fread=T) # should give warning [1] and then the error as before
Lastly, if you'd want to take the time, could you install Rtools (directly at C:/Rtools since compiler paths may not have spaces, as there would be with C:/Program Files/R/Rtools/) and see if both examples work fine? That would settle issue #22 for me.
Don't feel pressured, though, I don't want to be a burden on your time. I appreciate you pointing out this issue regardless :).
[1] system command 'unzip' could not be found. Expect trouble with data.table::fread.
from rdwd.
Could you post a reproducible example?
from rdwd.
Hi ! Here it is:
I used the example similar to the one in the docs:
link <- selectDWD(id = "150", res="daily", var="kl", per="recent")
file <- dataDWD(link, read=FALSE)
clim <- readDWD(file, varnames=FALSE)
The console response:
dataDWD -> dirDWD: adding to directory '.../DWDdata'
dataDWD -> newFilename: creating 1 file:
'.../DWDdata/daily_kl_recent_tageswerte_KL_00150_akt.zip'
Reading file with readDWD.data().
'unzip' is not recognized as an internal or external command,
operable program or batch file.
'(unzip -p .../DWDdata/daily_kl_recent_tageswerte_KL_00150_akt.zip produkt_klima_tag_20190221_20200819_00150.txt) > ...\AppData\Local\Temp\RtmpSYVSSB\file43042d986b3c' execution failed with error code 1File '...\AppData\Local\Temp\RtmpSYVSSB\file43042d986b3c' has size 0. Returning a NULL data.frame.File contains no rows: .../DWDdata/daily_kl_recent_tageswerte_KL_00150_akt.zip
from rdwd.
Perfect, it worked! Now I see it was NA by default.
from rdwd.
Could you try a few things so I can maybe find out where this comes from?
Do you get the same error for the last line here?
fp <- unzip(file, list=TRUE) # file produkt*, the actual datafile
fp <- fp$Name[grepl("produkt",fp$Name)]
dat <- data.table::fread(cmd=paste("unzip -p", file, fp), na.strings=berryFunctions::na9(nspace=0),
header=TRUE, sep=";", stringsAsFactors=TRUE, data.table=FALSE)
And for the following?
dat <- data.table::fread(cmd=paste("unzip -p", file, fp), header=TRUE, sep=";")
from rdwd.
Same error for both:
unzip' is not recognized as an internal or external command,
operable program or batch file.
from rdwd.
Seems like unzip is only available if you have e.g. a git shell (source). I'll see if I can find an alternative online...
from rdwd.
Yes, like many commands, only working from the shell. Thanks a lot for you help and work!
from rdwd.
What output do you get with the following?
system("unzip", show.output.on.console=FALSE)
Sys.which("unzip") # gives me c:\\Rtools\\bin\\unzip.exe
I'm considering keeping the default for fread as NA but not only checking for data.table but also for the unzip command...
from rdwd.
Hi, I tried both, the second one still with the same warning and error.
Rtools are now directly in C: drive and I restarted everything.
But since the readDWD works it's great! Thank you.
from rdwd.
Thanks so much for checking!
One last question, for clarity: with Rtools installed and R restarted, does it still not work with fread=T? Does it find Sys.which("unzip")
?
from rdwd.
The Sys.which("unzip")
just gives this output:
unzip ""
As for the fread=T, still the same.
from rdwd.
Maybe Rtools was not added to the path. Well, it was worth a try. If you're happy with how it works, so am I.
Thank you so much for trying some things out!
from rdwd.
I just had the same problem on my laptop.
It was easy to solve by adding rtools40 to the PATH. I now have instructions for that online:
https://bookdown.org/brry/rdwd/fread.html
from rdwd.
Related Issues (20)
- readDwd is creating error in a windows pc HOT 3
- website in documentations
- doc references
- add use case: values at locations in grid
- grib2 reading fails HOT 8
- Several links to ftp://opendata.dwd.de in documentation fail HOT 2
- air_temperature history hourly data link is not working. HOT 2
- local test dir
- metaInfo() - start/end date HOT 7
- expand per="hr" to all options HOT 1
- the 'wininet' method for ftp:// URLs is defunct HOT 3
- reduce index size HOT 9
- properly vectorize selectDWD in expansive mode HOT 10
- hr argument
- Please remove dependencies on **rgdal**, **rgeos**, and/or **maptools** HOT 2
- website update
- use https HOT 3
- Update behaviour of dataDWD
- Downloads of historic data fails HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdwd.