r - R 中的 list.files() 并检查哪些是不同的/新的

标签 r difference

我知道还有另一个问题和这个问题的答案,但我找不到。

我想time_1 <- list.files()在 R 中,后来当我 time_2 <- list.files()知道哪些是新的,哪些,如果他们以前在那里,自 time_1 以来已经更新.

有谁知道这个函数的名称或如何执行任务?

(最终,我将检查这些文件的时间戳,但这可能超出了这个问题。)

> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2016.09

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] forecast_8.0      tidyr_0.6.1       highcharter_0.5.0 DT_0.2            dplyr_0.5.0       lubridate_1.6.0   jsonlite_1.3      shinythemes_1.1.1
 [9] ggthemes_3.4.0    ggfortify_0.4.1   ggplot2_2.2.1     shiny_1.0.1      

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.10      plyr_1.8.4        tseries_0.10-38   xts_0.9-7         tools_3.3.2       digest_0.6.12     tibble_1.3.0      gtable_0.2.0     
 [9] nlme_3.1-128      lattice_0.20-34   igraph_1.0.1      psych_1.7.3.21    DBI_0.6-1         yaml_2.1.14       parallel_3.3.2    gridExtra_2.2.1  
[17] stringr_1.2.0     htmlwidgets_0.8   lmtest_0.9-35     nnet_7.3-12       grid_3.3.2        data.table_1.10.4 R6_2.2.0          foreign_0.8-67   
[25] TTR_0.23-1        purrr_0.2.2       reshape2_1.4.2    magrittr_1.5      scales_0.4.1      htmltools_0.3.5   rlist_0.4.6.1     quantmod_0.4-7   
[33] assertthat_0.1    mnormt_1.5-5      timeDate_3012.100 mime_0.5          xtable_1.8-2      colorspace_1.3-2  fracdiff_1.4-2    httpuv_1.3.3     
[41] quadprog_1.5-5    stringi_1.1.3     lazyeval_0.2.0    munsell_0.4.3     broom_0.4.2       zoo_1.7-14       
> version
               _                           
platform       x86_64-redhat-linux-gnu     
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          3.2                         
year           2016                        
month          10                          
day            31                          
svn rev        71607                       
language       R                           
version.string R version 3.3.2 (2016-10-31)
nickname       Sincere Pumpkin Patch       

最佳答案

目标:

I would like to time_1 <- list.files() in R, and later when I time_2 <- list.files() know which are new and which, if they were in there before, have been updated since time_1.

看起来这包含在基础包 utils 中。参见 ?fileSnapshot?changedFiles :

The fileSnapshot function uses list.files to obtain a list of files, and depending on the file.info, md5sum, and digest arguments, records information about each file.

The changedFiles function compares two snapshots.

关于r - R 中的 list.files() 并检查哪些是不同的/新的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43264917/

相关文章:

r - 在 R 中合并多个表

R包ReporteRs : how to let it show cell padding in generated . docx文档?

R 为什么在 period.apply 使用函数 "mean with condition"时出现错误结果

r - 使用 R 根据多个标准从文本中提取句子

scala - Scala 中这两个代码片段有什么区别

r - 来自多个 if/else if 语句的多个操作 - R

cmake - 包与库

java - ehcache 和 ehcache-core 的区别

python - 计算 DataFrame Pandas 中 'times' 行之间的差异

javascript - 下划线差异不适用于 JSON 对象数组