similar to: Using RasterBricks

Displaying 20 results from an estimated 400 matches similar to: "Using RasterBricks"

2013 Jul 17
0
Using RasterBricks
Hola Jorge, > My idea was to use 'stackApply': Para esto que necesitas es más sencillo usar calc. Si quieres usar stackApply, debes indicar rep(1, 3) como índices en lugar de sólo 1. Así, la función será (los ... son necesarios en stackApply): myFUN <- function(y, ...) { x <- seq_along(y) trapz(x, y) } Y aplicada con calc: FINAL <- calc(s, myFUN) o con
2013 Jul 19
0
Resumen de R-help-es, Vol 53, Envío 26
Gracias a todos, finalmente instalando primero el libxml2-dev y luego el dplR, funciono ----- Mensaje original ----- De: r-help-es-request en r-project.org Para: r-help-es en r-project.org Enviados: Miércoles, 17 de Julio 2013 12:59:47 Asunto: Resumen de R-help-es, Vol 53, Envío 26 Envíe los mensajes para la lista R-help-es a r-help-es en r-project.org Para subscribirse o anular su
2023 Nov 09
1
Dependency errors for package pracma
I tried to update my package {pracma} on CRAN from 2.4.2 (2022-09-21) to version 2.4.4 (2023-11-08). This package reverse depends / imports / suggests on 350 packages on CRAN and 25 packages on Bioconductor. The only changes are small corrections on some help files, a new function for stereographic projection, and `gcd` and `Lcm` require integer inputs now (these functions are not used in the
2013 Sep 09
1
usando RasterBricks
Necesitaría ayuda con una cuestión. Pongamos por ejemplo estos valores aleatorios para generar un RasterBrick s de 3 capas. library(raster) r <- raster(ncol=10, nrow=10) r[]=1:ncell(r) s <- brick(r,r,r) s <- s * 1:3 Habría alguna forma sin hacer un bucle for, que me devolviese un vector con los valores medios de cada una de las 3 capas. mean_s<-NULL for (i in 1:3) {
2011 Jan 25
3
Integration of two lines
Hello, I need to integrate the absolute difference between two lines measured on different points. # For example : x <- seq(0, 1, 1/100) f_x <- runif(101) + x y <- seq(0, 1, 1/23) f_y <- runif(24) + (1 - y) plot(x, f_x, type="l") lines(y, f_y) Then I would like to compute Integral( | f_x - f_y | )dx. (This is not the same as | Integral(f_x)dx - Integral(f_y)dx |.)
2012 May 04
7
Programando en R: Clases
  Hola:   Perdonad por la insistencia, pero me gustaría saber si cualquier proyecto en R debe afrontarse desde el uso de clases, o si sólo procede ante determinados casos. De ser así, ¿cuáles serían?.   Gracias.   Eva [[alternative HTML version deleted]]
2018 Jun 01
1
rasterize SpatialPolygon object using a RasterBrick object
I am trying to rasterize a SpatialPolygon object by a RasterBrick object. The documentation of the raster::rasterize function explicitly says this is allowed. Here's what I am doing # load the raster package library("raster") # create a raster brick object using the example from the brick function documentation b <- brick(system.file("external/rlogo.grd",
2015 Apr 02
2
Mapas con spplot
Hola He hecho el típico mapa con gadm y spplot: library(sp) ES <- local(get(load(url("http://biogeo.ucdavis.edu/data/gadm2/R/ESP_adm2.RData ")))) acerco las canarias: A <- which(ES en data$NAME_1 == "Islas Canarias") L <- length(ES en polygons[[A]]@Polygons) L <- length(ES en polygons[[A]]@Polygons) for (i in 1:L){ ES en polygons[[A]]@Polygons[[i]]@coords
2011 Apr 09
6
grafico
Hola a todos, a<-c(1,2,3,4,5) b<-c(1.3,2.4,5,6,8) etiquetas<-c("etiq1","etiq2","etiq3","etiq4","etiq5") c<-rbind(a,b) Me gustaría hacer un gráfico en el que se represente en el eje Y las series a y b que están unidas en c y en el eje X las etiquetas ¿cómo se podría hacer? Espero haberme explicado. Sería el equivalente a la figura de
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
2011 Jun 23
5
Reducción tamaño de gráficos en PDF
Buenas tardes a todos, Estoy interesado en realizar varios gráficos y luego guardarlos individualmente como PDF. Hasta ahí todo bien. Sin embargo, el archivo resultante tiene aproximadamente 20MB. Podría alguien por favor indicarme cómo reducir su tamaño? A continuación un ejemplo de lo que intento hacer y mi sessionInfo(). Estoy usando Mac OS X. Muchas gracias, Jorge Ivan Velez # R code
2015 Apr 03
0
Mapas con spplot
Hola, Yo lo resuelvo usando grid.rect. Tienes una posible solución aquí: https://github.com/oscarperpinan/spacetime-vis/blob/master/choropleth.R#L216 (que es una versión actualizada de este artículo https://procomun.wordpress.com/2012/02/18/maps_with_r_1/) Saludos. Oscar. ----------------------------------------------------------------- Oscar Perpiñán Lamigueiro Dpto. Ing. Eléctrica,
2013 Jun 02
2
Conversión de objeto temporal (TS) a matriz (o data.frame)
Hola, Si no te entiendo mal, necesitas la conversión a matriz como paso intermedio para agregar por meses (o cualquier unidad temporal). Si es así, te aconsejo que uses el paquete zoo y el método aggregate para la clase zoo. Por ejemplo: library(zoo) dats <- data.frame(date=seq(as.Date('2012-01-01'), by='day', length=3*365), A=rnorm(3*365),
2013 Feb 15
1
minimizing a numerical integration
Dear all, I am a new user to R and I am using pracma and nloptr libraries to minimize a numerical integration subject to a single constraint . The integrand itself is somehow a complicated function of x and y that is computed through several steps. i formulated the integrand in a separate function called f which is a function of x &y. I want to find the optimal value of x such that the
2011 Jul 11
1
Dibujo con función polygon
Hola, Estoy intentando dibujar una curva, pero que esté divivida por la mitad en dos colores: plot( seq(0, 100,by=1), seq(0,1,by=0.01), bty = "n",col = "white") x <- c(50: 100) y <- 20*x^-1 polygon( c(50,50, c(52:100),100 ) , c(1,y[1:50],1), col = "steelblue2", border = NA) x <- c( 0: 50 ) y <- 20*x^-1 polygon( c(c(21:50), 50 ) , c(y[21:50],1),
2012 May 09
2
problem with Gauss Hermite ( x and w )
Hi all, I am using the 'gaussHermite' function from the 'pracma' library ############ CODES ########### library(pracma) cc=gaussHermite(10) cc$x^2 cc$x^5 cc$x^4 ############ CODES ########### as far so good. However, it does NOT work for any NON integer values, say ############ CODES ########### cc$x^(2.5) cc$x^(-2.5) ############ CODES ########### But just think about it
2012 Sep 08
0
Help on calculating AUC with caTools trapz(a,b) command
Dear All,   I have the following example:   a <-matrix(c(1:100),ncol=10) b <-matrix(c(2,4,6,8,10,12,14,16,18,20))   trapz(b,a)   will give me a result of 99, which it seems to me is the AUC of the 1st column only. Is it possible to get the AUC results by columns of "a" using the same "b" values in the calculations as opposed to just generating the result for the 1st
2012 Mar 19
2
by output into data frame
I could do this in various hacky ways, but what's the right way? I have a nice application of the by function, which does what I want. The output looks like this: > auc_stress lab.samples.stress$subid: 2 cortisol amylase 1 919.05 6834.8 ---------------------------------------------------------------------------------------------------------------------------
2018 May 24
0
Problem with adding a raster and a brick
On Thu, 24 May 2018 at 18:41 Mark R Payne <markpayneatwork at gmail.com> wrote: Hi, I seem to be having a problem adding the following two raster objects together - one is a rasterLayer, the other is a rasterBrick. The extent, resolution, and origin are the same, so according to my understand it should work. The objects look like so: > obs.clim class : RasterLayer dimensions : 60, 200,
2018 May 24
2
Problem with adding a raster and a brick
Hi, I seem to be having a problem adding the following two raster objects together - one is a rasterLayer, the other is a rasterBrick. The extent, resolution, and origin are the same, so according to my understand it should work. The objects look like so: > obs.clim class : RasterLayer dimensions : 60, 200, 12000 (nrow, ncol, ncell) resolution : 0.5, 0.5 (x, y) extent : -70,