as.Date
is calling the 1 to 9 as NA as it is expects two digits for the week number and can’t properly parse it.
To fix it, add in some – to split things up:
as.Date(paste(2014, df$Week, 1, sep="-"), "%Y-%U-%u")
More Related Contents:
- r: convert a string to date [duplicate]
- Convert date-time string to class Date
- What are the “standard unambiguous date” formats for string-to-date conversion in R?
- R Convert to date from multiple formats
- Reshaping data.frame from wide to long format
- Combine two data frames by rows (rbind) when they have different sets of columns
- How to combine multiple conditions to subset a data-frame using “OR”?
- How to merge 2 vectors alternating indexes?
- How to put labels over geom_bar in R with ggplot2
- Wrap long axis labels via labeller=label_wrap in ggplot2
- Access variable value where the name of variable is stored in a string
- Converting decimal to binary in R?
- How to read in numbers with a comma as decimal separator?
- R Shiny – add tabPanel to tabsetPanel dynamically (with the use of renderUI)
- How to generate a number of most distinctive colors in R?
- Keeping trailing zeros
- Bar plot with log scales
- Passing command line arguments to R CMD BATCH
- How to change order of boxplots when using ggplot2?
- Using stargazer with Rstudio and Knitr
- listing contents of an R data file without loading
- How do you determine the namespace of a function?
- R: Plotting a 3D surface from x, y, z
- How to fill with different colors between two lines? (originally: fill geom_polygon with different colors above and below y = 0 (or any other value)?)
- ggplot geom_point() with colors based on specific, discrete values
- For the same code, labels (q1, median) appear on one computer but don’t appear on another computer
- GGplot custom scale transformation with custom ticks
- R programming: cache the inverse of a matrix
- Multiply columns in a data frame by a vector
- R – What algorithm does geom_density() use and how to extract points/equation of curves?