Displaying 20 results from an estimated 5000 matches similar to: "Min , Max"
2012 May 24
6
R does not recognise columns and rows as they are supposed to be
Dear All,
The code given bellow is to extract values of one region and write that to
a text file(there are 365 binary files in the directory).
The problem which I am facing is that all my files are binary with size of
360 rows and 720 columns.
I specified that in this line: file2<-matrix(data=file,ncol=720,nrow=360)
but I got an error : Error in mean(file2[X, Y], na.rm = TRUE) : subscript
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
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 <- do.call(rbind,(lapply(.files, readBin ,
2012 May 28
1
Why R order files as 1 10 100 not 1 2 3 ?
The code given below worked well. However, the problem is that when I typed
dir1 to see the results I found that R order the files as:
[1] "data1.flt" "data10.flt" "data100.flt" "data101.flt"
[5] "data102.flt" "data103.flt" "data104.flt" "data105.flt"
[9] "data106.flt" "data107.flt"
2012 Apr 06
2
read multiaple files within one folder
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 files . I need those 365 files to be in one new folder for
later use in my model
I tried using this
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
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?
I have nc files for global soil moisture,here is one file
https://echange-fichiers.inra.fr/get?k=f9DDllPKdUKs5ZNQwfq
from the metadata ,the projection is cylindrical and the resolution is 25
km(it is based on authalic sphere based on International 1924 ellipsoid).As
I want to compare with other data, I have to make them identical.
- my other data are in WGS84 with 0.25*0.25 degree resolution
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)
2013 Mar 04
1
How to loop several binary files from two directories?
I have two binary files(rasters) with the same dimensions. The first file is
called `over` and the second is `corr`. I want to replace values in `over`
by `NA` whenever `corr` is greater than 0.5.
to read the two files we can use:
conne <- file("C:corr.bin","rb")
over <- readBin(conne, numeric(), size=4, n=1440*720, signed=TRUE)
frf <-
2015 Mar 11
3
7-Zip for CentOS X86-64
Hey Y'all,
I'm looking at ZCad:
http://sourceforge.net/projects/zcad/?source=directory
It looks like the kind of 3D CAD package that I've been looking for. It
says that it works on Linux but it's zipped with 7-Zip which doesn't
seem to be available for CentOS.
Does anyone know if ZCAD or 7-Zip is packaged for CentOS X86-64
somewhere out there?
--
_
?v?
/(_)\
^
2013 Feb 22
2
How to merge two functions into one?
I am using the code below to calculate the correlation map between two
datasets. This code worked fine.
dir1 <- list.files("D:thly", "*.bin", full.names = TRUE)
dir2 <- list.files("D:002", "*.envi", full.names = TRUE)
file_tot <- array(dim = c(1440, 720, 11, 2))
for(i in 1:length(dir1)) {
file_tot[, , i, 1] <-
2002 May 17
3
Rsync dies
I?m trying to rsync a 210 GB Filesystem with approx 1.500.000 Files.
Rsync always dies after about 29 GB without any error messages.
I?m Using rsync version 2.5.5 protocol version 26.
Has anyone an idea ?
Thank?s Clemens
2013 Jan 17
2
How to calculate monthly average from daily files in R?
I have 365 binary files:
https://echange-fichiers.inra.fr/get?k=oy3CN1yV1Um7ouRWm2U ,I want to
calculate the monthly average. So from the 365 files, I will get 12 files.I
would like also to tell R not to take into account the no-data value
(-32765).for example, for the first month, there are 31 records: 3 of these
records has the value -32765,I want R to take the average of the rest
records(28
2012 Apr 25
0
locate values to their positions based on their pixel and line in other files
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 point in file C(so both they have 1 row and 67420rows).Now I will
create a new matrix ,M ,which has
2013 Mar 31
1
How to represent certain values in a file as we want?
I have a raster file(1440*720 rows) contains values of 1 ,2 , and 3. when I
plot the file , I got a map of three colors but I do not know which is
which. How can I put those colors as as I want :
1=red
2=blue
3=green
code:
pvm <- file("C:\\User_sm-das.bin","rb")
cor1<- readBin(pvm, numeric(), size=4, n=1440*720, signed=TRUE)
r <-raster(t(matrix((data=cor1),
2013 Feb 18
1
How to calculate the moving average for binary files?
I have 12 binary (raster) files
https://echange-fichiers.inra.fr/get?k=k3M2jatJyHy65Cs99G4 .
I would like to calculate the moving average for the 12 values for each
pixel in the 12 files.
For a simple vector we can get a moving average by using this :
x <- c(1,2,3,NA,NA,4,6,5,6,4,2,5)
movingmean <- rollapply(x, 3, FUN = mean, na.rm = T,fill=NA)
now
2002 Jul 30
2
Rsync recursion
Hello,
I'm trying to break up my rsync process by separating a directory tree
into multiple rsync processes because I'm witnessing some errors trying
to rsync large directory trees on Windows machines. After breaking up
the tree I tried to rsync each individual directory starting from the
bottom directory on up using the command:
foreach ($array as $directory){ /* $array = list of
2009 May 18
2
readBin on binary non-blocking connections (Windows & Unix differences/bugs)
R-devel:
I am encountering a consistency issue using socketConnection and
readBin with *non-blocking* connections on Unix and Windows XP (no
Vista to test).
I am a bit confused by the behavior of *non-blocking* connections
under Windows specifically. When calling readBin on a non-blocking
connection when there is no data to read on the socket, the connection
under Unix will return a vector of
2006 Jun 28
2
read file with readBin (the file was saved with a C-routine)
Hello!
I have problems with using of "readBin" to read files, which was written in C with "fwrite". In the C-File there is the following Code:
fwrite(MyitINI,sizeof(itINItype),1,outfile);
where MyitINI is a structure of the following form
typedef struct{
int KernelFileSave; /* Determined, if Systemmatrix saved or not.*/
char KernelFileName[200]; /* A-Matrix name
2004 Jun 01
2
Importing binary data
Hi everybody!
I've a large dataset, about 2 Mio entries of the format which I would like
to import into a frame:
<integer><integer><float><string><float><string><string>
Because to the huge data amount I've choosen a binary format instead
of a text format when exporting from Matlab.
My import function is attached below. It works fine for only