我正在使用R 3.2.3通过RStudio版本0.99.491,在Windows 10 64bit ...我正在创建一个ggplot2闪亮的应用程序,它显示一个气泡图。除了关于输入的事实外,我不理解我收到的错误消息:
library(shiny)
library(leaflet)
vars = c("april" = "April","may" = "May","june" = "June","july" = "July")
shinyUI(pageWithSidebar(
sidebarPanel(
selectInput("month", "Month", vars, selected = "april")),
mainPanel(plotOutput("plot")
)))
这是我正在使用的$routeParams。这是代码
UI
library(shiny)
library(leaflet)
melt_april <- melt(april)
names(april) = c('departure', 'stop', 'frequency')
melt_may <- melt(may)
names(may) = c('departure', 'stop', 'frequency')
melt_june <- melt(june)
names(june) = c('departure', 'stop', 'frequency')
melt_july <- melt(july)
names(july) = c('departure', 'stop', 'frequency')
monthBy <- input$month
shinyServer( function(input, output){
observe({
output$plot <- renderPlot({
p <- ggplot(monthBy, aes(x = departure, y =stop, size = frequency, color = frequency)) +
geom_point()+
scale_colour_gradient(low="white",high="orange")+
print(p)
)
})
SEVER
foreach ($lines as $line) {
#Increment the line number
$lineNum++;
#Save the current indentation for later use
$currentIndentation = strspn($line, " ");
#Go though list of unclosed tags and recursivley close all that need to be closed
for($i=count($unclosed_tags)-1; $i>= 0; $i--){
$tag = $unclosed_tags[$i];
#Assign a variable to the tag indentation
$tagIndentation = $tag[1];
echo $tag[0] . "$tagIndentation:$currentIndentation=" . !($tagIndentation < $currentIndentation) . "<br>";
#Check if the current indentation is not smaller than the tag
if ($tagIndentation >= $currentIndentation) {
#Close the tag
$output .= "</" . $tag[0] . ">";
#Remove the tag from unclosed list cince we just closed it
unset($unclosed_tags[$i]);
} else {
break;
}
}
#Get the current element (== the first string in a string)
$currentElement = preg_replace('/(\s*)([^\s]*)(.*)/', '$2', $line);
#Output as open tag
$output .= "<" . $currentElement . ">" . trim(str_replace_first($currentElement, "", $line));
#Add to list of unclosed tags
$unclosed_tags[] = array($currentElement, $currentIndentation);
}
})
答案 0 :(得分:0)
好的,我想你可能需要
monthBy <- input$month
在shinyServer
函数内。