• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版8463800b0ebc451a225370be0ec3ba7219111e23 (tree)
时间2022-06-23 23:50:14
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I added a function to deal with the tsv files.

更改概述

差异

diff -r 0045aecc0169 -r 8463800b0ebc R-codes/stat_lib.R
--- a/R-codes/stat_lib.R Wed Jun 22 13:45:56 2022 +0200
+++ b/R-codes/stat_lib.R Thu Jun 23 16:50:14 2022 +0200
@@ -215,6 +215,37 @@
215215 }
216216
217217
218+read_tsv_to_char <- function(x, ...){
219+
220+ res <- read_tsv(x, ...) %>%
221+ as_tibble %>%
222+ all_to_char()
223+
224+ return(res)
225+
226+
227+}
228+
229+
230+
231+
232+read_all_tsv_to_char <- function( mypath=".", pattern="*tsv", ...){
233+
234+
235+f <- list.files(
236+ mypath,
237+ pattern,
238+ full.names = TRUE)
239+
240+d <- purrr::map_df(f, read_tsv_to_char, .id = "id", ...)
241+
242+return(d)
243+
244+
245+}
246+
247+
248+
218249 ## same but for any files
219250
220251 read_all_extensions <- function( extension, mypath=".", ...){