Hi, I'm, very beginning user of RStudio, so my commands may look a bit chaotic.
I have to merge different columns from different files: I want to merge column "dane_mc$id" with "polska$wmo_id". I want to:
-count the average from "dane_mc$t2_mean_mon",
-merge the column with average with "polska$wmo_id",
-organize the names of stations alphabetically (dane_mc$station_names).
My code:
install.packages('dplyr')
#Cwiczenia z meteorologii i klimatologii
#ustawienie katalogu roboczego
setwd('C:/Users/marlew33/Desktop/klimat')
getwd()
install.packages('dplyr')
install.packages('RCurl')
install.packages('XML')
install.packages('remotes')
#wczytujemy i instalujemy potrzebne biblioteki
library(dplyr)
library(RCurl)
library(XML)
library(remotes)
install_github("bczernecki/climate")
'force=TRUE'
library(climate)
imgw_hydro_abbrev
#pobieramy metadane o stacjach w Polsce
install.packages("maps")
polska <- stations_ogimet(country='Poland', add_map=T)
head(polska)
#w głowie się kręci się
view(polska)
tail(polska)
str(polska)
dim(polska)
polska$station_names
nazwy_stacji <- polska$station_names
polska$wmo_id
numery_stacji <- polska$wmo_id
c(1:10)
c(1966:2023)
dane_mc <- meteo_imgw(interval="monthly", rank="synop", year=c(1966:2022), coords=F)
dane_mc
view(dane_mc)
colnames(dane_mc)
str(dane_mc)
unique(dane_mc$station)
#sprawdzwielkosc
object.size(dane_mc)
saveRDS(dane_mc, 'dane_mc_polska.rds')
install.packages('pryr')
library(pryr)
dir()
mmp <- readRDS('dane_mc_polska.rds')
unique(mmp$rr_montly)
unique(mmp$yy)
colnames(mmp)
boxplot(mmp$tmax_abs)
head(mmp)
hist(mmp$tmax_abs)
unique(mmp$station)
unique(mmp[,c("station", 'X','Y')])
head(mmp)
polska[1,5]
polska[(1:2),4]
polska[1:200,4]
polska[1:31,c(1,5)]
library(dplyr)
str(polska)
polska$station_names
str(dane_mc_polska)
całete <- dane_mc_polska$t2m_mean_mon
całete
head(mmp$rr_montly)
meteo_imgw
dane_mc <- meteo_imgw(interval = 'monthly', rank='synop', year = c(1966:2023), coords = T)
head(dane_mc)
mmp$station[mmp$station=="KOŁOBRZEG-DŹWIRZYNO"] <- "KOŁOBRZEG"
mmp$station[mmp$station=="WROCŁAW-STRACHOWICE"] <- "WROCŁAW"
mmp$station[mmp$station=="WARSZAWA-OKĘCIE"] <- "WARSZAWA"
mmp$station[mmp$station=="ŁÓDŹ-LUBLINEK"] <- "ŁÓDŹ"
mmp$x[mmp$station == "BYDGOSZCZ"] <- 18.00697320455025
mmp$y[mmp$station == "BYDGOSZCZ"] <- 53.106748886337996
mmp$X[mmp$station == "HALA GĄSIENICOWA"] <- 20.005760788001748
mmp$Y[mmp$station == "HALA GĄSIENICOWA"] <- 49.24411556595931