I would like to use to render a radarplot using the radarchart library in R. Everthing worked fine until I tried to change the colorscheme of the plot.
radarchart:::colourMatrix(diag(255, nrow=3))
After that, the radarchart is not plotted anymore.
What I did so far, was to remove (an re-install) radarchart and its dependencies htmltools and htmlwidgets.
=====
In Chrome the following errors are reported in the console:
Chart.min.js:12 Uncaught TypeError: Cannot convert undefined or null
to object
at Function.keys ()
at Object.o.each (Chart.min.js:12)
at Chart.min.js:14
at Object.o.each (Chart.min.js:12)
at a.determineDataLimits (Chart.min.js:14)
at a.update (Chart.min.js:13)
at Chart.min.js:12
at Object.o.each (Chart.min.js:12)
at Object.update (Chart.min.js:12)
at t.Controller.updateLayout (Chart.min.js:11) Chart.min.js:11 Uncaught TypeError: Cannot set property '_data' of undefined
at t.Controller.update (Chart.min.js:11)
at t.Controller.resize (Chart.min.js:11)
at Chart.min.js:11
at Chart.min.js:12
Before I removed both htmltools and htmlwidgets, there was another error, something like render.... not defined (but I don't remember precisely).
Related
I am using a package called {butteR} and a function called butteR::closest_distance_rtree() to match coordinates with their closest known settlement. The code looks like this:
# install.packages("devtools")
# devtools::install_github("zackarno/butteR")
matched_coordinates <- butteR::closest_distance_rtree(coordinates, master_settlement_list)
Should be simple enough, but I keep getting the following error:
Error: 'knn.RTree' is not an exported object from 'namespace:rtree'
I've re-installed both {butteR} and {rtree}, checked the namespace for {rtree}, re-started R and cleared the environment, and checked for typos. Any ideas would be appreciated!
I'm trying to include a function from the Bioconductor package "simpIntLists" in my own package. "import(simpIntLists)" is added to the Namespace file.
However, the function results in an error
do_xy <- function(organism, IDType){
network <- simpIntLists::findInteractionList(organism, IDType)
}
do_xy("human", "EntrezId")
#Error message
data set ‘HumanBioGRIDInteractionEntrezId’ not foundError in get("HumanBioGRIDInteractionEntrezId") :
object 'HumanBioGRIDInteractionEntrezId' not found
# results in the same error (outside of the function)
simpIntLists::findInteractionList(organism, IDType)
It works fine when simpIntLists is attached
# works
library(simpIntLists)
network <- simpIntLists::findInteractionList(organism, IDType)
I saw the code here (https://bioconductor.org/packages/release/data/experiment/html/simpIntLists.html).
This code does not seem to take into account the situation where the package is used without installation.
For your information, the relevant part to this error is around the line 52.
else if (organism == 'human'){
if (idType == 'EntrezId'){
data(HumanBioGRIDInteractionEntrezId);
interactionList <- get("HumanBioGRIDInteractionEntrezId");
}
It tries to fetch the data to the namespace but it fails to do so if the package is not imported via library yet. This only generates a warning. The error then occurs when it tries to use the data because it does not exist in the namespace.
A workaround is that you import the data in your code explicitly. Then you can use the function as below. Note that the warning remains because of the embedded package code. If the warning is annoying, use suppressWarnings.
data(HumanBioGRIDInteractionEntrezId, package="simpIntLists")
simpIntLists::findInteractionList("human", "EntrezId")
I try to build a custom geom to extend ggplot2.
While the function works, I am not able to build the package as I have the following error message:
==> devtools::document(roclets=c('rd', 'collate', 'namespace'))
Updating ggvis documentation
Loading ggvis
Error in ggproto("GeomDash", Geom, required_aes = c("x", "y"), non_missing_aes = c("linetype", (from geom_dash.R#57) :
impossible de trouver la fonction "ggproto"
Calls: suppressPackageStartupMessages ... withr_with_dir -> force -> source_many -> source_one -> eval -> eval
Ex�cution arr�t�e
Exited with status 1.
I installed the dev version of ggplot2 as recommanded by Hadley. With no success. For some reason it does not show an error when I try with a dummy function such as:
f <- function(x){
return(ggproto(x))}
But it doesn't work even with the initial code of geom_segment or by integrating the ggproto function in the package's folder.
You can find my function here
I've already created a package to extend ggplot2 with no problem. It still builds just fine.
Any suggestion? Cheers.
The problem was solved by editing the NAMESPACE as suggested by #Gregor.
Removing the existing NAMESPACE file and running
devtools::document()
allowed the creation of a clean NAMESPACE file containing the required exports and imports.
I tried to add the following line in my .Rprofile file:
options(device = quartz)
It produced an error:
Error in options(device = quartz) : object 'quartz' not found
Then I tried:
options(device = "quartz")
And it works.
However, both work in the regular R session. Can anyone tell me what is the reason for the difference in behavior?
The erro message says it all. There is no data-object named 'quartz' and the options function is not expecting (nor can it find) a function name as an argument value for the 'device'-node.
You are seeing the effect of the environment where .Rprofile is being evaluated because some of the usual packages (such as stats or graphics) are not yet loaded. Read more about this at ?Startup. You could avoid this by starting .Rprofile with require(grDevices)
I've created a custom plotting function for a scatterplot with error bars on multiple series using rCharts. I successfully embedded said plot in a shiny application. The first time it shows everything works fine:
However, if I try to update the plot (e.g. by changing some input) the plot does not change and I get the following JS error message on the browser's console:
TypeError: 'undefined' is not a function (evaluating 'this[b].destroy()')
The strange thing is that if I check the plot object (p) it seems fine, e.g. I can plot it in Rstudio and also get a viable html page from it. I guess the problem is somehow that the old plot cannot be removed properly.
I use rCharts v. 0.4.5 and shiny 0.10.2.1 and I have uploaded an example shiny app to github:
https://github.com/mlist/highcharts_scatterplot_example
As extra dependency you will need to install the packages rjson and foreach. You can then run the app with
runGitHub(repo="mlist/highcharts_scatterplot_example")
```
Use renderChart2 rather then renderChart. Replace output$testPlot with :
output$testPlot <- renderChart2({
p <- highcharts.scatterplot.plate(data.frame(seq(1:nrow(iris)),iris[,2], input$error, iris[,5]))
return(p)
})
You can try the change at:
shiny::runGitHub(repo="johndharrison/highcharts_scatterplot_example")