Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 9 commits into
base: feedback
Choose a base branch
from
Open

Feedback #1

wants to merge 9 commits into from

Commits on Oct 8, 2024

  1. Configuration menu
    Copy the full SHA
    f4c1433 View commit details
    Browse the repository at this point in the history
  2. add deadline

    github-classroom[bot] authored Oct 8, 2024
    Configuration menu
    Copy the full SHA
    b85bda7 View commit details
    Browse the repository at this point in the history
  3. Create CS_03.R

    drumondd1 committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    23520ec View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. Configuration menu
    Copy the full SHA
    a4307f5 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2024

  1. Case study 6

    # Install packages
    library(terra)
    library(spData)
    library(tidyverse)
    library(sf)
    library(ncdf4)
    
    # Download CRU Data
    download.file("https://crudata.uea.ac.uk/cru/data/temperature/absolute.nc","crudata.nc", method = "curl")
    
    # read in the data using the rast() function from the terra package
    tmean=rast("crudata.nc")
    gdal(drivers = TRUE)
    # Load the data using rast() function from the terra packagetmean = rast("crudata.nc")# Inspect the tmean objecttmeanplot(tmean)
    
    # Inspect the tmean object
    plot(tmean)
    head(tmean)
    
    # Calculate the maximum temperature for each country
    tmean_max <- max(tmean)
    
    data("world")
    plot(tmean_max)
    
    # Extract maximum temperature of each continent
    extracted_values <- terra::extract(x = tmean_max, y = world, fun=max, na.rm=T)
    
    worldclim <- bind_cols(world,extracted_values)
    plot(world$geom)
    
    # use ggplot() and geom_sf() to plot
    ggplot() +
      geom_sf(data = worldclim, aes(fill = max)) +
      scale_fill_viridis_c(name="Maximum\nTemperature (C)") +
      theme(legend.position = 'bottom')
    
    # Find the hottest country in each continent
    hottest_continent <- worldclim %>% group_by(continent) %>% arrange(desc(max), .by_group = TRUE) %>% top_n(1)
    
    ggplot() +
    geom_sf(data = world) +
    geom_sf(data = hottest_continent , aes(fill = max)) +
    scale_fill_viridis_c(name="Maximum\nTemperature (C)")
    drumondd1 committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    c393946 View commit details
    Browse the repository at this point in the history
  2. Create Case_study6.R

    drumondd1 committed Oct 21, 2024
    Configuration menu
    Copy the full SHA
    26144aa View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2024

  1. Case study 9

    drumondd1 committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    ab8581a View commit details
    Browse the repository at this point in the history
  2. Case Study 6

    drumondd1 committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    8d62d8c View commit details
    Browse the repository at this point in the history
  3. Case Study 5

    drumondd1 committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    42eeb60 View commit details
    Browse the repository at this point in the history