用R更改为日期格式

时间:2017-12-12 12:51:32

标签: r date

我的列表中包含具有此格式值的列:mx6q:/sys/class/gpio/gpio200# echo "out" > direction <-- set the direction as write(out) mx6q:/sys/class/gpio/gpio200# cat direction < -- just to verify out mx6q:/sys/class/gpio/gpio200# echo 1 > value < -- set value as 1(high) mx6q:/sys/class/gpio/gpio200# cat value 1 mx6q:/sys/class/gpio/gpio200# echo 0 > value < -- set value Low again mx6q:/sys/class/gpio/gpio200# cat value 0 mx6q:/sys/class/gpio/gpio200# cat direction out mx6q:/sys/class/gpio/gpio200# echo "in" > direction < -- change the direction to read the pin mx6q:/sys/class/gpio/gpio200# cat direction in mx6q:/sys/class/gpio/gpio200# cat value < -- what i am expecting here is 0 (last set value) 1 。此列的类型称为11/1/2017 0:00。如何将此日期更改为integer

由于

1 个答案:

答案 0 :(得分:0)

x <- lubridate::mdy_hm(x) 
x <- sprintf("%s/%s", lubridate::month(x), lubridate::day(x))