This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > winCmd <- 'R -q -e "11+1; 1+undef_var; 12+2"' | |
| > pp <- pipe(winCmd, open='r') | |
| > readLines(pp) # does not return any error message and freezes | |
| [1] "> 11+1; 1+undef_var; 12+2" "[1] 12" | |
| > close(pp) | |
| > winCmd <- 'R -q -e "11+1; 1+undef_var; 12+2" 2>&1' | |
| > pp <- pipe(winCmd, open='r') | |
| > readLines(pp) # works fine | |
| [1] "> 11+1; 1+undef_var; 12+2" "[1] 12" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > ls() | |
| character(0) | |
| > foo <- function() list(a=1, b=2) | |
| > invisible(list2env(foo(), envir = environment())) | |
| > ls() | |
| [1] "a" "b" "foo" | |
| > rm(list=ls()) | |
| > foo <- function() list(1, 2) | |
| > invisible(list2env(mapply(assign, c('c', 'd'), foo(), SIMPLIFY = F), envir=environment())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| registerDoParallel(cores=2) | |
| rf.mod <- foreach(ntree=rep(500, 6), .combine=combine, .multicombine=TRUE, | |
| .packages='randomForest') %dopar% { | |
| randomForest(ЗДЕСЬКАКОБЫЧНО) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object_size(stat) * 2**30 / nrow(stat) / ncol(stat) # 8.59 | |
| 2**30 / 8.59 # 125 * 1e6 | |
| nrow(X) * ncol(X) / 125 / 1e6 # 80 Gb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| methods('format') | |
| getAnywhere('format.facet') # == ggplot2:::format.facet | |
| class(dtm) | |
| [1] "TermDocumentMatrix" "simple_triplet_matrix" | |
| getAnywhere(as.matrix.simple_triplet_matrix) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach::registerDoSEQ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Patch for Windows https://cran.r-project.org/bin/windows/base/rtest.html | |
| Otherwise you can close all file explorer windows :) | |
| This bug appeares when R tryes to get modification date for C:\Users\<SomeUser>\Documents\R\win-library\3.4 folder (my case). | |
| More precisely for one of .libPaths() | |
| For R 3.4.0 it can be NA for an open folder (open = locked by another process). NA in if() gives the error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Just rerun the previous command one more time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| list(a=1, b=if (F) 2) %>% Filter(function(x) !is.null(x), .) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| debug(caret::createModel) | |
| pay attention to model$fit: https://github.com/topepo/caret/blob/master/pkg/caret/R/createModel.R#L46 | |
| If <some_name> == 'param' and you use do.call(caret::train, arg_list), pass parameters in 'param' without list, as is. | |
| Anyway, the important part of the stacktrace is: | |
| 1. caret::train.default | |
| 2. caret::createModel # <- the location of the problem | |
| 3. model$fit |
OlderNewer