similar to: [newbie] convert 3D spatial array to dataframe

Displaying 20 results from an estimated 8000 matches similar to: "[newbie] convert 3D spatial array to dataframe"

2012 Nov 18
2
[lattice] format and rotation of strip text
Thanks to the lattice gurus on this list, and having reference to the excellent open-access Sarkar 2008 ISBN 978-0-387-75968-5 e-ISBN 978-0-387-75969-2 http://dx.doi.org/10.1007/978-0-387-75969-2 I now know how to label lattice panels by variable value: see thread starting @ https://stat.ethz.ch/pipermail/r-help/2012-November/329450.html (and demonstrated below). This allows me to use
2017 Aug 28
3
Extracting subset from netCDF file using lat/lon and converting into .csv in R
I have a series of nertCDF files containing global data for a particular variable, e.g. tmin/tmax/precipiation/windspeed/relative humuidity/radiation etc. I get the following information when using *nc_open* function in R: datafile: https://www.dropbox.com/s/xpo7zklcmtm3g5r/gfdl_preci.nc?dl=0 File gfdl_preci.nc (NC_FORMAT_NETCDF4_CLASSIC): 1 variables (excluding dimension variables):
2012 Nov 20
2
[lattice] how to overlay a geographical map on a levelplot?
r-help lattice adepts: I have a question which is somewhat geospatial, so I posted to r-sig-geo rather than here: https://stat.ethz.ch/pipermail/r-sig-geo/2012-November/016757.html > summary: How to overlay a geographical map on each panel in a lattice > (or Trellis), e.g., of levelplot's? Note I am not inquiring about > creating choropleth maps[,] which Sarkar 2008 covers quite
2017 Aug 28
0
Extracting subset from netCDF file using lat/lon and converting into .csv in R
Two questions: 1. Is the order of the dimensions shown what is shown if you look at str(ncin) - I mean shown at the end where it describes the variable and its dimensions? 2. Is you problem how to subset the netcdf file, how to write to the .csv file, or both? -Roy > On Aug 28, 2017, at 2:21 PM, Eeusha Nafi <eshad002 at gmail.com> wrote: > > I have a series of nertCDF files
2016 Apr 22
2
Unexpected values obtained when reading in data using ncdf and ncdf4
Dear R Users, I am encountering a problem when reading nc files into R using the ncdf and ncdf4 libraries. The nc files are too large to attach an example (but if someone is interested in helping out I could send a file privately via an online drive), but the code is basic: for(i in 1:length(thesenames[,1])){ data <- nc_open(paste(INDIR, thesenames[i,c("wholename")],
2016 Apr 22
0
Unexpected values obtained when reading in data using ncdf and ncdf4
On Fri, Apr 22, 2016 at 1:32 AM, Louise Mair <louise.mair at slu.se> wrote: > Dear R Users, > > I am encountering a problem when reading nc files into R using the ncdf > and ncdf4 libraries. The nc files are too large to attach an example (but > if someone is interested in helping out I could send a file privately via > an online drive), but the code is basic: > ?[...]?
2018 Mar 28
3
Creating the right table from lapply list
Hello, I have no previous experience with R, but had to learn on the fly in the past couple of weeks. Basically, what I am trying to do is read a certain variable from a series of files and save it as csv-table. The variable has an hourly value for each month in a year for the past 20 years and has to be read for different geographical locations. So there will be 12 files per year (1 for each
2012 Aug 28
4
[ncdf4] error converting GEIA data to netCDF
summary: I can successfully ncvar_put(...) data to a file, but when I try to ncvar_get(...) the same data, I get > Error in if (nc$var[[li]]$hasAddOffset) addOffset = nc$var[[li]]$addOffset else addOffset = 0 : > argument is of length zero How to fix or debug? details: R code @ https://github.com/TomRoche/GEIA_to_NetCDF successfully (if crudely) uses R packages={ncdf4, maps, fields}
2018 Mar 29
0
Creating the right table from lapply list
Perhaps this toy example will help: ## example data output <- list(1:5, 1:7, 1:4) lens <- lapply(output, length) maxlen <- max(unlist(lens)) outputmod <- lapply(output, function(x, maxl) c(x, rep(NA, maxl-length(x))), maxl=maxlen) outputmat <- do.call(cbind, outputmod) write.csv(outputmat, na='') The idea is to pad the shorter vectors with NA (missing) before converting
2009 Nov 10
3
NetCDF output in R
Dear CSAG R users, I will be glad if someone can point out what I am doing wrong or not doing at all in this. I am trying to write out netcdf file in R. I have 26 time step but only the first time step is written. For example: >library(ncdf) >path <- '/home/work/' >forecast <- open.ncdf(paste(path,'cam.1980.2005.nc',sep="")) > fore <-
2009 Nov 10
3
NetCDF output in R
Dear CSAG R users, I will be glad if someone can point out what I am doing wrong or not doing at all in this. I am trying to write out netcdf file in R. I have 26 time step but only the first time step is written. For example: >library(ncdf) >path <- '/home/work/' >forecast <- open.ncdf(paste(path,'cam.1980.2005.nc',sep="")) > fore <-
2008 Jul 02
1
Insert text in data.frame
Dear R-helper, I wonder if anyone can help me. I am trying to convert a dataset to a format recognizable by a software onboard a research vessel but I am having problems with some steps. I have a data frame as follows: Conc Lat Lon Depth Point0000 56.25 -5.65 70 Point0001 56.55 -5.35 85 Point0002 56.25 -5.65 65 Point0003 56.37
2013 Feb 05
1
ncdf4 installation problem: undefined symbol [SEC=UNCLASSIFIED]
Hello, I'm trying to install ncdf4 on RHEL 5.8, R version 2.15.1. Previously installed is netcdf 3.6.2 from Red Hat, so I've compiled and installed netcdf 4.2.1.1 (with hdf5 and zlib as per install instructions, and also set --enable-netcdf4 option) into /usr/local. When attempting to install ncdf4 it is failing with: ** testing if installed package can be loaded Error in
2010 Apr 21
1
overlaying a levelplot on a map plot
I've generated a levelplot showing the density distribution of a species derived from survey transects, with lon, lat co-ordinates. I'd like to overlay this on a map of the study region specified by: map('worldHires', xlim = range(mlon), ylim = range(mlat)), where mlon, mlat specifies the study region. I've tried plotting the map first, then using the options: 'add=TRUE,
2012 Dec 31
2
code to convert 3D geographical coordinates to Cartesian?
Is there packaged code to convert geographical coordinates (e.g., longitude, latitude, elevation) to Cartesian coordinates in 3-space? I can see how to do this using 1. a spherical-to-Cartesian conversion like pracma::sph2cart(tpr) http://cran.r-project.org/web/packages/pracma/ 2. a geographical-to-spherical conversion. This seems to involve (in roughly increasing order of difficulty or
2013 Feb 13
1
[lattice] display a projected map on a layerplot
summary: I can display a lon-lat map on a lattice::layerplot, and I can display a Lambert conformal conic (LCC) map on a spam::image, but I can't display an LCC map on a lattice::layerplot. Example follows. What am I doing wrong? details: I've been using `lattice` (via `rasterVis`) successfully to display global atmospheric data, which works well enough (though I am definitely intrigued
2010 Sep 03
1
calculate monthly mean
Hello group Im trying to plot 3d with scatterplot packages, i got error say " length(color) must be equal length(x) or 1 " may data has dimensions (lon,lat,lev,time) ,the time in month i want to calculate the monthly mean for the time how can i make that , is there any function doing that Thanks a lot ##load rgl package library(rgl) library(fields) library(ncdf)
2005 Jun 09
1
Plot/manage spatial boundary data
I have some disconnected boundary data from a finite element ocean model and I'd like to make a plot. Maptools looks promising, but since my data is not in a shapefile or a map, I'm unclear on what the best way to approach the problem. >geom[1:10,] lon lat depth 1 -75.42481 35.58192 16.172 2 -75.40726 35.58567 18.045 3 -75.41351 35.60312 17.333 4 -75.38888 35.58959
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
SUMMARY: Specific problem: I'm regridding biomass-burning emissions from a global/unprojected inventory to a regional projection (LCC over North America). I need to have boundaries for Canada, Mexico, and US (including US states), but also Caribbean and Atlantic nations (notably the Bahamas). I would also like to add Canadian provinces and Mexican states. How to put these together? General
2017 Aug 14
2
ncdf4: Why are NAs converted to _FillValue when saving?
Dear all I'm a newbie regarding netcdf data. Today I realized that I maybe do not understand some basics of the netcdf. I want to create a *.nc file containing three variables for Switzerland. All data outside of the country are NAs. The third variable is calculated from the first two variables. Basically there is no problem to do that. I copy the file with the data of the first variable,