R/TcgaCancerCanBeDownFor_Rough.R

Defines functions TcgaCancerCanBeDownFor_Rough

Documented in TcgaCancerCanBeDownFor_Rough

#' @title Cancer Summary information 
#' @description Summary information of a special cancer which can be downloaded
#' @param dataset a special cancer name
#' @import rvest
#' @return DateSet
#' @export
#'
#' @examples CancerCanBeDownFor_Summary("OV")
#' 
TcgaCancerCanBeDownFor_Rough<-function(dataset){
  library(rvest)
  a_table=read_html("http://gdac.broadinstitute.org/runs/stddata__2014_01_15/ingested_data.html")
  b_tablenote=a_table %>% html_nodes("table") 
  c_noheader=html_table(x=b_tablenote,fill = TRUE,header = FALSE)[[1]]
  c_withheader=html_table(x=b_tablenote,fill = TRUE,header = TRUE)[[1]]
  number_row=grep(pattern = dataset,x = c_withheader[,1])  #which row is the cancer located
  d=c_noheader[1,][c_withheader[number_row,] != 0][-1] #return not zero
  DateSet=paste("the iterms you can download for",dataset,":",d)
  return(DateSet)
}
yikeshu0611/TCGAFamiliar documentation built on May 21, 2019, 1:45 a.m.