-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
418 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Package: ggpmisc | |
Type: Package | ||
Title: Miscellaneous Extensions to 'ggplot2' | ||
Version: 0.5.6.9003 | ||
Date: 2024-05-26 | ||
Date: 2024-06-01 | ||
Authors@R: | ||
c( | ||
person("Pedro J.", "Aphalo", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-3385-972X")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
library(ggplot2) | ||
|
||
m <- | ||
ggplot(mpg, aes(displ, 1 / hwy)) + | ||
geom_point() | ||
m + stat_quantile() | ||
|
||
m + stat_quantile(method = "rqss") | ||
|
||
m + stat_quantile(method = "rqss", lambda = 0.1) | ||
|
||
sessionInfo() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
library(ggplot2) | ||
library(ggpmisc) | ||
|
||
p <- | ||
ggplot(mpg, aes(displ, 1 / hwy)) + | ||
geom_point() | ||
p + stat_quant_line() | ||
|
||
p + stat_quant_line(method = "rqss") | ||
|
||
p + stat_quant_line(method = "rqss", lambda = 0.1) | ||
|
||
p + stat_quant_band() | ||
|
||
p + stat_quant_band(method = "rqss") | ||
|
||
p + stat_quant_band(method = "rqss", lambda = 0.1) | ||
|
||
p + stat_quant_eq() | ||
|
||
p + stat_quant_eq(method = "rqss") | ||
|
||
p + stat_quant_eq(method = "rqss", lambda = 0.1) | ||
|
||
sessionInfo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
library(quantreg) | ||
|
||
n <- 200 | ||
x <- sort(rchisq(n,4)) | ||
z <- x + rnorm(n) | ||
y <- log(x)+ .1*(log(x))^2 + log(x)*rnorm(n)/4 + z | ||
plot(x, y-z) | ||
|
||
f.N <- rqss(y ~ qss(x, constraint= "N") + z) | ||
|
||
f.I <- rqss(y ~ qss(x, constraint= "I") + z) | ||
|
||
f.CI <- rqss(y ~ qss(x, constraint= "CI") + z) | ||
|
||
lines(x[-1], f.N $coef[1] + f.N $coef[-(1:2)]) | ||
|
||
lines(x[-1], f.I $coef[1] + f.I $coef[-(1:2)], col="blue") | ||
|
||
lines(x[-1], f.CI$coef[1] + f.CI$coef[-(1:2)], col="red") | ||
|
||
## A bivariate example | ||
if(requireNamespace("interp")){ | ||
if(requireNamespace("interp")){ | ||
data(CobarOre) | ||
fCO <- rqss(z ~ qss(cbind(x,y), lambda= .08), data=CobarOre) | ||
plot(fCO) | ||
}} | ||
|
||
sessionInfo() |
157 changes: 157 additions & 0 deletions
157
tests/testthat/_snaps/stat-quant-band/stat-quant-band-formula-missing-rqss.new.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.