[R] R combining vectors into a data frame but without a continuous common variable

lucy88 lucy.foggin at gmail.com
Thu Oct 4 13:18:21 CEST 2012


Hello,

I have two different files which I'd like to combine to make one data frame
but I've no idea how to do it! The first file has two columns; one is the
date, the following is a binary code for debris flow events. Then my other
file has also two columns; the date and then precipitation data.

The thing is, is that the two date columns don't all contain the same dates.
The binary one is every day from April - October from 1900 - 2005, yet the
precipitation file has dates from from say, 1911 to 2004, with some missing
data on certain months and during certain years.

So my question is how to make a data frame which would have the date, the
binary 0 or 1, and then the corresponding precip value from that particular
date. I only want the precip information for the days where I have
information in the binary file; the others can be disregarded.

I have tried using codes which I found in answer to other questions asked
but none of them work with my issue. If I'm honest I don't really know if
this is what I need. I'm hoping to end up doing a logistic regression. I've
uploaded the two files in case I've not been very clear...

I'd be really grateful if anyone could help me and suggest a way to do it!
I'm also really not very technical and am not at all comfortable with R so
if you could be really basic in your advice I'd appreciate it!

Many thanks in advance,
Lucy

Landeck_vec.txt
<http://r.789695.n4.nabble.com/file/n4644986/Landeck_vec.txt>  

Kaurnetal_vec.txt
<http://r.789695.n4.nabble.com/file/n4644986/Kaurnetal_vec.txt>  




--
View this message in context: http://r.789695.n4.nabble.com/R-combining-vectors-into-a-data-frame-but-without-a-continuous-common-variable-tp4644986.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list