Re: [R] Converting .grib to excel file

2024-06-25 Thread javad bayat
Dear Bert and Sara; I have searched on the internet and found some way to do this like python. But python is so complicated to me as it needs many steps to be done for reading and converting it. I will try terra package to convert it. On Tue, 25 Jun 2024, 15:15 javad bayat, wrote: > Richard, >

Re: [R] Converting .grib to excel file

2024-06-25 Thread javad bayat
Richard, Many thanks for your email. I had attached the grib file to the original email to R help team but it seems you did not receive it. Unfortunately, I do not know how to reduce the volume or extract some of the grib file data to send it for you. The file has the volume of 6 Megabyte. I can se

Re: [R] Converting .grib to excel file

2024-06-25 Thread Sarah Goslee
Hi, While Bert is correct that there are plenty of tools, my preferred approach is to use the terra package to load a grib as a raster stack. >From there, it's straightforward to use all the spatial tools with the data, or to extract it in whatever form and with whatever dimensions you wish. GIv

Re: [R] "--" < 0

2024-06-25 Thread avi.e.gross
Unfortunately, Adrian, even trying to coerce a string like "--" to numeric just produces an NA and comparison fails: > as.numeric("--") < 0 [1] NA Warning message: NAs introduced by coercion The same is true of anything that is character as it cannot be coerced. > as.numeric("anything") < 0 [

Re: [R] Converting .grib to excel file

2024-06-25 Thread Bert Gunter
Do a web search on "convert grib data to csv". You will get many hits. You probably don't need R to do this. -- Bert On Tue, Jun 25, 2024 at 1:33 AM javad bayat wrote: > Dear all; > I have downloaded meteorology data from " > > https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5

Re: [R] Converting .grib to excel file

2024-06-25 Thread Richard O'Keefe
Your message referred to an attached file but there was no attachment, I have no account at that service, so could not download a sample for myself. Does the licence for the data even allow you to send some of it in a message? Which parameters are you extracting? When you say "it didn't work", w

Re: [R] "--" < 0

2024-06-25 Thread Adrian Dusa
Oh I see... It's not that "-7" gets coerced to numeric, but 0 gets coerced to "0". Of course... On Tue, Jun 25, 2024 at 11:02 AM Martin Maechler wrote: > > Adrian Dusa > > on Tue, 25 Jun 2024 10:56:07 +0300 writes: > > > Dear R fellows, > > >> From time to time, just when I t

Re: [R] "--" < 0

2024-06-25 Thread peter dalgaard
Also notice that > "+5" < 0 [1] TRUE > as.numeric("+5") < 0 [1] FALSE So the presumption is wrong. It is really about > sort(c(0:3, "+", "-")) [1] "-" "+" "0" "1" "2" "3" -pd > On 25 Jun 2024, at 10:02 , Martin Maechler wrote: > >> Adrian Dusa >>on Tue, 25 Jun 2024 10:56:07 +03

[R] Converting .grib to excel file

2024-06-25 Thread javad bayat
Dear all; I have downloaded meteorology data from " https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-single-levels?tab=form"; as .grib format. It has hourly data of a complete year (every hour of every day of 12 months) and has 6 meteorology parameters. The file has been attached.

Re: [R] "--" < 0

2024-06-25 Thread Martin Maechler
> Adrian Dusa > on Tue, 25 Jun 2024 10:56:07 +0300 writes: > Dear R fellows, >> From time to time, just when I thought I knew my R, I get >> bitten by some > small things that reminds one to constantly return to the > basics. > I knew for instance that "-1" <

[R] "--" < 0

2024-06-25 Thread Adrian Dusa
Dear R fellows, >From time to time, just when I thought I knew my R, I get bitten by some small things that reminds one to constantly return to the basics. I knew for instance that "-1" < 0 is TRUE, presumably because R first coerces to numeric before comparing with 0. But I did not expect that