search for: aalyaari

Displaying 7 results from an estimated 7 matches for "aalyaari".

2012 Apr 27
6
Min , Max
Hellow everyone, This code bellow will calculate average daily wind speed(measurements are taken every three hours).Any ideas how to take the Min and Max instead of average. library(Matrix) setwd("C:\\Users\\aalyaari\\Desktop\\img") listfile<-dir() long <- file("C:\\Users\\aalyaari\\Desktop\\New folder (5)\\inra.bin", "rb") A=readBin(long, integer(), size=2,n=67420*1, signed=F) ta<-t(A) lot <- file("C:\\Users\\aalyaari\\Desktop\\New folder (5)\\lat.img", "r...
2012 May 24
6
R does not recognise columns and rows as they are supposed to be
...: subscript out of bounds. and then I rewrote the above line as :file2<-matrix(data=file,ncol=360,nrow=720.I put ncol=360 and nrows =720 which is not right.But that worked and I didn't get any error.however,the results were not correct. Any help please dir1<- list.files("C:\\Users\\aalyaari\\Desktop\\New folder (10)\\Climate_Rad_f_GAMMA_%d.img", full.names = TRUE) listfile<-dir() for (i in c(1:365)) { conne <- file(listfile[i], "rb") file<- readBin(conne, double(), size=4, n=720*360, signed=T) file2<-matrix(data=file,ncol=720,nrow=360) e...
2012 Dec 03
4
How to calculate the spatial correlation of several files?
dir1 <- list.files("C:\\Users\\aalyaari\\Desktop\\cor", "*.bin", full.names = TRUE) dir2 <- list.files("C:\\Users\\aalyaari\\Desktop\\cor2", "*.bin", full.names = TRUE) results <- list() for (.files in dir1){ # read in the 365 files as a vector of numbers for dir1 file1 &...
2013 Jan 14
4
How to open grib file in R?
I have this https://echange-fichiers.inra.fr/get?k=6TdTdezNeZwAqJtpwVm grib file which is a regular lat-lon 0.25x0.25 degrees and contains 4 fields . I tried to open it using : grib <- readGDAL("C:\\Users\\aalyaari\\Desktop\\Vol_025_H14_2010060700.grib") but I got this error: C:\Users\aalyaari\Desktop\Vol_025_H14_2010060700.grib has GDAL driver GRIB and has 721 rows and 1440 columns Error in validityMethod(as(object, superClass)) : Geographical CRS given to non-conformant data: -90.125 90.125 Any...
2012 Apr 26
2
write to M, using row and columns taken from A and B, with values from C
I want to write to M, using row and columns taken from A and B, with values from C. C is a lot longer than A and B, so only the first 67420 elements of C are used in my loop.So how can I improve it to take then the next 67420 and write it to new file and so on till the 248th 67420. Many thanks library(Matrix) M <- Matrix(-9999, 360, 720) ## creat matrix with 720 columns and 360 ro ws
2013 Jan 18
2
How to re-project ease( Equal Area Scalable Earth) grid with a ~25 km cylindrical projection to WGS84 0.25 degree?
...entical. - my other data are in WGS84 with 0.25*0.25 degree resolution and extent -180, 180, -90, 90. So I want to re-project the data I have here from EASE grid, cylindrical,25 km ,1383 pixel 586 lines to WGS84,0.25*0.25 degree,1440 pixel 720 lines: f=open.ncdf("C:\\Users\\aalyaari\\Desktop\\SM_RE01_MIR_CLF31D_20100812T000000_20100812T235959_246_001_7.DBL") A = get.var.ncdf(nc=f,varid="Soil_Moisture",verbose=TRUE) I tried this: d <-raster("C:\\Users\\aalyaari\\Desktop\...
2012 May 28
1
Why R order files as 1 10 100 not 1 2 3 ?
....names = TRUE) results<- list() for (.files in seq_along(dir1)){ file2 <- readBin(dir2[.files], double(), size = 4, n = w * 67420, signed = TRUE) results[[length(results) + 1L]]<- file1[file1 != -9999]*10} for (i in seq_along(results)){ fileName <- sprintf("C:\\Users\\aalyaari\\Desktop\\New folder (2)\\NewFile%03d.bin", i) writeBin(as.integer(results[[i]]), fileName, size = 2)} -- View this message in context: http://r.789695.n4.nabble.com/Why-R-order-files-as-1-10-100-not-1-2-3-tp4631584.html Sent from the R help mailing list archive at Nabble.com.