In my dataset all the dates are written like this 20150101, 20150102, 20150103. I want to change that to %m-%d-%Y but it says my input string is too long. Does anybody know how?
library(tidyverse)
library(dplyr)
library(stringr)
library(plyr)
library(ggplot2)
library(tidyr)
wind <- read_csv("KNMI wind.csv")
glimpse(wind_schoon)
wind_schoon <- separate(wind, col = 1,
into = c("Station", "Date", "Windsnelheid (in 0,1 m/s)"),
sep = ";")
wind_schoon[is.na(wind_schoon)] <- 0
#Wind data omzetten
wind_schoon$`Windsnelheid (in 0,1 m/s)` <- as.integer(as.character(wind_schoon$`Windsnelheid (in 0,1 m/s)`))
wind_schoon$Station <- as.numeric(as.character(wind_schoon$Station))
wind_schoon$Date <- strptime(wind_schoon, format = "%m-%d-%Y")