search for: geoffrey_klein

Displaying 17 results from an estimated 17 matches for "geoffrey_klein".

2012 May 03
2
add an automatized linear regression in a function
Dear R users, For the moment, I have a script and a function which calculates correlation matrices between all my data files. Then, it chooses the best correlation for each data and take it in order to fill missing data in the analysed file (so the data from the best correlation file is put automatically into the missing data gaps of the first file (because my files are containing missing values
2012 Sep 26
5
create new column in a DF according to values from another column
Hi everyone, I have a small problem in my R-code. Imagine this DF for example: DF <- data.frame(number=c(1,4,7,3,11,16,14,17,20,19),data=c(1:10)) I would like to add a new column "Station" in this DF. This new column must be automatically filled with: "V1" or "V2" or "V3". The choice must be done on the numbers (1st column). For example, I would like
2012 Apr 03
3
filling small gaps of N/A
Hi everybody, I'm a new R french user. Sorry if my english is not perfect. Hope you'll understand my problem ;) I have to work on temperature data (35000 lines in one file) containing some missing data (N/A). Sometimes I have only 2 or 3 N/A following each other, but I have also sometimes 100 or 200 N/A following each other. Here's an example of my data, when I have only small gaps
2012 May 10
1
stop calculation in a function
Hi dear R-users, I have a question about a function I'm trying to improve. How can I stop the function calculation at the last numeric value of my data? The problem is that the end of my data contains missing values (NAs). And the aim of my function is to compare the first numeric value with the next one (till the end). For the moment, It works well when my data doesn't contains any NAs
2012 Jul 02
2
using "na.locf" from package zoo to fill NA gaps
Hi everybody, I have a small question about the function "na.locf" from the package "zoo". I saw in the help that this function is able to fill NA gaps with the last value before the NA gap (or with the next value). But it is possible to fill my NA gaps according to the last AND the next value at the same time? Actually, I want R to fill my gaps with the method of
2012 Apr 23
1
take data from a file to another according to their correlation coefficient
Hi everyone. I have a question about a work on R I have to do for my job. I have temperature data coming from 70 weather stations. One data file corresponds to one station for one year (so 70 files for one year). Each file looks like this (important: each file contains NAs): time data 01/01/2008 00:00 -0.25 01/01/2008 00:15 -0.18 01/01/2008 00:30 -0.25 01/01/2008
2012 May 21
1
select part of files from a list.files
Hi everyone. I'm working on a list of files (about 50 files). I've listed them thanks to the function: list.files. Each of my files contains 35000 lines of data. These files may also contain some missing values NA (sometimes till 10 000 NAs following each other). The aim is to do some correlation matrices between these files (I already have the script). But as I have often missing values,
2012 Dec 12
3
create a color palette with custom ranges between colors
Hello everybody, I'm trying to create my own color palette on R, in order to interpolate some different temperature data on different maps (daily means, seasonal means,...). I would like to create a color palette which works for each map, so I need a color palette between -40 and +40?C. Sometimes my data for one map range from -10 to +20, sometimes from 10 to 30, etc... but always between
2012 Jul 18
2
duplicate data between two data frames according to row names
Hi everybody. I'll first explain my problem and what I'm trying to do. Admit this example: I'm working on 5 different weather stations. I have first in one file 3 of these 5 weather stations, containing their data. Here's an example of this file: DF1 <- data.frame(station=c("ST001","ST004","ST005"),data=c(5,2,8)) And my two other stations in
2012 Jun 04
2
how to ignore NA with "NA" or "NULL"
Hello dear R-users, I have a problem in my code about ignoring NA values without removing them. I'm working on a list of files. The aim is to fill one file from another according to the highest correlation (correlation coeff between all my files, so the file which looks like the most to the one I want to fill). When I have just small gaps of NA, my function works well. The problem is when I
2012 Aug 01
4
how to calculate seasonal mean for temperatures
Hello everybody, I need to calculate seasonal means with temperature data for my work. I have 70 files coming from weather stations, which looks like this for example: startdate <- as.POSIXct("01/01/2006", format = "%d/%m/%Y") enddate <- as.POSIXct("05/01/2006", format = "%d/%m/%Y") date <- seq(from = startdate, to = enddate, by =
2012 May 31
0
ignore NA column in a DF (for calculation) without removing them
Dear users, I have for the moment a function which looks for the best correlation for each file I have in my correlation matrix. I'm working on a list.files. Here's the function: get.max.cor <- function(station, mat){ mat[row(mat) == col(mat)] <- -Inf which( mat[station, ] == max(mat[station, ],na.rm=TRUE) ) } If I have a correlation matrix like this
2012 Oct 18
1
filling NA gaps according to previous data mean and following data mean
Hi everybody, I have a little problem about filling some gaps of NAs in my data. These gaps are between nearly constant data (temperature under snow). Here's a fake example to illustrate how it looks like approximately: DF <- data.frame(data=c(-0.51,-0.51,-0.48,-0.6,-0.54,-0.38,-0.6,-0.42,NA,NA,NA,NA,NA,NA,NA, -0.25,-0.41,-0.5,-0.5,-0.35,-0.7,-1,-0.87)) I would like to replace my NAs
2012 May 29
1
correlation matrix only if enough non-NA values
Hi everybody. I'm trying to do a correlation matrix in a list of files. Each file contains 2 columns: "capt1" and "capt2". For the example, I merged all in one data.frame. My data also contains many missing data. The aim is to do a correlation matrix for the same data for course (one correlation matrix for capt1 and another for capt2). For the moment, I have a correlation
2012 Aug 09
1
How to find data in a map according to coordinates?
Hello, I have created a spatial map of temperature over an area thanks to interpolation. So I have temperature data everywhere on my map. My question is: how can I find temperature data on my map for a specific location according to coordinates? For this, I have a data frame containing 4 columns: "x" for longitude, "y" for latitude, "z" for altitude" and
2012 Apr 12
1
correlation matrix between data from different files
Dear users, I'm quite a new french R-user, and I have a problem about doing a correlation matrix. I have temperature data for each weather station of my study area and for each year (for example, a data file for the weather station N?1 for the year 2009, a data file for the N?2 for the year 2010, ....). So I have 70 weather stations with one data file per year since 2005. Each station has 4
2012 May 21
3
Prevent calculation when only NA
Hi everybody, I have a small question about R. I'm doing some correlation matrices between my files. These files contains each 4 columns of data. These data files contains missing data too. It could happen sometimes that in one file, one of the 4 columns contains only missing data NA. As I'm doing correlations between the same columns of each files, I get a correlation matrix with a