Despite reading several topics as listed bellow, I did not find my answer:
R keep data frame attributes after join
How to join (merge) data frames (inner, outer, left, right)
I have two txt files containing Year, Month, Day, and two types of weather info (precipitation, and minimum temperature):
You could download these two simple txt files here:
I try to join these two data frames using this code:
library(dplyr)
setwd("C:/Users/Climate_Data")
Alberta_Pr <- read.csv("pr_day_Alberta.txt", header=TRUE, sep="\t")
head(Alberta_Pr)
Alberta_Tasmin <- read.csv("tasmin_day_Alberta.txt", header=TRUE, sep="\t")
head(Alberta_Tasmin)
Joined_data <- full_join(Alberta_Pr, Alberta_Tasmin, by = c("Year", "Month", "Day"))
head(Joined_data)
But using full_join function, remove zeros from month and day columns:
How can I keep the data as it is?
Yours comments or answers would be highly appreciated.