Re: [R] take data from a file to another according to their correlation coefficient

2012-05-03 Thread jeff6868
Hi Rui it's me again. I would have another question in the function process.all you explained me. But as you already helped me a lot, and as I promised I won't disturb you again, I want to ask you first if you accept to help me one more time before telling you more precisely my problem (about

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-26 Thread jeff6868
Hello Rui, For the write.table, it's OK! And for the second one (for the 2nd best correlation) seems to work great! You're too strong ^^ I have to check a bit more to be sure, but it seems to do it! If you come in the Alps, it will be more liqueurs such as Chartreuse or Génépi (from mountain

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-25 Thread jeff6868
Seems to work great! I have a last question (or 2) for you about it, and I will leave you alone afterwords, I promise :) I tested your function process.all for the automatization. It seems to be OK. It's just when I'd like to save the filled data files. If I name process.all, for example: test

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-25 Thread Rui Barradas
Hello, The first is easy. How can I cut these files and save them automatically (one file for ST001, another for ST002, ...) according to these columns names? Similar to the way they were read, using lapply on the results list. But first make a file names vector. (I've used the file

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-24 Thread jeff6868
Hi again Rui, I tested your script as you wrote it with my examples, it works perfectly! It seems to be exactly what I'm trying to do. I just have a question about your function na.fill. When I'm trying to apply your script to my data, it doesn't work. I think it's because in your example, you

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-24 Thread Rui Barradas
Hello, Try putting the function call in a lapply, along lst - lapply(list.files(path, pattern), read.table, header=TRUE, stringsAsFactors=FALSE) You don't stricktly need a list for na.fill, but you do need two data.frames, not filenames. The list is used by the other functions. (It's also a

[R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread jeff6868
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

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread Sarah Goslee
Hi, Even your example should show why this is a bad way to fill in missing weather data: you end up with a sequence for station 1 of 1, 2, 10, 4 even though that's certainly wrong because Station 2 is reliably 7 units above Station 1. Correlated doesn't mean identical. There are other better

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread jeff6868
Hi Sarah, Thank you for your answer. Yes I know that my proposition is not necessary the better way to do it. But my problem concerns only big gaps of course (more than half a day of missing data, till several months of missing data). I've already filled small gaps with the interpolation that you

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread jeff6868
Hi Rui, Yes you're right. It's me again ^^ This post is the last part (I hope) of my job. You helped me a lot last time for the correlation matrices. I have to leave my work now, so I'll check and test your proposition tomorrow. But it makes no doubt that it'll help me a lot again. I'll tell

Re: [R] take data from a file to another according to their correlation coefficient

2012-04-23 Thread Rui Barradas
Hello, jeff6868 wrote Hi Sarah, Thank you for your answer. Yes I know that my proposition is not necessary the better way to do it. But my problem concerns only big gaps of course (more than half a day of missing data, till several months of missing data). I've already filled small