So the docs say that there exists a function called stat_qq_line:
And I can see from whence that originated:
Holla at Nick Solomon and Kara Woo!
But if I try to use stat_qq_line I get an error:
library(ggplot2)
df <- data.frame(y = rt(200, df = 5))
p <- ggplot(df, aes(sample = y))
p + stat_qq() + stat_qq_line()
# Error in stat_qq_line() : could not find function "stat_qq_line"
I can tell my RStudio.cloud session is running ggplot 2.2.1 (CRAN Latest I think). Should I expect to see stat_qq_line in there? How can I tell which version of ggplot incorporated stat_qq_line? Since Karen Woo committed the change over a year ago, I would expect it to be in the current version. But it seems it isn't.
stat_qq_line() is in the development version of ggplot2, which is scheduled to be submitted to CRAN next month. In the meantime you can get it with devtools::install_github("tidyverse/ggplot2").
Thanks @karawoo! As a user not at all familiar with the ggplot2 development process (other than searching github comments) Is there a way I could have figured this out without sounding the bat signal?
The NEWS.md file in the GitHub repo has a list of all user-facing changes by version, so that's a good place to look. Otherwise I think the only way is to compare the date of the last CRAN release to the date the pull request was merged.
It's in the works. The plan is to have the primary pkgdown site with the documentation for the latest CRAN release of a package, and a dev. site with the documentation for the package in development (not indexed for search, etc.) – so, basically, you, “a user not at all familiar with the…development process”, won't be led astray by peeks of what's in the pipeline in outside of the CRAN version.
We're working out the process atm (them's the breaks of FOSS, since pkgdown is, itself, in active development), but Jenny has a system running for usethis you can take a look at (screenshots of the reference page, bc index has installation instructions for CRAN and devtools, which might change):
Yeah, hopefully there's an easy(ish) workflow for this (as one might imagine, we don't do full-blown site rebuilds for every update – though a new geom is a good example for a case_when() it'd be worth doing so for a dev site), otherwise the plan would be to have the pkgdown sites reflect the latest release version of the package to avoid what you just went through.
your solution already sounds solid to me. I noticed that in Pandas and some other FLOSS projects, the docs have a version number on every page. I've found that helpful. Also helps because I can Google some function name and a version number and get the the docs for that feature as of a given version. The downside is that sometimes I search for a function and I get the docs from an older version. So there's always trade-offs.
This makes me think about the target audience for docs is not only a user, but Google who then directs the user.
Yeah, as it turns out, the vast majority of users run what's on CRAN, which makes that an easier decision. There's also always the tried and true method built right into R! Your .Rd files will always reflect whatever version you have installed, so (in addition to getting the reference for a given function with ?foo) help(package = "ggplot2") will bring you to the index of documentation for said version.
Error: package or namespace load failed for ‘ggplot2’ in get(Info[i, 1], envir = env): lazy-load database '/Users/JiaxiangLi/Library/R/3.4/library/ggplot2/R/ggplot2.rdb' is corrupt
Hi, the problem is fixed but new problem comes ...
Here is my logging data when I am downloading the package.
Downloading GitHub repo tidyverse/ggplot2@master
from URL https://api.github.com/repos/tidyverse/ggplot2/zipball/master
Installing ggplot2
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
--no-environ --no-save --no-restore --quiet CMD INSTALL \
'/private/var/folders/w9/1mk575815rbdx8bp5k3j132w0000gp/T/RtmpvAdIZu/devtools424c1cb55854/tidyverse-ggplot2-cc48035' \
--library='/Users/JiaxiangLi/Library/R/3.4/library' \
--install-tests
* installing *source* package ‘ggplot2’ ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ggplot2)
And here is the new problem, related to package caret, when I run library(ggplot2).
Error in value[[3L]](cond) : Package ‘ggplot2’ version 2.2.1 cannot be unloaded: Error in unloadNamespace(package) : namespace ‘ggplot2’ is imported by ‘caret’ so cannot be unloaded
It looks like your installation of ggplot2 was successful.
Did you restart R both before and after installing? Trying to install and load new packages when you have other packages loaded that depend on those packages (or depend on packages that depend on those packages...) often causes problems.