Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从R中的POSIXlt date对象访问小时、分钟等单个属性? sampleDate_R - Fatal编程技术网

如何从R中的POSIXlt date对象访问小时、分钟等单个属性? sampleDate

如何从R中的POSIXlt date对象访问小时、分钟等单个属性? sampleDate,r,R,好的,我找到了答案 sampleDate <- "08/15/2015 00:00" sampleDateObject <- strptime(sampleDate, "%m/%d/%Y %H:%M") 要访问其他属性,请选中此页面 sampleDateObject[['year']] 将返回115,这是1900年之后的年数。有关详细信息,请参见?POSIXlt sampleDateObject$mon # to access month from 0-11

好的,我找到了答案

sampleDate <- "08/15/2015 00:00"
sampleDateObject <- strptime(sampleDate, "%m/%d/%Y %H:%M")
要访问其他属性,请选中此页面

sampleDateObject[['year']]

将返回115,这是1900年之后的年数。有关详细信息,请参见
?POSIXlt

sampleDateObject$mon # to access month from 0-11