Re: [R] Error in R_nc4_open

2017-01-11 Thread Debasish Pai Mazumder
t;directly, you will discover this is true. > > > >It's always good practice to break down each part into small steps > >when trying to solve a problem, so that you can tell where things go > >wrong. > > > >I'd walk back to > >https://nomads.ncdc.n

Re: [R] Error in R_nc4_open

2017-01-11 Thread Debasish Pai Mazumder
t; the results (if it doesn't happen in R then RStudio may be breaking R > (rare, but it has happened) in which case you would have to ask them for > help. > -- > Sent from my phone. Please excuse my brevity. > > On January 11, 2017 12:32:09 PM PST, Debasish Pai Mazumder

[R] Error in R_nc4_open

2017-01-11 Thread Debasish Pai Mazumder
Hi all, I recently updated my Rstudio to the newer version (Version 1.0.136) and I started to getting following error when I am trying to read netcdf files Error in R_nc4_open: NetCDF: DAP server error Any ideas? with regards -Deb [[alternative HTML version deleted]] __

[R] download multiple files in one file

2016-10-13 Thread Debasish Pai Mazumder
Hi All, I have downloaded single file from the web using following scripts gribfile<-" http://nomads.ncdc.noaa.gov/thredds/ncss/grid/modeldata/cfsv2_forecast_ts_9mon/2011/201104/20110401/2011040100/tmax.01.2011040100.daily.grb2?north=47.0126&west=-114.841&east=-112.641&south=44.8534&time_start=201

Re: [R] OPeNDAP access / OPeNDAP subsetting with R

2016-10-10 Thread Debasish Pai Mazumder
. ..$ natts: int 13 > > .. ..$ dimid: int [1:4(1d)] 0 1 2 3 > > .. ..$ fqgn : chr "" > > .. ..- attr(*, "class")= chr "ncgroup4" > > $ fqgn2Rindex:List of 1 > > ..$ : int 1 > > $ ndims : num 4 > > $ natts : num

Re: [R] OPeNDAP access / OPeNDAP subsetting with R

2016-09-30 Thread Debasish Pai Mazumder
gt; Cheers, Mike > > On Wed, 28 Sep 2016, 06:49 Roy Mendelssohn - NOAA Federal < > roy.mendelss...@noaa.gov> wrote: > >> Please post the code of what you tried, as I have no idea otherwise what >> did or did not work for you. >> >> -Roy >> >> >

Re: [R] OPeNDAP access / OPeNDAP subsetting with R

2016-09-27 Thread Debasish Pai Mazumder
, Sep 27, 2016 at 11:51 AM, Roy Mendelssohn - NOAA Federal < roy.mendelss...@noaa.gov> wrote: > Look at the package ncdf4. You can use an OPeNDAP URL in place of the > file name to perform subsets., > > -Roy > > > On Sep 27, 2016, at 9:06 AM, Debasish Pai Mazumder &g

[R] OPeNDAP access / OPeNDAP subsetting with R

2016-09-27 Thread Debasish Pai Mazumder
Hi all, I would like to access and subset following OpeNDAP files. server: http://nomads.ncdc.noaa.gov/thredds/dodsC/modeldata/cfsv2_forecast_ts_9mon/2014/201404/20140403/2014040312/ file name: tmax.01.2014040312.daily.grb2

Re: [R] How to read a grib2 file

2016-09-13 Thread Debasish Pai Mazumder
gt; What is your computer system? What is the output of this? > > sessionInfo() > > If you point to a file I'll try it so I can tell you the minimum system > requirements. > > Cheers, Mike > > On Tue, 13 Sep 2016, 08:56 Debasish Pai Mazumder > wrote: > >>

Re: [R] How to read a grib2 file

2016-09-12 Thread Debasish Pai Mazumder
ael Sumner wrote: > > > On Sat, 10 Sep 2016 at 07:12 Debasish Pai Mazumder > wrote: > >> Hi >> I am trying to read a grib2 file in R. >> >> Here is my script >> >> library(rgdal) >> library(sp) >> library(rNOMADS) >> gribfile<

[R] How to read a grib2 file

2016-09-09 Thread Debasish Pai Mazumder
Hi I am trying to read a grib2 file in R. Here is my script library(rgdal) library(sp) library(rNOMADS) gribfile<-"tmax.01.2011040100.daily.grb2" grib <- readGDAL(gribfile) I am getting following error : dec_jpeg2000: Unable to open JPEG2000 image within GRIB file. Is the JPEG2000 driver availa

Re: [R] How to make the "apply" faster

2016-07-10 Thread Debasish Pai Mazumder
argument > instead of > fixing it at 2. E.g. > >> f3 <- function (condition, spellLength = 2) >{ >stopifnot(is.logical(condition), !anyNA(condition)) >y <- rle(condition) >sum(y$lengths[y$values] >= spellLength) >} >&g

Re: [R] How to make the "apply" faster

2016-07-10 Thread Debasish Pai Mazumder
") {b <- (data <= threshold)} else {b <- (data >= threshold)}b[b==TRUE] = 1 y <-rle(b) ans <-length(subset((y$lengths[y$values==1]), (y$lengths[y$values==1])>=2)) return(ans)}* Do you have any idea how to make the "apply" faster here? -Deb On Sat, J

[R] How to make the "apply" faster

2016-07-09 Thread Debasish Pai Mazumder
I have 4-dimension array x(lat,lon,time,var) I am using "apply" to calculate over time new = apply(x,c(1,2,4),FUN=function(y) {length(which(y>=70))}) This is very slow. Is there anyway make it faster? -Debasish [[alternative HTML version deleted]] _

[R] Static to interactive map (leaflet spplot)

2016-02-02 Thread Debasish Pai Mazumder
Hi ALL, I have a script to plot hexagonal polygon on a map. Its a static map. I used spplot. I would like to convert this plot to interactive plot using " *leaflet*". How do I make it interactive plot? Here is spplot lines: cl = map("world", xlim = c(-120, 20), ylim = c(-10, 70), plot = TRUE) cl

[R] Problem with installing "mapview"

2016-01-25 Thread Debasish Pai Mazumder
Hi all, I am using Rstudio version 0.99.491. I am trying install "mapview" package. install.packages("mapview") I receive following error message configure: error: Cannot compile a simple JNI program. See config.log for details. Make sure you have Java Development Kit installed and correctly re

[R] paneling spplot and hist

2015-12-14 Thread Debasish Pai Mazumder
Hi all, I am new in R. I am trying to panel spplot and hist. spplot(hspdf, "CDP", col = "white", col.regions = blue2red(20), sp.layout = list(l2), at = seq(1,10,1), colorkey = list(space = "bottom", labels = list(labels = paste(seq(1,10,1)), cex = 1.5)), sub = list("CDP", cex = 1.5, font = 2)) h

[R] problem with spplot

2015-12-11 Thread Debasish Pai Mazumder
Hi all, I am using spplot for a spatial map. spplot(hspdf, "CDP", col = "white", col.regions = blue2red(20), sp.layout = list(l2), at = seq(1,10,1), colorkey = list(space = "bottom", labels = list(labels = paste(seq(1,10,1)), cex = 1.5)), sub = list("CDP", cex = 1.5, font = 2)) I have three ques

[R] spplot

2015-12-10 Thread Debasish Pai Mazumder
Hi all, I am using spplot for a spatial map. spplot(hspdf, "CDP", col = "white", col.regions = blue2red(20), sp.layout = list(l2), at = seq(1,10,1), colorkey = list(space = "bottom", labels = list(labels = paste(seq(1,10,1)), cex = 1.5)), sub = list("CDP", cex = 1.5, font = 2)) I have three ques