• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonrubyphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Commit MetaInfo

Revision8463800b0ebc451a225370be0ec3ba7219111e23 (tree)
Time2022-06-23 23:50:14
AuthorLorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

I added a function to deal with the tsv files.

Change Summary

Incremental Difference

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=".", ...){