I have a 65 years weather data. Where in one column the years are mentioned and in another column Months are mentioned in numeric like 1,2,3,...I am struggling to convert it into time series data set. How can I create the dates?
Asked
Active
Viewed 251 times
0
-
Can you provide a 6 row example dataframe with 2 columns: 'year' and 'month'? Also show what else is relevant to your problem if I missed something. Edit: No images please. See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – markus Mar 10 '22 at 12:09
-
I have attached the pic of the data frame..Plz have a look – Abu Shahdat Md. Ibrahim Mar 10 '22 at 12:11
-
Take a look at https://stackoverflow.com/questions/26334763/merge-three-different-columns-into-a-date-in-r – markus Mar 10 '22 at 12:13
-
There is no day column...only year and month column...Then how can I create time series? – Abu Shahdat Md. Ibrahim Mar 10 '22 at 12:16
-
1Start with `paste0(YEAR, Month, "01", sep = "/")` – markus Mar 10 '22 at 12:20
-
I tried in this way but still could not make it...wt$date<-as.Date(with(wt,paste0(YEAR,Month,"01",sep="/")),"%Y-%m-%d")Showing
-
Hey ...I'm struggling...Plz tell me how to convert YEAR and Month column into time series data – Abu Shahdat Md. Ibrahim Mar 10 '22 at 18:33
-
Hey Abu, please see my first comment and share data in reproducible form. That makes it much easier to help you. – markus Mar 10 '22 at 19:45
-
Hi I am trying to attach the csv file...But can't find any option other than attaching an image.. what can I do?? – Abu Shahdat Md. Ibrahim Mar 10 '22 at 20:24