I would like to create a dataframe merging the dataframe ss to a vector daily_vector, with date information, through the column "ss$Date_R". I would like to keep all rows from daily_vector to know which date in the dataframe ss has no data. I have tried use the function mergehowever when I tried it the vector apears as a list of numbers and not like the date.
The column "ss$Date_R" is a character column buecause I concatenated the information of the years, months and days.
head(ss)
Station Variable Value Date_R
1 SAN VICENTE DEL PALACIO TMAX1 90 1985-01-01
910 SAN VICENTE DEL PALACIO TMAX2 90 1985-01-02
1819 SAN VICENTE DEL PALACIO TMAX3 110 1985-01-03
2728 SAN VICENTE DEL PALACIO TMAX4 85 1985-01-04
3637 SAN VICENTE DEL PALACIO TMAX5 110 1985-01-05
4546 SAN VICENTE DEL PALACIO TMAX6 100 1985-01-06
str(ss)
'data.frame': 9418 obs. of 4 variables:
$ Station : Factor w/ 3 levels "MEDINA DE RIOSECO",..: 2 2 2 2 2 2 2 2 2 2 ...
$ Variable: Factor w/ 31 levels "TMAX1","TMAX2",..: 1 2 3 4 5 6 7 8 9 10 ...
$ Value : int 90 90 110 85 110 100 80 30 80 70 ...
$ Date_R : chr "1985-01-01" "1985-01-02" "1985-01-03" "1985-01-04" ...
daily_vector <-as.factor(seq(as.Date("1985-01-01"), as.Date("2010-10-14"), by="days"))
Does someone know how I can merge these two kinds of information?
Do you know a better way to know which day are absent in the dataframe ss?
Thanks in advance
Date_Rand thenmergebyDate_Rdput, provide a portion of your data and daily_vector?