diff --git a/docs/articles/climatic-indices.html b/docs/articles/climatic-indices.html index b70f7f1..21df9be 100644 --- a/docs/articles/climatic-indices.html +++ b/docs/articles/climatic-indices.html @@ -82,7 +82,7 @@ -
+
@@ -585,7 +585,7 @@

filter(event == 1) %>% group_by(ID_coords, year, n_frost) %>% summarise(Tmin_frost_avg = mean(Tmin)/100) %>% # Mean minimum temperature of frost days - complete(ID_coords, year, fill = list(n_frost = 0, Tmin_frost_avg = NA)) %>% + complete(ID_coords, year, fill = list(n_frost = 0, Tmin_frost_avg = NA)) %>% kable()

@@ -644,7 +644,7 @@

summarise(max_days_norain = max(length), # Maximum length of periods of consecutive days without rain per year mean_days_norain = mean(length), nevents = sum(length > threshold)) %>% # No. of events per year - complete(ID_coords, year, + complete(ID_coords, year, fill = list(max_days_norain = NA, mean_days_norain = NA, nevents = 0)) %>% kable(digits = 1)

diff --git a/docs/articles/points-df-mat-sf.html b/docs/articles/points-df-mat-sf.html index 0888765..4da49fc 100644 --- a/docs/articles/points-df-mat-sf.html +++ b/docs/articles/points-df-mat-sf.html @@ -82,7 +82,7 @@ -
+
- - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + +
1-5.83670537.42518-5.35691237.69926 2008-01-01 08 enero7.304.5214.395.183.0613.92
1-5.83670537.42518-5.35691237.69926 2008-01-02 08 enero23.499.8515.9127.207.7915.99
1-5.83670537.42518-5.35691237.69926 2008-01-03 08 enero3.098.5414.605.606.9714.82
1-5.83670537.42518-5.35691237.69926 2008-01-04 08 enero 0.006.5514.215.6814.50
1-5.83670537.42518-5.35691237.69926 2008-01-05 08 enero 0.006.2114.645.2314.73
1-5.83670537.42518-5.35691237.69926 2008-01-06 08 enero 0.0012.0615.5210.6215.99


Finally, you can visualize the daily climate results. For example, let’s plot the precipitation for one of the sites:

-
+
 clim_site1 <- clim_join %>% 
   filter(ID_coords == 1)
 
@@ -279,12 +278,12 @@ 


Or calculate the daily mean temperature and plot it against tmin and tmax:

-
+
 library(tidyr)
 
 clim_df <- clim_join %>%
   mutate(tmean = (tmin + tmax) / 2) %>%
-  pivot_longer(
+  pivot_longer(
     cols = c("tmin", "tmax", "tmean"),
     names_to = "temp_vars",
     values_to = "temp_values")
@@ -295,11 +294,11 @@ 

ylab("Temperature (ºC)") + xlab("") + theme_bw()

-
+
 
 ggplot(clim_df, aes(x = date, y = temp_values, color = temp_vars)) + 
   geom_point(alpha = .1) +
-  scale_color_discrete(name = "Variables", 
+  scale_color_discrete(name = "Variables", 
                        guide = guide_legend(override.aes = list(alpha = 1))) +
   ylab("Temperature (ºC)") + xlab("Date") +
   theme_bw()
@@ -311,12 +310,12 @@

Example 2: Introducing coordinates as a matrix

easyclimate handles different input data, try now with matrices!

Here we are retrieving daily precipitation data for a single year (2008).

-
+
 
 coords_mat <- as.matrix(coords)
 
 Sys.time()
-## [1] "2021-07-09 23:39:42 EDT"
+## [1] "2021-10-14 11:57:29 CEST"
 
 mat_prcp <- get_daily_climate( 
   coords = coords_mat, 
@@ -325,16 +324,16 @@ 

) Sys.time() -## [1] "2021-07-09 23:40:01 EDT" +## [1] "2021-10-14 11:57:36 CEST" head(mat_prcp) ## ID_coords x y date Prcp -## 1 1 -5.836705 37.42518 2008-01-01 730 -## 2 1 -5.836705 37.42518 2008-01-02 2349 -## 3 1 -5.836705 37.42518 2008-01-03 309 -## 4 1 -5.836705 37.42518 2008-01-04 0 -## 5 1 -5.836705 37.42518 2008-01-05 0 -## 6 1 -5.836705 37.42518 2008-01-06 0 +## 1 1 -5.356912 37.69926 2008-01-01 518 +## 2 1 -5.356912 37.69926 2008-01-02 2720 +## 3 1 -5.356912 37.69926 2008-01-03 560 +## 4 1 -5.356912 37.69926 2008-01-04 0 +## 5 1 -5.356912 37.69926 2008-01-05 0 +## 6 1 -5.356912 37.69926 2008-01-06 0 clim_mat <- mat_prcp %>% mutate( @@ -353,7 +352,7 @@

ylab("Daily precipitation (mm)") + xlab("Date") + theme_bw()

-
+
 
 month_name <- format(ISOdate(2021, 1:12, 1), "%B")
 
@@ -372,7 +371,7 @@ 

Example 3: Introducing coordinates as simple feature objects

Here we introduce coordinates as a sf object, and retrieve minimum temperature for a single day (1 January 2001).

-
+
 library(sf)
 
 coords_sf <- st_as_sf(
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-1-1.png
index 980adf9..663840c 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-1-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-1-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-4-1.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-4-1.png
index ae1d58f..e915655 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-4-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-4-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-1.png
index e61ff0a..7ec9126 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-2.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-2.png
index 9509c9e..8071cdf 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-2.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-5-2.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-1.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-1.png
index 10fa641..dc6b7e8 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-1.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-2.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-2.png
index 3638d32..4dbfa38 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-2.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-6-2.png differ
diff --git a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-7-1.png b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-7-1.png
index 9c85ac8..f2ecf89 100644
Binary files a/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-7-1.png and b/docs/articles/points-df-mat-sf_files/figure-html/unnamed-chunk-7-1.png differ
diff --git a/docs/articles/polygons-raster.html b/docs/articles/polygons-raster.html
index 734c6e3..6cb0790 100644
--- a/docs/articles/polygons-raster.html
+++ b/docs/articles/polygons-raster.html
@@ -82,7 +82,7 @@
 
       
 
-      
+