Skip to content

Instantly share code, notes, and snippets.

Marcin Kosiński MarcinKosinski

Block or report user

Report or block MarcinKosinski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mail_through_mailR
sender <- ""
recipient <- ""
send.mail(from = sender,
to = recipient,
subject = "Subject",
body = "Hello World!",
smtp = list( = "", port = 465, = "",
passwd = pwd,
View polish stemming
download.file('', destfile = '')
unzip('', exdir = 'dicts')
polimorfologik <- fread('dicts/polimorfologik-2.1.txt', data.table = FALSE) %>% set_colnames(c('stem', 'words', 'random_stuff')) %>% select(1:2)
random_polish_text <-
'Wbrew wcześniejszym doniesieniom mediów, w bazie pod Latok I (szczyt w masywie w grupie Panmah Muztagh, części Karakorum), gdzie organizowana jest pomoc dla Aleksandra Gukowa (rosyjski himalaista nadał sygnał SOS i musi zostać ewakuowany, bo jest pozbawiony ekwipunku), nie ma też Andrzeja Bargiela. - Andrzej zgłosił chęć pomocy i wzięcia udziału w akcji ratunkowej. Jednak obecnie znajduje się w Skardu, gdzie dotarł wczoraj z bazy pod K2 - czytamy na twitterowym koncie pierwszego człowieka w historii, który zjechał z wierzchołka K2.'
(polish_stop_words <- readLines('
View generate_ids_from_csv
View add data.frame to CrunchDataset
iris_ds <-
newDataset(iris, name = 'iris')
# how to add the following data.frame as a CrunchCube or something similar to the Array?
iris_ds$some_statistics <-
iris %>%
group_by(Species) %>%
View ggsurvplot_example.R
ggsurv <- ggsurvplot(
fit, # survfit object with calculated statistics.
data = BRCAOV.survInfo, # data used to fit survival curves.
risk.table = TRUE, # show risk table.
pval = TRUE, # show p-value of log-rank test. = TRUE, # show confidence intervals
xlim = c(0,2000), # present narrower X axis, but not affect
# survival estimates.
xlab = "Time in days", # customize X axis label. = 500, # break X axis in time intervals by 500.
View america_is_on_the_move.R
library(rgdal) # read and store spatial data
library(dplyr) # manipulate data frames for data wrangling
library(leaflet) # connect to LeafletJS library from R
library(magrittr) # pipe workflows
library(openxlsx) # read xlsx files
library(readxl) # read xls files
# prepare the data ------------------------------------------------------------
# read MSA layer
View provide_genomic_analysis_on_tcga_mutations_data.R
extractSurvival <- function(cohorts){
survivalData <- list()
for(i in cohorts){
get(paste0(i, ".clinical"), envir = .GlobalEnv) %>%
patient.days_to_death ) %>%
mutate(bcr_patient_barcode = toupper(patient.bcr_patient_barcode),
View plot_coxphSGD_estimates
x <- matrix(sample(0:1, size = 20000, replace = TRUE), ncol = 2)
dCox <- dataCox(10^4, lambda = 3, rho = 2, x,
beta = c(2,2), cens.rate = 5)
View FSelectorRcpp_1
# install.packages(c('magrittr', 'FSelectorRcpp'))
information_gain( # Calculate the score for each attribute
formula = Species ~ ., # that is on the right side of the formula.
data = iris, # Attributes must exist in the passed data.
type = "infogain", # Choose the type of a score to be calculated.
threads = 2 # Set number of threads in a parallel backend.
) %>%
cut_attrs( # Then take attributes with the highest rank.
View survminer_playing_with_fonts_and_text.R
devtools::install_github("kassambara/survminer", build_vignettes = TRUE)
fit<- survfit(Surv(time, status) ~ sex, data = lung)
fit, # survfit object with calculated statistics.
risk.table = TRUE, # show risk table.
pval = TRUE, # show p-value of log-rank test. = TRUE, # show confidence intervals for
# point estimaes of survival curves.
You can’t perform that action at this time.