Skip to content

problem with loadMethod for lubridate in Rscript #314

@mccreigh

Description

@mccreigh

Compose the Rscript with file name lubridateTest.Rsh:

#! /usr/bin/RScript
lubridate::round_date(Sys.time(),'minute')

Run it:

jamesmcc@chimayo:~> ./lubridateTest.Rsh 
Error in x - eseconds(1) : could not find function "loadMethod"
Calls: <Anonymous> ... as.POSIXct -> ceiling_date -> floor_date -> update -> -
recover called non-interactively; frames dumped, use debugger() to view

This works however:

#! /usr/bin/RScript
library(lubridate)
lubridate::round_date(Sys.time(),'minute')

Run it:

jamesmcc@chimayo:~> ./lubridateTest.Rsh 
Loading required package: methods
[1] "2015-04-22 13:25:00 MDT"

I have no idea why, but it just is this way. I'm curious to know however.
Thanks,
J

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions