While running my script, I get the following error message during a code that creates a dozen plots in ggplot2 as part of an anlaysis:
Error in grid.Call.graphics(C_setviewport, vp, TRUE) :
non-finite location and/or size for viewport
The error message crashes the code. Interestingly, changing nothing and running the code again will resolve the problem, and it will work just fine. Sometimes, it will crash while creating a different plot.
I haven't been able to find any documentation on why this is happening.
There should be no error, and sometimes it works as expected.
Related
The problem is for Leet Code Intersection of Two Arrays. when I run code, it gave me no error and was working just fine giving the correct output. But when I try to submit, it gave me some weird error. I don't have any idea where and what the issue is.
This is my solution:
and this is the error I am getting in Leet Code on submitting:
[![runtime error](https://i.stack.imgur.com/4vaug.jpg)](https://i.stack.imgur.com/4vaug.jpg)
So I keep getting an error message in R when I try to use the bias function here's what my code looks like so far:
install.packages("SimDesign")
library(SimDesign)
actual_temp<-c(68.3,70,72.4,71,67,70)
predicted_temp<-c(67.9,69,71,5,70,67,69)
bias(actual_temp, predicted_temp)
And here's the error message I get when I run the code:
Error in bias(actual_temp, predicted_temp) :
ncol(estimate) == length(parameter) is not TRUE
I've tried figuring out if my syntax is off (I'm a novice so I'm never 100% sure). I then tried copy-pasting the error into the search bar and came up with nothing. If anyone has an idea of how to fix this that would be great in case it's a problem I run into again in the future.
Edit: I tried again with some different data and it worked just fine. Is there something in this specific instance you can identify that's making it not work?
I tried to transfer some ggplots from my work computer to my home computer. I saved the plots as an .Rdata-file with the standard save function. I loaded the object with the load function at home. I get the following error:
"Error in coord$backtransform_range(panel_params) :
attempt to apply non-function"
I have no problems making new ggplots without getting the error. Neither when I save these plots locally and load them again. I've also tried transferring the plots both through gmail and with my cell phone as a storage unit. Both computers use Windows 10 operating system.
I get the error when I run the following bit of code
library(tidyverse)
load("Object.Rdata")
object$main_plot
I did not expect that this would cause an error. Am I missing something obvious?
For some reason I keep getting an error that cancels everything when I try to knit. It keeps telling me that the error is in the line with plot() and I don't know what to do. It's having trouble finding my dataset but I don't know how to fix it.
Plot(movement_data$Dose,movement_data$Move,xlab="Dose",ylab="Move",main="Embryo movment vs dose of CBD")
library(gplots)
plotmeans(Move~Dose,data=movement_data,mean.labels=TRUE,connect=FALSE)
I am building a Shiny application with four tabs, each of which displays a plot and three data tables. When I run the application via runApp('app_name'), mostly everything loads correctly. Sometimes the plot won't load, sometimes a data table won't load, and sometimes multiple things will fail to load. And there is the somewhat rare occurrence where everything loads without issue.
The errors have been mostly one of the following:
Error in eval(substitute(expr), envir, enclos) : not compatible with requested type
Error in eval(substitute(expr), envir, enclos) : expected >
Error in eval(substitute(expr), envir, enclos) : filter condition does not evaluate to a logical vector.
The errors occur seemingly randomly and I have not been able to identify any specific part of my code causing the issue. That is, I run the code outside of the Shiny application and cannot replicate the errors.
The strange thing is that the errors occur only on the first tab and disappear upon refreshing the webpage!!
I am pretty stumped with this one, so I'm wondering if anyone has been having a similar issue and how/if they resolved it.
Some other notes that may be helpful:
I'm using dplyr, tidyr, readxl, and ggplot2. I know these have been known to have some errors with shiny
My shiny app always launches with Internet Explorer 11
Thanks for the help and let me know if any further clarification can help.
Sorry for never posting a code snippet to replicate the problem, but I'm pretty sure I have figured out what was going wrong.
Firstly, I originally had library(shiny) as the first line in my ui.R and server.R scripts, followed by source('ui_functions.R') and source(server_functions.R) to reference supporting R code. I tried removing the library(shiny) command from from ui.R and server.R and miraculously the errors disappeared. I have no idea why this worked, but it did.
Secondly, I found that my code only worked on RStudio versions >= 0.99. So if you are getting strange errors like I did, maybe try updating your RStudio verion.