R

t-test and interpretation in R

Masumbuko Semba
A formal statistical test called a hypothesis test is used to confirm or disprove a statistical hypothesis. The following R hypothesis tests are demonstrated in this course. T-test with one sample T-Test of two samples T-test for paired samples Each type of test can be run using the R function t.test().The function comes with the following arguments; t.test(x, y = NULL, alternative = c("two-sided", "less", "greater"), mu = 0, paired = FALSE, var.

Combining plots in R

Masumbuko Semba
The ggplot2 package doesn’t provide a function to arrange multiple plots in a single figure (Wickham 2016). Still, some packages allow combining multiple plots into a single figure with custom layouts, width, and height, such as cowplot (Wilke 2018), gridExtra, and patchwork (Pedersen 2020). In this post we are going to use several packages, let’us load them in our session require(tidyverse) require(patchwork) require(cowplot) Sample datasets # tuna = tibble( # tl = runif(n = 120, min = 30, max = 120), # seasons = rep(c("Northeast", "Southeast", "Inter"), each = 40) # ) tuna = tibble( tl = c(rnorm(n = 40, mean = 80, sd = 30), rnorm(n = 40, mean = 61,10), rnorm(n = 40, mean = 96, 25)), seasons = rep(c("Northeast", "Southeast", "Inter"), each = 40) ) ridges = tuna %>% ggplot() + ggridges::geom_density_ridges(aes(x = tl, y = seasons, fill = seasons), position = "identity", alpha = .

The State of Spatial in R

Masumbuko Semba
R is particularly powerful for spatial statistical analysis and quantitative researchers in particular may find R more useful than GIS desktop applications. As data becomes more geographical, there is a growing necessity to make spatial data more accessible and easy to process. While there are plenty of tools out there that can make your life much easier when processing spatial data (e.g. QGIS and ArcMap) using R to conduct spatial analysis can be just as easy.

GEBCO bathymetry in R

Masumbuko Semba
As an Oceanography, one key parameter that need to get right is the bathymetry. Bathymetry is the science of determining the topography of the seafloor. Bathymetry data is used to generate navigational charts, seafloor profile, biological oceanography, beach erosion, sea-level rise, etc. There prenty of bathymetry data and one of the them is the GEBCO Gridded Bathymetry Data. The General bathymetric Chart of the Oceans (GEBCO) consists of an international group of experts in ocean mapping.

Create Artist Map of Downstreet Dar es Salaam with R and Open Street Data

Masumbuko Semba
OpenStreetMap (OSM) is a collaborative project to create a free editable geographic database of the world. The geodata underlying the maps is considered the primary output of the project (Wikipedia contributors 2021). OpenStreetMap was born in 2004 in the UK, at a time when map data sources were controlled by private and governmental players. They were expensive and highly restrictive which made them accessible only by large companies.