R-tidyverse

dplyr动词中使用外部向量

  1. # 1. Using across(all_of())
  2. vars <- c("gear", "carb", "am")
  3. mtcars %>% distinct(across(all_of(vars)), .keep_all = TRUE)
  4. # 1. unquote-splice操作符!!!
  5. mtcars %>% distinct(!!!syms(vars), .keep_all = TRUE)

R-data.table

Julia-DataFrames

选择行

使用正则表达式

  1. df3 = DataFrame(A=1:5,B=["ABCABCAB","ABC","AB","BB",missing])
  2. @rsubset df3 @passmissing occursin(r"ABC", :B)

colMean

  1. @time mean(Matrix(df_Tumour), dims=1)
  2. @time mean.(eachrow(df_Tumour))
  3. @time mean(Matrix(df_Tumour), dims=2) #faster

Python-pandas