From 97e43792aed41fa1e470e66529435102585f6eb1 Mon Sep 17 00:00:00 2001 From: andrewzm Date: Tue, 2 Apr 2024 12:16:03 +1100 Subject: [PATCH] Change to RnW file so new version passes vignette check --- DESCRIPTION | 4 +- vignettes/FRK_intro-concordance.tex | 21 ++++---- vignettes/FRK_intro.Rnw | 82 ++++++++++++++++++++--------- 3 files changed, 70 insertions(+), 37 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 16efea6..f7a501c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: FRK Type: Package Title: Fixed Rank Kriging -Version: 2.2.1 -Date: 2023-12-08 +Version: 2.2.2 +Date: 2024-02-25 Authors@R: c( person("Andrew", "Zammit-Mangion", , "andrewzm@gmail.com", c("aut", "cre")), person("Matthew", "Sainsbury-Dale", , "msdale@uow.edu.au", c("aut"))) diff --git a/vignettes/FRK_intro-concordance.tex b/vignettes/FRK_intro-concordance.tex index 1911c59..5bfe597 100644 --- a/vignettes/FRK_intro-concordance.tex +++ b/vignettes/FRK_intro-concordance.tex @@ -1,12 +1,11 @@ \Sconcordance{concordance:FRK_intro.tex:FRK_intro.Rnw:% -1 223 1 50 0 1 7 48 1 4 0 7 1 4 0 17 1 7 0 5 1 4 0 14 1 4 0 6 1 4 % -0 8 1 7 0 12 1 4 0 10 1 15 0 8 1 4 0 12 1 6 0 15 1 16 0 8 1 4 0 6 % -1 4 0 30 1 4 0 5 1 4 0 11 1 4 0 7 1 4 0 10 1 1 22 12 1 4 0 8 1 4 0 % -8 1 4 0 14 1 4 0 12 1 4 0 13 1 8 0 12 1 3 0 9 1 1 5 19 1 13 0 8 1 % -4 0 3 1 1 6 7 1 1 11 7 1 1 5 7 1 1 7 14 1 4 0 11 1 4 0 5 1 8 0 6 1 % -4 0 8 1 4 0 6 1 4 0 15 1 4 0 12 1 4 0 10 1 15 0 7 1 4 0 6 1 4 0 6 % -1 4 0 20 1 4 0 11 1 4 0 8 1 1 9 7 1 1 6 6 1 4 0 20 1 4 0 6 1 9 0 % -12 1 4 0 8 1 4 0 6 1 4 0 10 1 4 0 25 1 4 0 10 1 1 12 22 1 4 0 21 1 % -4 0 1 1 1 10 15 1 1 6 12 1 1 3 12 1 1 4 15 1 1 27 2 1 1 52 6 1 4 0 % -19 1 4 0 8 1 1 12 10 1 4 0 7 1 4 0 12 1 4 0 10 1 3 0 3 1 1 42 5 1 % -4 0 69 1} +1 218 1 50 0 1 7 48 1 4 0 7 1 4 0 17 1 7 0 5 1 4 0 14 1 4 0 6 1 4 0 8 1 % +6 0 12 1 4 0 10 1 12 0 8 1 4 0 12 1 4 0 15 1 12 0 8 1 4 0 6 1 4 0 30 1 % +4 0 5 1 3 0 11 1 4 0 7 1 4 0 9 1 1 23 12 1 4 0 8 1 4 0 8 1 4 0 14 1 4 0 % +12 1 4 0 13 1 4 0 12 1 3 0 8 1 1 6 19 1 4 0 8 1 4 0 3 1 1 6 6 1 1 17 6 % +1 1 11 6 1 1 13 14 1 4 0 11 1 4 0 5 1 7 0 6 1 4 0 8 1 4 0 6 1 4 0 15 1 % +4 0 12 1 4 0 10 1 15 0 7 1 4 0 6 1 3 0 6 1 4 0 20 1 4 0 11 1 4 0 7 1 1 % +10 6 1 1 7 6 1 4 0 20 1 14 0 6 1 8 0 12 1 4 0 8 1 4 0 6 1 4 0 10 1 4 0 % +25 1 4 0 9 1 1 13 22 1 8 0 21 1 4 0 1 1 1 10 14 1 1 12 11 1 1 9 11 1 1 % +10 15 1 1 27 2 1 1 52 6 1 3 0 19 1 4 0 7 1 1 13 10 1 4 0 7 1 4 0 12 1 4 % +0 10 1 2 0 3 1 1 42 5 1 3 0 69 1} diff --git a/vignettes/FRK_intro.Rnw b/vignettes/FRK_intro.Rnw index 4f2a560..843ca38 100644 --- a/vignettes/FRK_intro.Rnw +++ b/vignettes/FRK_intro.Rnw @@ -615,45 +615,64 @@ mumax <- quantile(X$mu,0.99) @ <>= -g1 <- (EmptyTheme() + - geom_point(data=data.frame(AIRS_05_2003), - aes(lon,lat, - colour=pmin(pmax( - co2avgret,mumin), +df_to_plot <- data.frame( + lon = as.numeric(AIRS_05_2003$lon), + lat = as.numeric(AIRS_05_2003$lat), + co2avgret = as.numeric(AIRS_05_2003$co2avgret) +) +g1 <- (ggplot(df_to_plot) + geom_point(data = df_to_plot, + aes(lon, lat, + colour = pmin(pmax( + co2avgret, mumin), mumax)), - pch=46) + - scale_colour_distiller(palette="Spectral", - guide_legend(title="co2 (ppm)") - ) + - coord_map("mollweide")) %>% - draw_world(inc_border=TRUE) + - xlab("lon (deg)") + - ylab("lat (deg)") + pch = 46) + + scale_colour_distiller(palette = "Spectral", + name = "co2 (ppm)") + + coord_map("mollweide")) %>% + draw_world(inc_border=TRUE) + + xlab("lon (deg)") + + ylab("lat (deg)") + + theme_minimal() + + theme(axis.text.x=element_blank(), + axis.ticks.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks.y=element_blank()) + print(g1) @ <>= -g2 <- (EmptyTheme() + +g2 <- (ggplot() + geom_polygon(data=X, aes(lon,lat,fill=pmin(pmax(mu,mumin),mumax),group=id))+ scale_fill_distiller(palette="Spectral",name="pred. (ppm)",limits=c(mumin,mumax)) + coord_map("mollweide")) %>% draw_world(inc_border=TRUE)+ xlab("lon (deg)") + - ylab("lat (deg)") + ylab("lat (deg)") + + theme_minimal() + + theme(axis.text.x=element_blank(), + axis.ticks.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks.y=element_blank()) print(g2) @ <>= X$se <- pmax(sqrt(X$var),0.32) -g3 <- (EmptyTheme() + +g3 <- (ggplot() + geom_polygon(data=X, aes(lon,lat,fill=se,group=id))+ scale_fill_distiller(palette="BrBG",name="s.e. (ppm)") + coord_map("mollweide")) %>% draw_world(inc_border=TRUE)+ xlab("lon (deg)") + - ylab("lat (deg)") + ylab("lat (deg)") + + theme_minimal() + + theme(axis.text.x=element_blank(), + axis.ticks.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks.y=element_blank()) print(g3) @ @@ -998,7 +1017,7 @@ mumax <- max(X$mu) <>= -g1 <- (EmptyTheme() + +g1 <- (ggplot() + geom_point(data=dplyr::filter(AIRS_05_2003,day %in% c(4,8,12)), aes(lon,lat, colour=pmin(pmax( @@ -1007,24 +1026,34 @@ g1 <- (EmptyTheme() + size=0.5) + facet_grid(~day)+ scale_colour_distiller(palette="Spectral", - guide_legend(title="co2 (ppm)")) + + name="co2 (ppm)") + coord_map("mollweide") + xlab("lon (deg)") + - ylab("lat (deg)")) %>% + ylab("lat (deg)") + + theme_minimal() + + theme(axis.text.x=element_blank(), + axis.ticks.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks.y=element_blank()) ) %>% draw_world(inc_border=TRUE) print(g1) @ <>= -g2 <- (EmptyTheme() + +g2 <- (ggplot() + geom_polygon(data=filter(X,(t %in% c(4,8,12)) & abs(lon) < 175), aes(lon,lat,fill=mu,group=id))+ scale_fill_distiller(palette="Spectral",name="pred. (ppm)") + coord_map("mollweide") + facet_grid(~t) + xlab("lon (deg)") + - ylab("lat (deg)")) %>% + ylab("lat (deg)") + + theme_minimal() + + theme(axis.text.x=element_blank(), + axis.ticks.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks.y=element_blank())) %>% draw_world(inc_border=FALSE) print(g2) @@ -1033,14 +1062,19 @@ print(g2) <>= X$se <- sqrt(X$var) -g3 <- (EmptyTheme() + +g3 <- (ggplot() + geom_polygon(data=filter(X,(t %in% c(4,8,12)) & abs(lon) < 175), aes(lon,lat,fill=se,group=id))+ scale_fill_distiller(palette="BrBG",name="s.e. (ppm)") + coord_map("mollweide") + facet_grid(~t) + xlab("lon (deg)") + - ylab("lat (deg)")) %>% + ylab("lat (deg)") + + theme_minimal() + + theme(axis.text.x=element_blank(), + axis.ticks.x=element_blank(), + axis.text.y=element_blank(), + axis.ticks.y=element_blank()) ) %>% draw_world(inc_border=FALSE) print(g3)