Posts by Vivian Ribeiro • 195 points
7 posts
-
2
votes1
answer46
viewsQ: How to parallelize a sapply with table
I can perform the sapply smoothly, but I can’t parallel. In the original script I have more than 9,000,000 lines and so it is impossible to continue without parallelization.…
-
3
votes1
answer60
viewsA: sum different data frames based on column names
Sorry friends, it was very easy molde<-data.frame(c(0,0,0,0),c(0,0,0,0),c(0,0,0,0)) colnames(molde)<-c("0","0.5","1") melted <- cbind(df2,molde) aggr <- as.data.frame(do.call(cbind,…
ranswered Vivian Ribeiro 195 -
1
votes1
answer60
viewsQ: sum different data frames based on column names
I really need your help to finish an analysis. have the following tables (data frames): df1<-data.frame(c(0,1,1,0),c(1,0,0,1),c(1,1,0,0)) colnames(df1)<-c("0","0.5","1")…
rasked Vivian Ribeiro 195 -
0
votes1
answer461
viewsA: Extract raster data from a Shape in R
Hello, probably what you want is a Mask library(raster) #raster exemplo r<-raster(ncol=10,nrow=10) r[]<-1:ncell(r) plot(r) #poligono exemplo pol<-raster(ncol=2,nrow=2)…
ranswered Vivian Ribeiro 195 -
4
votes2
answers164
viewsQ: How to check if a certain sequence of Elements exists in R?
I have a vector like this: vectorx<-c(3,3,1,1,1,2,2,2,2,2,2,2,2,2) And I want to check if the sequence 3,3,1,1,1,2 exists. It turns out that this sequence can be in any vector position, I just…
rasked Vivian Ribeiro 195 -
3
votes1
answer51
viewsQ: How to return cells based on identifier in R
need to return the class of a specific id to a table. Often a single id encodes several classes: id<-c("A","B","C","D","C","B","A") clas<-c(1,2,2,2,3,3,4) tab<-data.frame(id,clas) What I…
rasked Vivian Ribeiro 195 -
6
votes1
answer117
viewsQ: How to export a polygon created by drawPoly as shapefile?
I created a shape using the function drawPoly() (bundle raster) that draws the polygon manually. At the end of the selection it generates a SpatialPolygon, but I can’t export because I’m not a…
rasked Vivian Ribeiro 195