Displaying 20 results from an estimated 2000 matches similar to: "raster::levels() not working in packaged function."
2020 Oct 31
0
[R-sig-Geo] raster::levels() not working in packaged function.
Many thanks,
That worked, since the NAMESPACE file incudes a warning about editing it
directly I ysed the reoygen tag in the fucntion script
#' @import raster.
On Sun, 1 Nov 2020 at 00:18, Marcelino de la Cruz Rot <
marcelino.delacruz at urjc.es> wrote:
> Maybe including
>
> import(raster)
>
> or
>
> importFrom("raster", "levels")
>
> in
2020 Sep 10
5
aplicar codigo
Hola:
Como dice Carlos, algo así, por ejemplo:
transforma <- function(df) sapply(df, function(x)
ifelse(x%in%c("x1","x2","x3"),
"prueba1",ifelse(x%in%c("x4","x5","x6"),"prueba2",x)))
> transforma(df1)
col1
[1,] "prueba1"
[2,] "prueba1"
[3,] "x11"
[4,]
2020 Sep 10
2
aplicar codigo
Yo copio y pego este código y me sale correctamente. Se me ocurre que
pueda deberse a la versión de R ¿cuál usas?
El 10/09/2020 a las 17:51, Samura . escribió:
> Gracias por las respuestas.
>
> Probé lo de hacer la función y no me salía. Pensaba que hacía algo mal.
> Ahora con el código de Marcelino tampoco me sale.
>
> col1 <- c('x1', 'x2', 'x11',
2019 Sep 06
2
Dibujar un triángulo dadas la distancias de los segmentos.
Pregunta, ?Como puedo leer datos de SPSS con R studio?
Obtener Outlook para Android<https://aka.ms/ghei36>
________________________________
From: R-help-es <r-help-es-bounces en r-project.org> on behalf of Juan Abasolo <juan.abasolo en ehu.eus>
Sent: Thursday, September 5, 2019 11:28:37 AM
To: Carlos Ortega <cof en qualityexcellence.es>
Cc: R-help-es <r-help-es en
2019 Sep 05
2
Dibujar un triángulo dadas la distancias de los segmentos.
Mira aquí como se soluciona...
https://www.triangle-calculator.com/?what=sss&a=47&b=45&c=55&submit=Solve
Saludos,
Carlos Ortega
www.qualityexcellence.es
El jue., 5 sept. 2019 a las 13:17, Marcelino De La Cruz Rot (<
marcelino.delacruz en urjc.es>) escribió:
> Hola Juan:
>
> El 05/09/2019 a las 0:19, Juan Abasolo escribió:
> > Buenas, compañeros;
> >
2020 Feb 19
2
Pregunta sobre rLandsat
Hola grupo, estoy siguiendo una gu?a de la librer?a rLandsat que me la he descargado de:
devtools::install_github("socialcopsdev/rLandsat")
Y tras hacer los siguiente (obviamente tengo me he registrado previamente en la api correspondiente):
product_id = c("LC08_L1TP_145049_20180301_20180308_01_T1",
"LC08_L1TP_145049_20170330_20170414_01_T1",
2020 Feb 20
3
Pregunta sobre rLandsat
Hola Ángel:
Yo creo que tendrías que establecer el sistema de coordenadas de
referencia de tu objeto raster antes de salvarlo como GTiff. Algo así:
crs(r1) <-"+proj=utm +zone=14 +datum=WGS84"
Saludos,
Marcelino.
El 20/02/2020 a las 1:42, Angel Cervantes escribió:
> Hola a todos, quisiera pedirles su ayuda. Estoy tratando de crear un raster a partir de una tabla de datos
2019 Sep 06
5
Leer fichero de SPSS...
Gracias. Es necesario instalar "forecast"??
Obtener Outlook para Android<https://aka.ms/ghei36>
________________________________
From: Carlos Ortega <cof en qualityexcellence.es>
Sent: Friday, September 6, 2019 1:37:08 PM
To: Christopher Estrada Ruiz <christopher_estrada_ruiz en hotmail.com>
Cc: Juan Abasolo <juan.abasolo en ehu.eus>; R-help-es <r-help-es en
2009 Feb 21
1
Extracting xy from raster based on raster value
I have a raster (which I called glc), which I read
into R as a raster with "raster.create.from.file" from the raster package (R-forge). Values in glc range between 1 and 27 (whole numbers only). I'd like to extract all cells with a value of 1 to create
a new raster with only the cells that have a value of 1, or to extract
the xy values of all raster cells with a value of 1. Could you
2011 Jan 31
1
str() on raster objects fails for certain dimensions
Hi,
str() on raster objects fails for certain dimensions. For example:
> str(as.raster(0, nrow=1, ncol=100))
'raster' chr [1, 1:100] "#000000" "#000000" "#000000" "#000000" ...
> str(as.raster(0, nrow=1, ncol=101))
Error in `[.raster`(object, seq_len(max.len)) : subscript out of bounds
This seems to do with how str() and
2012 May 20
5
removeing only rows/columns with "na" value from square ( symmetrical ) matrix.
I have some square matrices with na values in corresponding rows and
columns.
M<-matrix(1:2,10,10)
M[6,1:2]<-NA
M[10,9]<-NA
M<-as.matrix(as.dist(M))
print (M)
1 2 3 4 5 6 7 8 9 10
1 0 2 1 2 1 NA 1 2 1 2
2 2 0 1 2 1 NA 1 2 1 2
3 1 1 0 2 1 2 1 2 1 2
4 2 2 2 0 1 2 1 2 1 2
5 1 1 1 1 0 2 1 2 1 2
6 NA NA 2 2 2 0 1 2 1 2
7 1 1 1 1 1 1 0 2 1 2
8
2010 May 04
7
How to replace all <NA> values in a data.frame with another ( not 0) value
I need to replace <NA> occurrences in multiple columns in a data.frame
with "000/000"
how do I achieve this?
Thanks
Nevil Amos
2012 Apr 10
7
How to remove $ (Dollar sign) from string
How do I remove a "$" character from a string sub() and gsub() with "$" or
"\$" as pattern do not work.
> sub("$","","ABC$DEF")
[1] "ABC$DEF"
> sub("\$","","ABC$DEF")
Error: '\$' is an unrecognized escape in character string starting "\$"
>
2011 Dec 01
1
Raster manipulation in R
Hello everyone in the forum
For introducing myself I would say I have a basic knowledge of R.
Now I am intended to implement a flood algorithm using R. I have some MatLab
experience doing these, and as an example to explain more or less what I
want, I have a m code to calculate the slope from a Digital elevation model:
slope=zeros(row,col);
for i=2:row-1
for j=2:col-1
2012 May 10
2
converting raster image
Dear R users,
I was wondering how I can convert a raster image (that made R through interpolation) into an ascii or csv format?
this is the last line of my command
p <- interpolate(r, tpsfit)
So p is my raster file which I want to convert into ascii or csv
Many thanks
Regards
Mintewab
2012 Oct 29
3
How can I map numbers to colours with raster?
This code will read binary file and display it as a map. may problem is that
this code is using a continuous colour scheme, even though I have discrete
data (which is a classification scheme). How can I map numbers to colours
with raster? Please
require(raster)
conne <- file("C:\\lai.bin", "rb")
sd<- readBin(conne, integer(), size=1, n=360*720, signed=F)
2012 Jan 25
4
x11() graphic device, displaying raster
Hello,
I am wondering about the X11() graphic device on Windows.
I try to plot a raster image but nothing gets displayed. I
found some pages where it is mentioned that x11() not
always supports raster rendering.
Is there any add on for x11, any update or any R-package
which solves that displaying problem in Windows?
What I try to test it is an example from the
package {raster}:
library(raster)
2012 Jan 25
4
x11() graphic device, displaying raster
Hello,
I am wondering about the X11() graphic device on Windows.
I try to plot a raster image but nothing gets displayed. I
found some pages where it is mentioned that x11() not
always supports raster rendering.
Is there any add on for x11, any update or any R-package
which solves that displaying problem in Windows?
What I try to test it is an example from the
package {raster}:
library(raster)
2012 Mar 21
2
To overlay my raster and its boundary
Hi
I want to overlay my raster and its boundary which is a shapefile.
When I used thise code separately, all is ok:
# Open raster
>Image<-read.table("C:\\Users\\Documents\\Nouveau\\Frequence.txt",sep="",dec=",",header=TRUE)
>testo<-rasterFromXYZ(Image)
>plot(testo)
>testo2 <- aggregate(testo,fact=10, fun=mean)
>plot(testo2)
# open
2013 Oct 24
1
Plot.raster hides the axis layer
Hi all,
I am trying to plot a raster object (I can explain why but the point is that it would be a raster objeçt)..
I have selected a small code to show you exactly the problem
require(raster)
test<-matrix(data=runif(10000),nrow=100)
m<-raster(test)
plot(m,axes="FALSE")
axis(1,at=c(0,1),labels=c("a","b")) # THIS DOES NOT CHANGE THE INVISIBLE AXIS WHILE