ggvis, Error in normalizedPath() - r

I am running one of the "interactive" examples from the ggvis webpage (http://ggvis.rstudio.com/ggvis-basics.html#introduction) and I obtain an error.
I loaded the ggvis, dplyr and shiny packages.
Here is the code that I ran:
mtcars %>% ggvis(~wt) %>% layer_histograms(binwidth = input_slider(0, 2, step = 0.1))
And here is the output that I get.
Showing dynamic visualisation. Press Escape/Ctrl + C to stop.
Error in normalizePath(directoryPath, mustWork = TRUE) :
path[1]="/Builds/CRAN-QA-Simon/packages/mavericks-x86_64/Rlib/3.1/ggvis/www/ggvis": No such file or directory
I am using RStudio Version 0.98.507, and R version 3.1.0; Platform: x86_64-apple-darwin13.1.0 (64-bit).

I just found a similar thing trying to run a shiny app from RStudio.
My workaround was to devtools::install_packages("rstudio/ggvis").
I'll put a link to this from the ggvis google group.
Hope this helps

Related

Geomorph not functioning after update

I recently updated my MacBook air (2017) to the Mojave OS and proceeded to update my version of R and Rstudio. Unfortunately, ever since the 'plotTangentSpace' command no longer functions appropriately even when attempting to run the example 'plethodon' code from the Geomorph vingette, I always receive the following error in the output (bolded below):
data(plethodon)
Y.gpa<-gpagen(plethodon$land) #GPA-alignment
|====================================================================================| 100%
gp <- interaction(plethodon$species, plethodon$site)
plotTangentSpace(Y.gpa$coords, groups = gp)
Error in plotTangentSpace(Y.gpa$coords, groups = gp) :
unused arguments (Y.gpa$coords, groups = gp)
I have tried uninstalling and reinstalling R for a MacOS many times including versions 4.0.2, 3.6.3, 3.6.1, and 3.2.1. I have also uninstalled and reinstalled XQuartz several times.
If anyone has encountered a similar issue or has any other ideas I can try I would really appreciate the help. Thank you!
If you execute:
?plotTangentSpace
You should see that this is a deprecated function. That means you should not be using it. It says:
Notes for geomorph 3.3.0 and subsequent versions
I suspect you have not updated your copy of the vignette. There are instructions on the help page for an alternate approach. The example in the help page for the suggested function is:
data(plethspecies)
Y.gpa <- gpagen(plethspecies$land) #GPA-alignment
### Traditional PCA
PCA <- gm.prcomp(Y.gpa$coords)
summary(PCA)
plot(PCA, main = "PCA")
For the plethodon data they suggest:
PCA.w.phylo <- gm.prcomp(Y.gpa$coords, phy = plethspecies$phy)
summary(PCA.w.phylo)
plot(PCA.w.phylo, phylo = TRUE, main = "PCA.w.phylo")
So start a new session (to unload the currently loaded geomorph namespace, and execute this at the r session command line:
install.packages("geomorph")
You should be getting version 3.3.1 of the geomorph package.
I think I found the problem! In my case, the error was due to a old version of the package RRPP, which is required by Geomorph. After updating it, Geomorph is working perfectly! Hope this can be useful for you too.
I came across the same error but after updating the RRPP and rgl packages required for geomorph, the gm.prcomp() function worked for me. I hope this helps if you haven't figured it out already.

How to solve TIFFOpen Error Popup in RStudio?

I am running spThin from the package "spThin" in RStudio
I am trying to save the plot generated from plotThin function
Following is my code after the spThin function:
tiff(file = paste(n, "plotThin2.tiff", sep = "_"))
plotThin(ca.thin, which = 2)
dev.off()
However, I get /n_plotThin2.tiff: Cannot Open.
I don't think it is the issue with my code as I went the code another 2 computers without problem but only this computer
If I switched from tiff to jpeg()
I get Error during wrapup: unable to start jpeg() device
I am running R 3.6.2
Can someone help please. Thank you

Error there is no package called RevoUtilsMath with R Markdown

I am running R 3.4.3 and 3.5.1 (non-Microsoft version) and RStudio version 1.1.456. I am trying to knit some code into RMarkdown. However, I get the following error:
Error in library(p, character.only = TRUE) : there is no package called 'RevoUtilsMath'Calls: <Anonymous> ... suppressPackageStartupMessages -> withCallingHandlers -> library
Execution halted
The package RevoUtilsMath is part of the MKL install with Microsoft R. I cannot install it as a supplemental package with 'regular R'. The script itself runs fine, it just does not work in R Markdown.
The following libraries are loaded:
```{r loadLibraries, echo=FALSE, warning=FALSE}
library(RODBC)
library(dplyr)
library(markovchain)
library(DT)
library(reshape2)
library(knitr)
library(ggplot2)
library(scales)
library(PerformanceAnalytics)
library(plotly)```
The missing package error happens when executing the code below in Markdown. It is called using this code.
```{r histogram1, echo=FALSE, cache=TRUE}```
The histogram1 code is below (very standard ggplot).
g <- ggplot(dataClean, aes(x = IncSnapshotDay, fill = Represent)) +
geom_histogram(bins=70, alpha = .8) +
scale_fill_manual(values = colors) +
scale_x_continuous(labels = comma, limits = c(0,40000)) +
facet_wrap(~SnapshotDay) +
ylim(0,4000) +
theme_bryan()
g
I thought that maybe one of these packages has a dependency, so I ran the following to find out.
library(tools)
> dependsOnPkgs('RevoUtilsMath')
It returns character(0) which indicates that none of the packages depend on it. I did a test of the function on ggplot2, and it works
dependsOnPkgs('ggplot2')
[1] "dendextend" "GGally" "ggthemes" "plotly" "viridis" "caret" "crosstalk"
[8] "DT"
So why does R Markdown/knitr generate this error since the code itself runs fine outside of Markdown, and how do I fix this?
I think you are experiencing a problem similar to one I just had though, without more detail, it is hard for me to know.
In my case, the problem was caused by knitr caching the list of packages used by a previous author (using Microsoft R). The immediate solution was to simply clear the knitr cache (via the "Knit" drop down menu in RStudio) before attempting to knit the code.
I still don't really understand why this is happening or how to avoid it in future situations, but this at least provides a way to create the document even in the face of this behavior.

ggvis, error in function( ) : attempt to apply non-function : post sessionInfo()

library("dplyr")
library("ggvis")
mtcars %>% ggvis(~wt,~mpg) %>% layer_points()
sessionInfo()
I posted sessionInfo() because I have an Error in (function () : attempt to apply non-function.
When I use R markdown and run, it works. It has error all the time, when I run it in R.
I had a similar issue to this.
I updated Rstudio from ver 0.98.1102 to ver 0.98.1103 and it's working now
Test to see if you can get ggvis to work in vanilla R to see if it's Rstudio behind your problem
Good Luck

RStudio-only error with tcl/tk?

When I compute an ROC plot with the package pROC, I get the following error in RStudio v. 99.9.9:
## Loading required package: tcltk
## Warning: couldn't connect to display ":0"
## Error: [tcl] invalid command name "toplevel".
I thought this was an issue in my OS (Debian with r-base 3.1 installed from APT depending on tcl/tk lib version 8.5), but when evaluating the same code through the terminal, I get the plot rendered without the same error.
Here is a simple example following some pROC example code that will generate the error when knitted in RStudio, but works in vanilla R:
```{r markdown.test}
library(pROC)
features <- runif(25)
labels <- as.factor(runif(25) < 0.75)
lda.model <- lda(as.matrix(features),labels)
lda.pred <- predict(lda.model,as.matrix(features))
lda.roc <- plot.roc(lda.pred$posterior[,1],
c(labels),
ci=TRUE, of="se", #specificities = seq(0,100,5),
ci.type="shape",
ci.col="#1c61b6AA")
```
The error occurs when the confidence interval parameters are added to the call.
Is there something missing from my RStudio install/config, or is this a bug?
Blast from the past! I see that same error today on an instance of RStudio installed in the IBM computing environment called CP4D. Did you ever find an answer?
I think the way to fix on your Macintosh is to install Quartz and let it serve as the X11 server to display output from programs like tcltk or maybe even hist() or quartz() devices. (my team wrote install instructions https://pj.freefaculty.org/guides/crmda_guides/47.mac_R_setup).
I'm not sure what I'll do on the CP4D thing, since it is running inside a Web browser.

Resources