r - getAnywhere("timestamp") finds two functions from within Rstudio -
i trying call timestamp
function in rstudio seem calling version other 1 want. getanywhere
shows there 2 definitions:
> getanywhere(timestamp) 2 differing objects matching ‘timestamp’ found in following places package:utils namespace:utils use [] view 1 of them > timestamp function(...) .rs.callas(name, hook, original, ...) <environment: 0x0000000005f42030> > timestamp() ##------ thu mar 06 15:08:51 2014 ------## > utils::timestamp function (stamp = date(), prefix = "##------ ", suffix = " ------##", quiet = false) { stamp <- paste0(prefix, stamp, suffix) .external2(c_addhistory, stamp) if (!quiet) cat(stamp, sep = "\n") invisible(stamp) } <bytecode: 0x0000000005f447a8> <environment: namespace:utils>
calling utils::timestamp()
crashes rstudio. if call timestamp
, seems ignore parameters, though.
> timestamp(prefix = "##-ddg-- ", quiet=true)
this not change prefix associated timestamp
, , returns output console, should not when quiet true.
this running r 3.0.1, rstudio 0.97.551, windows 7 enterprise service pack 1.
on mac, getanywhere
gives different result , timestamp
function works correctly.
> getanywhere(timestamp) single object matching ‘timestamp’ found found in following places package:utils namespace:utils value function (stamp = date(), prefix = "##------ ", suffix = " ------##", quiet = false) { stamp <- paste0(prefix, stamp, suffix) .external2(c_addhistory, stamp) if (!quiet) cat(stamp, sep = "\n") invisible(stamp) } <bytecode: 0x7fd90b10bdb8> <environment: namespace:utils>
where second definition coming on windows? how r call right version?
thanks help.
barbara
in comments jonathan answers where second definition coming on windows? , crashing parts of question with
on windows rstudio replaces timestamp own method because default method has dependencies aren't met in rstudio environment (which causes crash see when invoke directly). method replacement timestamp, however, not wrapper, , replacement doesn't support parameters of original. i'd encourage report problem on rstudio support forum.
which have confirmed on rstudio support page. reported on earlier rstudio support thread.
unfortunately, rstudio's bug database looks internal need monitor following commit history or release notes latest version or preview release.
Comments
Post a Comment