Re: [R] problem in while loop?

2013-08-30 Thread Amen Alyaari
de and got this error message: Error in model.frame.default(formula = x ~ y, drop.unused.levels = TRUE) : variable lengths differ (found for 'y') Calls: lm -> eval -> eval ->-> model.frame.default And looking at your code: x is a vector, x_e is a scalar and in the while loop you a

[R] apply problem

2013-07-12 Thread Amen Alyaari
) ## not 3 instead of 2 and I added x[,3] Is that right? This worked without errors but I checked the results and they were crap. -- Amen Alyaari, UPMC PhD student Unit of Functional Ecology& Environmental Physics [EPHYSE] National Institute of Ag

Re: [R] write to M, using row and columns taken from A and B, with values from C

2012-04-26 Thread Amen
Thanks a lot for your reply. I have managed to do it but still something that I do not know how to do that.This code below will read the first row in D and write it to a new file.I want to make a another loop to read all rows and write each result of every row to a file. library(Matrix) M <- Matr

[R] write to M, using row and columns taken from A and B, with values from C

2012-04-26 Thread Amen
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

[R] locate values to their positions based on their pixel and line in other files

2012-04-25 Thread Amen
I have 3 files A ,B ,C as binary files. C represents the values of tepm measured every 3 hours for one month so it has 674200 columns and 248 rows.values of A represent the correspond lines(these values could be within 1to360) and , while values of B represent the correspond pixel(1to720) for each

Re: [R] read multiaple files within one folder

2012-04-06 Thread Amen
firstly , thanks a lot. yes the files are already binarys. (there are 360 binary files ,each file has dim of 720 *360 files) in one folder of what I am trying to do is to take the average of each 4 files and finally got 40 files to a new folder . the error message is Error in Testarray[i, , ] <

[R] read multiaple files within one folder

2012-04-06 Thread Amen
Suppose we have files in one folder file1.bin, file2.bin, ... , and 1460slice(file) with dim of 720 * 360 in directory C:\\PHD\\Climate Data\\Wind\\ and we want to read them and make a loop to go from 1 to 4 and take the average, then from 4 to 8 and so on till 1460. in the end we will get 365 f

Re: [R] memory, i am getting mad in reading climate data

2012-03-17 Thread Amen
Many Many thanks for your responses -- View this message in context: http://r.789695.n4.nabble.com/memory-i-am-getting-mad-in-reading-climate-data-tp4480671p4481296.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

[R] -1e+34

2012-03-17 Thread Amen
I am getting theses values when I disply my ncdf file 1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 [227,] -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 [228,] -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 -1e+34 [229,] -1e+34 -1e+34 -1e+34 -1e+34

[R] memory, i am getting mad in reading climate data

2012-03-17 Thread Amen
I faced this problem when typing: temperature <- get.var.ncdf( ex.nc, 'Temperature' ) *unable to allocate a vector of size 2.8 GB* By the way my computer memory is 4G and the original size of the file is 1.4G,netcdf file I don't know what is the problem.Any suggestion please I tried also memor

Re: [R] ncd4 package

2012-03-16 Thread Amen
I got theses but no interface > library(udunits2) > library(ncdf) > local({pkg <- select.list(sort(.packages(all.available = > TRUE)),graphics=TRUE) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) > -- View this message in context: http://r.789695.n4.nabble.com/ncd4-package-tp4477496p44777

Re: [R] ncd4 package

2012-03-16 Thread Amen
Thanks a lot I installed it but the interface did not show up I got this message > Local ({pkg <- select.list (sort (. Packages (all.available = TRUE)), > graphics = TRUE) + If (nchar (pkg)) library (pkg, character.only = TRUE)}) Notification message: package 'RNetCDF has been compiled with version

[R] var

2012-03-16 Thread Amen
ex.nc [1] "file cruncep_tair_2010.nc has 4 dimensions:" [1] "longitude Size: 720" [1] "latitude Size: 360" [1] "time Size: 1460" [1] "points_terre Size: 62482" [1] "" [1] "file cruncep_tair_2010.nc has 4 variables:" [1] "int mask[longitude,latitude] Longname:mask Mi

[R] ncd4 package

2012-03-16 Thread Amen
Hi I am using windows. I cant install ncdf4 package but it didn't work . any suggestions!! -- View this message in context: http://r.789695.n4.nabble.com/ncd4-package-tp4477496p4477496.html Sent from the R help mailing list archive at Nabble.com. __ R

[R] climate data, Netcdf

2012-03-15 Thread Amen
I am a PhD student working on global scale. I am working at INRA in France.I am new to R I downloaded a netcdf file cruncep_tair_2010.nc.gz from http://dods.extra.cea.fr/data/p529viov/cruncep/t2m/ in this file, temperature was measured every 6 hours for 2010, I want to convert to dail

[R] climate data, Netcdf

2012-03-14 Thread Amen
As you can see: time is from 1 to 1460, 1 means they the measure Tem for the globe at the first 6 hours , 2=after 12 hours .; and so on 1460 *6 = 8760 hours which equals 1 year first of all I want to convert all data from kelvin to degree second I want to convert from 6 hourly to daily a