Questions tagged [ggpmisc]

The ggpmisc tag should be used for questions related to the use of R package 'ggpmisc'.

The ggpmisc tag should be used for questions related to the use of R package 'ggpmisc'. Bug reports and requests for enhancements should not be posted here, but instead informed to the maintainer by raising an issue at https://bitbucket.org/aphalo/ggpmisc/issues.

The 'ggpmisc' R package is available through CRAN, and includes detailed documentation. This same documentation is also available in HTML format at http://docs.r4photobiology.info/ggpmisc and can be looked at without need to install the package. The source code of the package is in a public Git repository at https://bitbucket.org/aphalo/ggpmisc.

Functions are provided to convert time series objects into data frames or tibbles suitable for plotting with R package 'ggplot2'. To complement these functions ggplot() methods for "ts" and "xts" classes are also defined.

Different statistics, geometries and functions add facilities for labelling peaks and valleys, generating labels for fitted models including polynomial equations, highlighting deviations from a model fit, and for filtering-out regions of plot panels with high densities of observations (with stats designed to work nicely together with R package 'ggrepel').

Geometries for adding layers with inset tables, ggplots or 'grid' grobs are also defined together with versions of geom_text and geom_label that use 'grid' npc coordinates instead of data coordinates supported by new aesthetics npcxand npcy and corresponding scales.

81 questions
0
votes
1 answer

How to plot only Global Maximum Value using geom_text?

df%>% group_by(approved_date)%>% summarise(rev=sum(gmv))%>% ggplot(aes(x = approved_date, y = rev)) + geom_line() + geom_smooth(method = 'auto', se = FALSE) + labs(x = 'Date', y = 'Revenue', title = 'Revenue by Date') + …
0
votes
0 answers

Add R^2 value to plot

I'm new to R. I have produced the following plot but want to know how to include an R^2 value on the linear model line using ggpmisc and the stat_poly_eq function. The code I have is as follows - ggplot(xray, aes(x=PercentGoodFish1g,…
Harry H-W
  • 33
  • 4
0
votes
1 answer

stat_fit_glance and generalized additive models (GAM) error

I am trying to add the p-value and R2 from mgcv::gam results to ggplot with facets. The sample dataframe and code are below. Is there a way to successfully paste the p-value and R2 on the ggplots? DF <- data.frame(Site = rep(LETTERS[20:24], each =…
ecology
  • 606
  • 3
  • 9
  • 29
0
votes
1 answer

Can't install package ‘ggpmisc’ is not available (for R version 3.5.0)

I'm trying to install ‘ggpmisc’ package in my Dockerfile, and I got the message : Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning: unable to access index for repository…
Bella
  • 937
  • 1
  • 13
  • 25
0
votes
1 answer

How to add linear lines to a plot with multiple data sets of a data frame?

I have the following data frame: expected observed group 1: 0.5371429 0.0000 1 2: 1.3428571 1.3736 1 3: 2.6857143 2.4554 1 4: 5.3714286 3.6403 1 5: 0.5294118 0.0000 2 6: 1.3235294 1.1494 2 7: 2.6470588 …
Bella
  • 937
  • 1
  • 13
  • 25
0
votes
1 answer

How to find and label peaks in a ggplot when x is mapped to a date or time variable?

Would it be possible to add a text label with the hour when each peak occurred in ggplot(lynx.df, aes(time, V.lynx)) + geom_line() + stat_peaks(colour = "red") + stat_peaks(geom = "text", colour = "red", vjust = -0.5) + ylim(-100,…
1 2 3 4 5
6