Adding a new column
df$newcol <- as.Date("2020-05-20")
df$newcol[1]
## [1] "2020-05-20"
## _
## platform aarch64-apple-darwin20
## arch aarch64
## os darwin20
## system aarch64, darwin20
## status
## major 4
## minor 1.3
## year 2022
## month 03
## day 10
## svn rev 81868
## language R
## version.string R version 4.1.3 (2022-03-10)
## nickname One Push-Up
## R version 4.1.3 (2022-03-10)
## Platform: aarch64-apple-darwin20 (64-bit)
## Running under: macOS Monterey 12.2.1
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.1-arm64/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] dplyr_1.0.8
##
## loaded via a namespace (and not attached):
## [1] rstudioapi_0.13 knitr_1.39 magrittr_2.0.3 tidyselect_1.1.2
## [5] R6_2.5.1 rlang_1.0.2 fastmap_1.1.0 fansi_1.0.2
## [9] stringr_1.4.0 tools_4.1.3 xfun_0.31 utf8_1.2.2
## [13] DBI_1.1.2 cli_3.3.0 jquerylib_0.1.4 htmltools_0.5.2
## [17] ellipsis_0.3.2 assertthat_0.2.1 yaml_2.3.5 digest_0.6.29
## [21] tibble_3.1.6 lifecycle_1.0.1 crayon_1.5.0 bookdown_0.27.1
## [25] purrr_0.3.4 sass_0.4.1 vctrs_0.3.8 glue_1.6.2
## [29] evaluate_0.15 rmarkdown_2.14 stringi_1.7.6 compiler_4.1.3
## [33] bslib_0.3.1 pillar_1.7.0 generics_0.1.2 jsonlite_1.8.0
## [37] pkgconfig_2.0.3