[英]How to group commands by date and time in the history pane of RStudio?
我找到了這篇文章: https : //support.rstudio.com/hc/en-us/articles/200526217-Command-History ,它暗示RStudio開箱即用地支持日期/時間命令分組:
但是,我的看起來不是這樣的:
我需要怎么做才能進行分組?
可能是支持論壇的問題(也許是這個問題 ?),尤其是因為我在macOS上運行了RStudio的最新半天最新預覽版,而且我也看不到日期分組。
您也可以獨立於“歷史記錄”選項卡使用歷史記錄數據:
library(stringi)
library(purrr)
library(dplyr)
stri_read_lines("~/.rstudio-desktop/history_database") %>%
stri_split_fixed(":", 2) %>%
map_df(function(x) {
data_frame(ts=as.POSIXct(as.numeric(x[1])/1000, origin="1970-01-01 00:00:00"),
line=x[2]) %>%
mutate(date=as.Date(ts), hour=format(ts, "%H")) %>%
select(ts, date, hour, line)
}) -> hist_db
group_by(hist_db, date, hour)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.