First I installed lubridate:
install.packages("lubridate") Installing package into ‘C:/Users/Llorenc Piera/AppData/Roaming/SPB_Data/R/win-library/3.4’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/lubridate_1.7.4.zip' Content type 'application/zip' length 1365606 bytes (1.3 MB) downloaded 1.3 MB
package ‘lubridate’ successfully unpacked and MD5 sums checked
Warning in install.packages : cannot remove prior installation of package ‘lubridate’
Then I try to run:
dmy_hm('01-01-2012 12:12')
and get:
Error in dmy_hm("01-01-2012 12:12") : could not find function "dmy_hm"
This used to work in my computer a few weeks ago, but not any more.
Howerver, if I run:
lubridate::dmy_hm('01-01-2012 12:12')
I get
[1] "2012-01-01 12:12:00 UTC"
But using 'lubridate::' is not good for me since it does not work inside other functions