Shiny plot not updatingHow to make a great R reproducible examplePlot two graphs in same plot in RSave plots made in a shiny appScale and size of plot in RStudio shinyUpdate plot within observer loop in shiny applicationScaling shiny plots to window heightDynamic plot height in Shinyupdating plot output in shiny rShiny - plot with renderUI not display in shinyDelay update to R Shiny multiple-plot appUpdate dynamically created plot in R Shiny
Is this kind of description not recommended?
90s(?) book series about two people transported to a parallel medieval world, she joins city watch, he becomes wizard
Find Two largest numbers in a list without using Array
Is there any road between the CA State Route 120 and Sherman Pass Road (Forest Route 22S0) that crosses Yosemite/Serria/Sequoia National Park/Forest?
How does the Saturn V Dynamic Test Stand work?
Arduino- Duty Cycle Changing When Frequency Is Increasing
Why is su world executable?
Can my Boyfriend, who lives in the UK and has a Polish passport, visit me in the USA?
Designing a prison for a telekinetic race
Would it be illegal for Facebook to actively promote a political agenda?
How did Apollo 15's depressurization work?
How to avoid using System.String with Rfc2898DeriveBytes in C#
What can I do to keep a threaded bolt from falling out of it’s slot
How could Tony Stark wield the Infinity Nano Gauntlet - at all?
In xXx, is Xander Cage's 10th vehicle a specific reference to another franchise?
Levenshtein Neighbours
Cheap storage lockers in Tromsø, Norway
Interaction between Ethereal Absolution versus Edgar Markov with Captivating Vampire
Changing a TGV booking
Is there a commercial liquid with refractive index greater than n=2?
Earliest evidence of objects intended for future archaeologists?
Unbiased estimator of exponential of measure of a set?
Can others monetize my project with GPLv3?
Gofer work in exchange for Letter of Recommendation
Shiny plot not updating
How to make a great R reproducible examplePlot two graphs in same plot in RSave plots made in a shiny appScale and size of plot in RStudio shinyUpdate plot within observer loop in shiny applicationScaling shiny plots to window heightDynamic plot height in Shinyupdating plot output in shiny rShiny - plot with renderUI not display in shinyDelay update to R Shiny multiple-plot appUpdate dynamically created plot in R Shiny
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am trying to plot in the shiny using the below outputplot
I am new o shiny not able to understand where i am making mistake.
server <- function(input, output) {
#Test1 Function ti create the required table
Test1 <- function(df)
xx1 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(Freq = length(Quarter)) %>% mutate(FreqbyPercentage = round(((Freq/sum(Freq))*100),0))
xx1 <- data.frame(xx1)
xx2 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TNRinM = sum(TNRinM,na.rm = T)) %>% mutate(TNRinMPercentage = round(((TNRinM/sum(TNRinM))*100),0))
xx2 <- data.frame(xx2)
xx3 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TCNRinM = sum(TCNRinM,na.rm = T)) %>% mutate(TCNRinMPercentage = round(((TCNRinM/sum(TCNRinM))*100),0))
xx3 <- data.frame(xx3)
YY <- cbind(xx1,xx2[,(4:5)],xx3[,(4:5)])
YY <- data.frame(YY,stringsAsFactors = FALSE)
YY
#Test10 Function to use GGplot
Test10 <- function(df,y)
arg <- match.call()
p <- ggplot(df(),
aes(x=Quarter, y= eval(arg$y) , group= RiskTierDesc , colour= RiskTierDesc )) +
geom_line(aes(size= RiskTierDesc)) +
#geom_point() + ylim(0,ifelse (input$app == "Risk tier by Count",2000,10000)) +
geom_point() +
#expand_limits(y=0) +
scale_y_continuous(breaks = seq(0, 10000, 500)) +
scale_color_manual(values=c("red","orange","green")) +
scale_size_manual(values=c(1,1,1)) +
labs( x = "Quarter", y = ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
ggtitle(ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
geom_text(aes(label = eval(arg$y)), position = position_dodge(0),vjust = -0.2) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
p
dataInput <- reactive(
qfrom <- File$QuarterInNum[match(input$Quarter[1], File$Quarter)]
qto <- File$QuarterInNum[match(input$Quarter[2], File$Quarter)]
test <- File[File$QuarterInNum %in% seq(from=qfrom,to=qto),]
test
)
output$k<- renderPlot(
if(!is.null(input$app)) File <- Test1(oppid)
plot(Test10(dataInput,Freq))
)
I want to get whenever the slider input app is not null
Test1 function should execute with the parameter oppid and load it the File.
Next it should plot using Test10 function using the parameted dataInput and Freq.
Please note dataInput is reactive which use File.
r shiny
add a comment |
I am trying to plot in the shiny using the below outputplot
I am new o shiny not able to understand where i am making mistake.
server <- function(input, output) {
#Test1 Function ti create the required table
Test1 <- function(df)
xx1 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(Freq = length(Quarter)) %>% mutate(FreqbyPercentage = round(((Freq/sum(Freq))*100),0))
xx1 <- data.frame(xx1)
xx2 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TNRinM = sum(TNRinM,na.rm = T)) %>% mutate(TNRinMPercentage = round(((TNRinM/sum(TNRinM))*100),0))
xx2 <- data.frame(xx2)
xx3 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TCNRinM = sum(TCNRinM,na.rm = T)) %>% mutate(TCNRinMPercentage = round(((TCNRinM/sum(TCNRinM))*100),0))
xx3 <- data.frame(xx3)
YY <- cbind(xx1,xx2[,(4:5)],xx3[,(4:5)])
YY <- data.frame(YY,stringsAsFactors = FALSE)
YY
#Test10 Function to use GGplot
Test10 <- function(df,y)
arg <- match.call()
p <- ggplot(df(),
aes(x=Quarter, y= eval(arg$y) , group= RiskTierDesc , colour= RiskTierDesc )) +
geom_line(aes(size= RiskTierDesc)) +
#geom_point() + ylim(0,ifelse (input$app == "Risk tier by Count",2000,10000)) +
geom_point() +
#expand_limits(y=0) +
scale_y_continuous(breaks = seq(0, 10000, 500)) +
scale_color_manual(values=c("red","orange","green")) +
scale_size_manual(values=c(1,1,1)) +
labs( x = "Quarter", y = ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
ggtitle(ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
geom_text(aes(label = eval(arg$y)), position = position_dodge(0),vjust = -0.2) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
p
dataInput <- reactive(
qfrom <- File$QuarterInNum[match(input$Quarter[1], File$Quarter)]
qto <- File$QuarterInNum[match(input$Quarter[2], File$Quarter)]
test <- File[File$QuarterInNum %in% seq(from=qfrom,to=qto),]
test
)
output$k<- renderPlot(
if(!is.null(input$app)) File <- Test1(oppid)
plot(Test10(dataInput,Freq))
)
I want to get whenever the slider input app is not null
Test1 function should execute with the parameter oppid and load it the File.
Next it should plot using Test10 function using the parameted dataInput and Freq.
Please note dataInput is reactive which use File.
r shiny
You don't seem to be using any reactive elements here. I recommend you take time to follow a simple Shiny tutorial first like those available here: rstudio.com/resources/webinars/shiny-developer-conference That will give you a good understanding of how Shiny applications should look and work.
– MrFlick
Mar 27 at 14:43
@MrFlick Sorry i missed the reactive part in my code to add. I added it now.
– JK1185
Mar 27 at 15:14
No, it's that yourTest10
isn't reative. If you use stuff likematch.call()
then Shiny isn't going to be able to see dependencies. You should not useinput$
in bodies of non-reactive functions. You should pass in those values are parameter sorenderPlot()
can see theinput$
so it knows it's a dependency. Again I would urge you to follow those basic guides first to see how it's supposed to work. And when asking for help, it's best to include a proper reproducible example we can run for testing.
– MrFlick
Mar 27 at 15:27
@MrFlick Sure Thank you
– JK1185
Mar 27 at 15:30
add a comment |
I am trying to plot in the shiny using the below outputplot
I am new o shiny not able to understand where i am making mistake.
server <- function(input, output) {
#Test1 Function ti create the required table
Test1 <- function(df)
xx1 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(Freq = length(Quarter)) %>% mutate(FreqbyPercentage = round(((Freq/sum(Freq))*100),0))
xx1 <- data.frame(xx1)
xx2 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TNRinM = sum(TNRinM,na.rm = T)) %>% mutate(TNRinMPercentage = round(((TNRinM/sum(TNRinM))*100),0))
xx2 <- data.frame(xx2)
xx3 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TCNRinM = sum(TCNRinM,na.rm = T)) %>% mutate(TCNRinMPercentage = round(((TCNRinM/sum(TCNRinM))*100),0))
xx3 <- data.frame(xx3)
YY <- cbind(xx1,xx2[,(4:5)],xx3[,(4:5)])
YY <- data.frame(YY,stringsAsFactors = FALSE)
YY
#Test10 Function to use GGplot
Test10 <- function(df,y)
arg <- match.call()
p <- ggplot(df(),
aes(x=Quarter, y= eval(arg$y) , group= RiskTierDesc , colour= RiskTierDesc )) +
geom_line(aes(size= RiskTierDesc)) +
#geom_point() + ylim(0,ifelse (input$app == "Risk tier by Count",2000,10000)) +
geom_point() +
#expand_limits(y=0) +
scale_y_continuous(breaks = seq(0, 10000, 500)) +
scale_color_manual(values=c("red","orange","green")) +
scale_size_manual(values=c(1,1,1)) +
labs( x = "Quarter", y = ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
ggtitle(ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
geom_text(aes(label = eval(arg$y)), position = position_dodge(0),vjust = -0.2) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
p
dataInput <- reactive(
qfrom <- File$QuarterInNum[match(input$Quarter[1], File$Quarter)]
qto <- File$QuarterInNum[match(input$Quarter[2], File$Quarter)]
test <- File[File$QuarterInNum %in% seq(from=qfrom,to=qto),]
test
)
output$k<- renderPlot(
if(!is.null(input$app)) File <- Test1(oppid)
plot(Test10(dataInput,Freq))
)
I want to get whenever the slider input app is not null
Test1 function should execute with the parameter oppid and load it the File.
Next it should plot using Test10 function using the parameted dataInput and Freq.
Please note dataInput is reactive which use File.
r shiny
I am trying to plot in the shiny using the below outputplot
I am new o shiny not able to understand where i am making mistake.
server <- function(input, output) {
#Test1 Function ti create the required table
Test1 <- function(df)
xx1 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(Freq = length(Quarter)) %>% mutate(FreqbyPercentage = round(((Freq/sum(Freq))*100),0))
xx1 <- data.frame(xx1)
xx2 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TNRinM = sum(TNRinM,na.rm = T)) %>% mutate(TNRinMPercentage = round(((TNRinM/sum(TNRinM))*100),0))
xx2 <- data.frame(xx2)
xx3 <- group_by_at(df,vars(Quarter,QuarterInNum,RiskTierDesc)) %>% summarise(TCNRinM = sum(TCNRinM,na.rm = T)) %>% mutate(TCNRinMPercentage = round(((TCNRinM/sum(TCNRinM))*100),0))
xx3 <- data.frame(xx3)
YY <- cbind(xx1,xx2[,(4:5)],xx3[,(4:5)])
YY <- data.frame(YY,stringsAsFactors = FALSE)
YY
#Test10 Function to use GGplot
Test10 <- function(df,y)
arg <- match.call()
p <- ggplot(df(),
aes(x=Quarter, y= eval(arg$y) , group= RiskTierDesc , colour= RiskTierDesc )) +
geom_line(aes(size= RiskTierDesc)) +
#geom_point() + ylim(0,ifelse (input$app == "Risk tier by Count",2000,10000)) +
geom_point() +
#expand_limits(y=0) +
scale_y_continuous(breaks = seq(0, 10000, 500)) +
scale_color_manual(values=c("red","orange","green")) +
scale_size_manual(values=c(1,1,1)) +
labs( x = "Quarter", y = ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
ggtitle(ifelse (input$app == "Risk tier by Count","Freq",ifelse(input$app == "Risk tier by TR","TotalNRinM","TotalCNRinM"))) +
geom_text(aes(label = eval(arg$y)), position = position_dodge(0),vjust = -0.2) +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
p
dataInput <- reactive(
qfrom <- File$QuarterInNum[match(input$Quarter[1], File$Quarter)]
qto <- File$QuarterInNum[match(input$Quarter[2], File$Quarter)]
test <- File[File$QuarterInNum %in% seq(from=qfrom,to=qto),]
test
)
output$k<- renderPlot(
if(!is.null(input$app)) File <- Test1(oppid)
plot(Test10(dataInput,Freq))
)
I want to get whenever the slider input app is not null
Test1 function should execute with the parameter oppid and load it the File.
Next it should plot using Test10 function using the parameted dataInput and Freq.
Please note dataInput is reactive which use File.
r shiny
r shiny
edited Mar 27 at 15:13
JK1185
asked Mar 27 at 14:39
JK1185JK1185
276 bronze badges
276 bronze badges
You don't seem to be using any reactive elements here. I recommend you take time to follow a simple Shiny tutorial first like those available here: rstudio.com/resources/webinars/shiny-developer-conference That will give you a good understanding of how Shiny applications should look and work.
– MrFlick
Mar 27 at 14:43
@MrFlick Sorry i missed the reactive part in my code to add. I added it now.
– JK1185
Mar 27 at 15:14
No, it's that yourTest10
isn't reative. If you use stuff likematch.call()
then Shiny isn't going to be able to see dependencies. You should not useinput$
in bodies of non-reactive functions. You should pass in those values are parameter sorenderPlot()
can see theinput$
so it knows it's a dependency. Again I would urge you to follow those basic guides first to see how it's supposed to work. And when asking for help, it's best to include a proper reproducible example we can run for testing.
– MrFlick
Mar 27 at 15:27
@MrFlick Sure Thank you
– JK1185
Mar 27 at 15:30
add a comment |
You don't seem to be using any reactive elements here. I recommend you take time to follow a simple Shiny tutorial first like those available here: rstudio.com/resources/webinars/shiny-developer-conference That will give you a good understanding of how Shiny applications should look and work.
– MrFlick
Mar 27 at 14:43
@MrFlick Sorry i missed the reactive part in my code to add. I added it now.
– JK1185
Mar 27 at 15:14
No, it's that yourTest10
isn't reative. If you use stuff likematch.call()
then Shiny isn't going to be able to see dependencies. You should not useinput$
in bodies of non-reactive functions. You should pass in those values are parameter sorenderPlot()
can see theinput$
so it knows it's a dependency. Again I would urge you to follow those basic guides first to see how it's supposed to work. And when asking for help, it's best to include a proper reproducible example we can run for testing.
– MrFlick
Mar 27 at 15:27
@MrFlick Sure Thank you
– JK1185
Mar 27 at 15:30
You don't seem to be using any reactive elements here. I recommend you take time to follow a simple Shiny tutorial first like those available here: rstudio.com/resources/webinars/shiny-developer-conference That will give you a good understanding of how Shiny applications should look and work.
– MrFlick
Mar 27 at 14:43
You don't seem to be using any reactive elements here. I recommend you take time to follow a simple Shiny tutorial first like those available here: rstudio.com/resources/webinars/shiny-developer-conference That will give you a good understanding of how Shiny applications should look and work.
– MrFlick
Mar 27 at 14:43
@MrFlick Sorry i missed the reactive part in my code to add. I added it now.
– JK1185
Mar 27 at 15:14
@MrFlick Sorry i missed the reactive part in my code to add. I added it now.
– JK1185
Mar 27 at 15:14
No, it's that your
Test10
isn't reative. If you use stuff like match.call()
then Shiny isn't going to be able to see dependencies. You should not use input$
in bodies of non-reactive functions. You should pass in those values are parameter so renderPlot()
can see the input$
so it knows it's a dependency. Again I would urge you to follow those basic guides first to see how it's supposed to work. And when asking for help, it's best to include a proper reproducible example we can run for testing.– MrFlick
Mar 27 at 15:27
No, it's that your
Test10
isn't reative. If you use stuff like match.call()
then Shiny isn't going to be able to see dependencies. You should not use input$
in bodies of non-reactive functions. You should pass in those values are parameter so renderPlot()
can see the input$
so it knows it's a dependency. Again I would urge you to follow those basic guides first to see how it's supposed to work. And when asking for help, it's best to include a proper reproducible example we can run for testing.– MrFlick
Mar 27 at 15:27
@MrFlick Sure Thank you
– JK1185
Mar 27 at 15:30
@MrFlick Sure Thank you
– JK1185
Mar 27 at 15:30
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55379924%2fshiny-plot-not-updating%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55379924%2fshiny-plot-not-updating%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You don't seem to be using any reactive elements here. I recommend you take time to follow a simple Shiny tutorial first like those available here: rstudio.com/resources/webinars/shiny-developer-conference That will give you a good understanding of how Shiny applications should look and work.
– MrFlick
Mar 27 at 14:43
@MrFlick Sorry i missed the reactive part in my code to add. I added it now.
– JK1185
Mar 27 at 15:14
No, it's that your
Test10
isn't reative. If you use stuff likematch.call()
then Shiny isn't going to be able to see dependencies. You should not useinput$
in bodies of non-reactive functions. You should pass in those values are parameter sorenderPlot()
can see theinput$
so it knows it's a dependency. Again I would urge you to follow those basic guides first to see how it's supposed to work. And when asking for help, it's best to include a proper reproducible example we can run for testing.– MrFlick
Mar 27 at 15:27
@MrFlick Sure Thank you
– JK1185
Mar 27 at 15:30