This file contains 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
library(devtools) | |
devtools::install_github('RTCGA/RTCGA') | |
library(RTCGA) | |
installTCGA('RTCGA.clinical') | |
installTCGA('RTCGA.rnaseq') | |
library(RTCGA.rnaseq) | |
library(RTCGA.clinical) | |
library(dplyr) | |
survivalTCGA(BRCA.clinical) %>% |
This file contains 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
library(VennDiagram) | |
venn.diagram(list(first = c("a", "b", "c"), | |
second = c("a", "c", "d"), | |
third = c("a", "d")) | |
imagetype = "png", | |
col = "transparent", | |
filename = "example.png", | |
height = 2000, | |
width = 2000, |
This file contains 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
library(shiny) | |
library(shinydashboard) | |
ui <- dashboardPage( | |
dashboardHeader(), | |
dashboardSidebar( | |
sidebarMenu( | |
menuItem( | |
"Comments", | |
tabName = "disqus_here", | |
icon = icon("info") |
This file contains 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
library(stringi) | |
library(stringr) | |
library(rvest) | |
aktualne_oferty <- function(link) { | |
linki<-read_html(link) %>% | |
html_nodes('.href-link') %>% |
This file contains 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
devtools::install_github("kassambara/survminer", build_vignettes = TRUE) | |
library("survminer") | |
library("survival") | |
fit<- survfit(Surv(time, status) ~ sex, data = lung) | |
ggsurvplot( | |
fit, # survfit object with calculated statistics. | |
risk.table = TRUE, # show risk table. | |
pval = TRUE, # show p-value of log-rank test. | |
conf.int = TRUE, # show confidence intervals for | |
# point estimaes of survival curves. |
This file contains 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
# install.packages(c('magrittr', 'FSelectorRcpp')) | |
library(magrittr) | |
library(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. |
This file contains 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
library(coxphSGD) | |
library(survival) | |
library(reshape2) | |
set.seed(456) | |
x <- matrix(sample(0:1, size = 20000, replace = TRUE), ncol = 2) | |
head(x) | |
dCox <- dataCox(10^4, lambda = 3, rho = 2, x, | |
beta = c(2,2), cens.rate = 5) | |
head(dCox) |
This file contains 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
extractSurvival <- function(cohorts){ | |
survivalData <- list() | |
for(i in cohorts){ | |
get(paste0(i, ".clinical"), envir = .GlobalEnv) %>% | |
select(patient.bcr_patient_barcode, | |
patient.vital_status, | |
patient.days_to_last_followup, | |
patient.days_to_death ) %>% | |
mutate(bcr_patient_barcode = toupper(patient.bcr_patient_barcode), |
This file contains 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
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 |
This file contains 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
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. | |
conf.int = 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. | |
break.time.by = 500, # break X axis in time intervals by 500. |
OlderNewer