man/plotCellMiner2D.Rd
08f1390e
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/plotCellMiner2D.R
 \name{plotCellMiner2D}
 \alias{plotCellMiner2D}
 \title{Make a simple 2d plot using two variables with ggplot2}
 \usage{
904cd2ee
 plotCellMiner2D(df, xCol = "x", yCol = "y", xLabel = xCol,
   yLabel = yCol, title = NULL, colorPalette = NULL, classCol = NULL,
   tooltipCol = NULL, showLegend = FALSE, showTrendLine = TRUE,
2e575382
   showTitle = TRUE, alpha = 1, numberColPrefix = "X")
08f1390e
 }
 \arguments{
 \item{df}{a data.frame with at least two columns}
 
904cd2ee
 \item{xCol}{the name of the column in df with the "x" data. See Note}
08f1390e
 
904cd2ee
 \item{yCol}{the name of the column in df with the "y" data. See Note}
08f1390e
 
904cd2ee
 \item{xLabel}{the x plot label}
08f1390e
 
904cd2ee
 \item{yLabel}{the y plot label}
08f1390e
 
904cd2ee
 \item{title}{the plot title, if null the correlation will appear (DEFAULT: NULL)}
08f1390e
 
904cd2ee
 \item{colorPalette}{a named vector with the names classes and value colors (DEFAULT: NULL)}
08f1390e
 
904cd2ee
 \item{classCol}{the name of the column with the classes. Values in column of df must be a factor (DEFAULT: NULL)}
 
 \item{showLegend}{boolean, whether to show the legend (DEFAULT: FALSE)}
08f1390e
 
 \item{showTrendLine}{boolean, whether to show the trendline}
 
904cd2ee
 \item{showTitle}{boolean, whether to show the title}
 
 \item{alpha}{value from 0-1, where 0 indicates transparent points}
2e575382
 
 \item{numberColPrefix}{a prefix to add to column names that start with a number that causes issues with ggplot (DEFAULT: X)}
08f1390e
 }
 \value{
 a ggplot object
 }
 \description{
 Make a simple 2d plot using two variables with ggplot2
 }
904cd2ee
 \note{
 Uses ggplot aes_string() which uses parse() to turn your text expression into a proper R symbol that can be resolved within the data.frame. Avoid numbers and spaces in
 }
08f1390e
 \examples{
 \dontrun{
 # Load data
 nci60DrugActZ <- exprs(getAct(rcellminerData::drugData))
 nci60GeneExpZ <- getAllFeatureData(rcellminerData::molData)[["exp"]]
 # Load colors
 colorTab <- loadNciColorSet(returnDf=TRUE)
 tissueColorTab <- unique(colorTab[, c("tissues", "colors")])
 # Merge data
 df <- as.data.frame(t(rbind(nci60DrugActZ["94600",], nci60GeneExpZ["SLFN11",])))
 colnames(df) <- c("y", "x")
 df <- cbind(df, colorTab)
 # Plot data
904cd2ee
 plotCellMiner2D(df, xCol="x", yCol="y", xLabel="SLFN11", yLabel="94600")
08f1390e
 plotCellMiner2D(df, xCol="x", yCol="y", showTrendLine = FALSE, showTitle = FALSE)
 plotCellMiner2D(df, xCol="x", yCol="y", showTrendLine = FALSE, showLegend = FALSE)
 }
 
 }
 \author{
 Augustin Luna <augustin AT mail.nih.gov>
 }
 \concept{
 rcellminer
 }