diff --git a/Backend/Dashboard/.Rhistory b/Backend/Dashboard/.Rhistory new file mode 100644 index 0000000..88d6729 --- /dev/null +++ b/Backend/Dashboard/.Rhistory @@ -0,0 +1,512 @@ +(player_name %in% c("Anna Adelusi", "Terry Ruth Enweonwu") & efficienza >= percent(0.27)) | +(player_name %in% c("Anna Haak", "Lena Stigrot") & efficienza >= percent(0.34)) | +(player_name %in% c("Alice Tanase", "Madison Kubik") & efficienza >= percent(0.24)) | +(player_name %in% c("Saly Thior", "Amandha Sylves", "Anna Hall", "Beatrice Molinaro") & efficienza >= percent(0.44)) | +efficienza >= percent(0.42) ~ "lightgreen", +(player_name %in% c("Anna Adelusi", "Terry Ruth Enweonwu") & efficienza > percent(0.24) & efficienza < percent(0.27)) | +(player_name %in% c("Anna Haak", "Lena Stigrot") & efficienza > percent(0.30) & efficienza < percent(0.34)) | +(player_name %in% c("Alice Tanase", "Madison Kubik") & efficienza > percent(0.20) & efficienza < percent(0.24)) | +(player_name %in% c("Saly Thior", "Amandha Sylves", "Anna Hall", "Beatrice Molinaro") & efficienza > percent(0.38) & efficienza < percent(0.44)) | +(efficienza > percent(0.41) & efficienza < percent(0.42)) ~ "orange", +(player_name %in% c("Anna Adelusi", "Terry Ruth Enweonwu") & efficienza <= percent(0.24)) | +(player_name %in% c("Anna Haak", "Lena Stigrot") & efficienza <= percent(0.30)) | +(player_name %in% c("Alice Tanase", "Madison Kubik") & efficienza <= percent(0.20)) | +(player_name %in% c("Saly Thior", "Amandha Sylves", "Anna Hall", "Beatrice Molinaro") & efficienza <= percent(0.38)) | +efficienza < percent(0.41) ~ "lightcoral", +TRUE ~ NA_character_ +)) +fig <- plot_ly( +x = data_plot$player_name, +y = round(data_plot$efficienza, digits = 2), +marker = list(color = data_plot$color), +name = "Efficienza in Attacco", +type = "bar", +text = round(data_plot$efficienza, digits = 2), textposition = 'auto', marker = list(color = 'rgb(158,202,225)', line = list(color = 'rgb(8,48,107)', width = 1.5))) +fig <- fig %>% layout(title = "Efficienza in Attacco", +xaxis = list(title = ""), +yaxis = list(title = "")) +fig +saveWidget(fig, "Attacco.html") +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate") +View(attack_rate) +View(px) +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == 1) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate") +View(attack_rate) +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName) %>% +group_by(team, start_zone, visiting_setter_position) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate") +View(attack_rate) +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == 1) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate") +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == 2) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate") +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == 3) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == 3) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == 3) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +saveWidget(fig, "Distribuzione3.html") +for (i in 1:6){ +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +saveWidget(fig, html_name) +} +for (i in 1:6){ +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +fig <- ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +saveWidget(fig, html_name) +} +for (i in 1:6){ +attack_rate <- px %>% +dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% +dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% +ungroup +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +fig <- ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +saveWidget(fig, html_name) +} +for (i in 1:6){ +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +fig <- ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +#saveWidget(fig, html_name) +} +for (i in 1:6){ +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +fig <- ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +saveWidget(fig, html_name) +} +for (i in 1:6){ +attack_rate <- px %>% dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% ungroup +## add x, y coordinates associated with the zones +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +## for team 2, these need to be on the top half of the diagram +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +#ggplot(attack_rate, aes(x, y, fill = rate)) + geom_tile() + ggcourt(labels = teams(px)) + scale_fill_gradient2(name = "Attack rate") +# Round the rate to the second digit +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +# Plotting with rounded percentage on each position +ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +saveWidget(fig, html_name) +} +fig +saveWidget(fig, html_name) +saveWidget(fig, "Distribuzione") +saveWidget(fig, "Distribuzione.html") +saveWidget(fig, "Distr.html") +library(ggplot2) +library(htmlwidgets) +for (i in 1:6) { +attack_rate <- px %>% +dplyr::filter(skill == "Attack", team == teamName, visiting_setter_position == i) %>% +group_by(team, start_zone) %>% +dplyr::summarize(n_attacks = n()) %>% +mutate(rate = n_attacks/sum(n_attacks)) %>% +ungroup +attack_rate <- cbind(attack_rate, dv_xy(attack_rate$start_zone, end = "lower")) +tm2i <- attack_rate$team == teams(px)[2] +attack_rate[tm2i, c("x", "y")] <- dv_flip_xy(attack_rate[tm2i, c("x", "y")]) +attack_rate$rate_rounded <- round(attack_rate$rate, 2) +fig <- ggplot(attack_rate, aes(x, y, fill = rate_rounded)) + +geom_tile() + +geom_text(aes(label = paste0(round(rate_rounded * 100, 2), "%")), color = "black", size = 3) + +ggcourt(labels = teams(px)) + +scale_fill_gradient2(name = "Attack rate (%)", labels = scales::percent_format(accuracy = 0.01)) +html_name <- paste0("Distribuzione", i, ".html") +# Save the plot as an HTML file +saveWidget(fig, file = html_name) +} +install.packages("datavolley", repos = 'https://cloud.r-project.org') +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A1", +date = "2019-06-01", +bearer = bearer) +r_20240510 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2024-05-10", +bearer = bearer) +#### Setup +# Load packages +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A1", +date = "2019-06-01", +bearer = bearer) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-02", +bearer = bearer) +#### Setup +# Load packages +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +source("C:/Users/mirko/Downloads/light_pollution.R") +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +remove.packages("sf") +install.packages("sf") +install.packages("sf") +#### Setup +# Load packages +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=2, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +library(blackmarbler) +library(geodata) +library(sf) +library(terra) +library(ggplot2) +library(tidyterra) +library(lubridate) +#### Define NASA bearer token +token <- "eyJ0eXAiOiJKV1QiLCJvcmlnaW4iOiJFYXJ0aGRhdGEgTG9naW4iLCJzaWciOiJlZGxqd3RwdWJrZXlfb3BzIiwiYWxnIjoiUlMyNTYifQ.eyJ0eXBlIjoiVXNlciIsInVpZCI6Im1pcmtvOTgiLCJleHAiOjE3MjUzNTk1MTMsImlhdCI6MTcyMDE3NTUxMywiaXNzIjoiRWFydGhkYXRhIExvZ2luIn0.6KrS82Gb6rjTbIaBXROQrNfJRXCH7NH3si_UQgz5h3h5lsEiemz63LJL1X1YnMqpMAr0Pik2_LbA5PDKRtLqgaBKEnMFSsppuDHu4p0Pa7OBTWNBbYCEsuIZ2yfwVIc2sfr0g37g2hSaHqDcXMBGrppzrGCZtx10pDbmrrIdfnVE7tsFADhdPGryIgjs0XrDjSzSvLt9Z9MaPo-fXrWItTRoaSpa8aEaAsB3w7E4XX_wnLw54xfighLY-19ERWoEMyHGc6UaZGpkMZk3zyvVTGJnkmqJL1QvW3w0DfSRx0kW8TnFlfPrQ7Ay2N5t-n-wpApvPu-d_qloBNNtZx1eew" +bearer <- token +#### ITALY +### ROI +# Define region of interest (roi). The roi must be (1) an sf polygon and (2) +# in the WGS84 (epsg:4326) coordinate reference system. Here, we use the +# getData function to load a polygon of Ghana +roi_sf <- gadm(country = "ITA", level=1, path = tempdir()) +### Daily data +r_20190601 <- bm_raster(roi_sf = roi_sf, +product_id = "VNP46A2", +date = "2019-06-01", +bearer = bearer) +remotes::install_github("openvolley/datavolley") +remotes::install_github("openvolley/datavolley") +install.packages(c("cli", "hdf5r", "knitr", "sp", "yaml")) +install.packages(c("boot", "class", "cluster", "codetools", "foreign", "KernSmooth", "lattice", "mgcv", "nlme", "nnet", "rpart", "spatial", "survival"), lib="C:/Program Files/R/R-4.3.0/library") +library(cli) +remove.packages("cli") +install.packages("cli") +remotes::install_github("openvolley/datavolley") +shiny::runApp('GitHub/CuneoWebsite.io/Backend') +rsconnect::setAccountInfo(name='mirko98', token='A45152018784DEF748AE689356AEDDCB', secret='Di9j9QiHvpabWeNNYRg9Scn5hlguSwsQJBoswcs/') +library(rsconnect) +deployApp('C:\Users\mirko\Documents\GitHub\CuneoWebsite.io\Backend') +deployApp('C:/Users/mirko/Documents/GitHub/CuneoWebsite.io/Backend') +remotes::install_github("openvolley/ovlytics") +deployApp('C:/Users/mirko/Documents/GitHub/CuneoWebsite.io/Backend') +deployApp('C:/Users/mirko/Documents/GitHub/CuneoWebsite.io/Backend/Dashboard') +runApp('GitHub/CuneoWebsite.io/Backend') +setwd('C:/Users/mirko/Documents/GitHub/CuneoWebsite.io/Backend/Dashboard') +runApp() +runApp() +runApp() +runApp() +runApp() diff --git a/.github/workflows/update.yml b/Old Files/update.yml similarity index 100% rename from .github/workflows/update.yml rename to Old Files/update.yml