I decide to write down some interesting daily work I do with R from today on. In the past, there’ve been many times that I wanted to get a file list containing all the files in a certain directory (folder), but I find it difficult without a special software. Actually it’s extremely easy in R; just use the function list.files(), e.g.
> list.files("C:\\Documents and Settings\\Yihui Xie\\Desktop")
....
[3] Copula Structure Analysis Based on Robust and - Extreme Dependence Measures.pdf
[4] Copulae and Their Uses (2002).pdf
[5] Copulas and Credit Models (2001).pdf
[6] Correlation--Pitfalls and Alternatives (1999).pdf
[7] Correlation And Dependence In Risk Management--Properties And Pitfalls (1999).pdf
[8] Estimation Of Copula Models For Time Series Of Possibly Different Lengths (2001).pdf
[9] Estimation Procedures for a Semiparametric Family of Bivariate Copulas.pdf
[10] Financial Risk and Heavy Tails (2002).pdf
....
Sure we may write the result into a file. (Use write.table(), write.csv(), etc.) For Windows users, choose.dir() might be a helpful function to get the path of a folder, so we may as well use list.files(choose.dir()).
赞赏
作为一名没有固定工作的自由职业者,我非常感谢您通过捐赠的方式来支持我的写作和开源软件开发。当然,捐赠纯属自愿。无论金额多少,都是一片诚挚的心意。支付方式如下:
| 微信 | ← 奋力支开它俩 → | 支付宝 |
|---|---|---|
![]() |
其它爱心通道 ↓ Venmo: @yihui_xie Zelle: xie@yihui.name PayPal: xie@yihui.name |
![]() |
若使用 Venmo/Zelle/Paypal,请添加备注“gift”或“donation”,以免捐赠被视为我的可税收入。若使用 Paypal,支付类型请选 Family and Friends,而不要选 Goods and Services。
在不影响生活的前提下,我会将收到的捐赠以尽量大的比例回馈给开源社区和慈善机构。作为参考,2024-25 年间我共收到约三万美元捐赠,完税后我转手捐出了一万五千美元。

