У нас вы можете посмотреть бесплатно How to draw spatial maps in R using ggmap without Google API key? | IMD | StatswithR | Arnab Hazra или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Here we explain how to get freely gridded rainfall data from India Meteorological Department and how to generate presentation or publication-quality spatial rainfall map across the study domain (India, here) in R/R-studio using ggmap without using Google API key. The codes for the steps explained in the video are as follows. Copy and paste them into R, run them one-by-one and try to understand what each argument is doing. #datascience #datavisualization #visualization #ggplot2 #tidyverse #terrain #mapping #spatial #statistics #spatial #covariates #India #precipitation #rainfall #rcoding #GoogleAPIkey #IMD #IMDPune #griddedrainfall Data link: https://www.imdpune.gov.in/Clim_Pred_... library(ncdf4) fname = "_Clim_Pred_LRF_New_RF25_IMD0p252020.nc" ncin = nc_open(fname) prec = ncvar_get(ncin) nc_close(ncin) dim(prec) prec.total = apply(prec, 2, rowSums) dim(prec.total) S = as.matrix(expand.grid(ncin$dim$LONGITUDE$vals, ncin$dim$LATITUDE$vals)) Y = c(prec.total) / 10 library(ggmap) keep = which(!is.na(Y)) S = S[keep, ] Y = Y[keep] data = data.frame(lon = S[ , 1], lat = S[ , 2], value = Y) colnames(data) = c("Longitude", "Latitude", "Rainfall") head(data) indbox = make_bbox(lon = c(min(S[ , 1]), max(S[ , 1])), lat = c(max(S[ , 2]), min(S[ , 2])), f = .1) ind = get_map(location = indbox, zoom = 5, maptype = "terrain") p = ggmap(ind) ggsave(p, filename = "ggplot_ind1.pdf", height = 8.5, width = 8) data = data.frame(lon = S[ , 1], lat = S[ , 2], value = Y) p = ggmap(ind) + geom_tile(data, mapping = aes(x = lon, y = lat, fill = value)) ggsave(p, filename = "ggplot_ind2.pdf", height = 8, width = 8) p = ggmap(ind) + geom_tile(data, mapping = aes(x = lon, y = lat, fill = value), width = 0.27, height = 0.27) ggsave(p, filename = "ggplot_ind3.pdf", height = 8, width = 8) p0 = ggmap(ind) + geom_tile(data, mapping = aes(x = lon, y = lat, fill = value), width = 0.27, height = 0.27) + xlab("Longitude") + ylab("Latitude") + ggtitle("Annual precipitation (2020)") + theme(plot.title = element_text(hjust = 0.5, size=25), axis.text=element_text(size=20), axis.title=element_text(size=20)) ggsave(p0, filename = "ggplot_ind4.pdf", height = 8, width = 8) library(grDevices) p = p0 + scale_fill_gradientn(colours = topo.colors(30)) ggsave(p, filename = "ggplot_ind5.pdf", height = 8, width = 8) p1 = p0 + scale_fill_gradientn(colours = topo.colors(30), name = "Rainfall (cm)") + theme(legend.key.size = unit(0.3, "in"), legend.text = element_text(size=15), legend.title = element_text(size=15), legend.position = c(0.8, 0.2)) ggsave(p1, filename = "ggplot_ind6.pdf", height = 8, width = 8) baseData = map_data("world") p = p1 + geom_path(data=baseData, aes(x=long, y=lat, group=group), colour="black") ggsave(p, filename = "ggplot_ind7.pdf", height = 8, width = 8)