I tried to get some plots based on text inputs and I keep getting the error message below
My Srever.r and Ui.r are given below. Can someone help me to fix this?
shinyServer(function(input,output) {
output$Plot <- reactivePlot({
gene <- as.character(input$genes)
datas <- eset[grep(gene,featureNames(eset))]
dataf = melt (exprs(datas[1]),varnames = c("genes"))
pheno = cbind(pData(datas[1]), sample = rownames(pData(datas[1])))
covr <- data.frame(sample = pheno$sample,risk=pheno$risk)
#Merge according to sample names
dataf = merge(dataf,covr,by.x = "NA.",by.y = "sample")
# add column name
colnames(dataf) = c("sample","gene","value","type")
# check for the input variable
ggplot(dataf, aes(y=value, x=type)) +
ylab("Log 2 value") +
xlab("Type") +
geom_boxplot()+
opts(title=paste(gene) + theme_bw() +
opts(legend.position="none"))
})
})
# UI.r
library(shiny)
shinyUI(pageWithSidebar(
sidebarPanel(
textInput("genes", "Enter a gene symbol", value = "MYCN"),
br()
),
#Show a tabset that includes many plots
mainPanel(
tabsetPanel(
tabPanel("Boxplot", plotOutput("Plot")),
tabPanel("Survial", plotOutput("Survial"))
)
)
))