Ziling Zhen
  • About Me
  • Projects

On this page

  • Introduction
  • Approach
    • Crops
    • Fish
    • Animal Products
    • Minerals
  • Additional Data
    • Seeds
    • Animal Origins
    • Wrangling:
    • Fish Map

Stardew Valley Data Acquisition

Author

Ziling Zhen & Rain Hartos

Published

October 27, 2024

Introduction

For our project, we decided to scrape data from the wiki pages of one of our favorite video games, Stardew Valley. Stardew Valley is a popular indie farming game that allows players to take on the role of a character who inherits a run-down farm from their grandfather. In the game, players can grow crops, raise animals, fish, mine, and engage in social activities with the towns people.

For our project, we were interested in compiling a list of items from the game that can be farmed or collected. The only way to make money from the game is by selling these items, and the price of the item depends on the quality of the item and the profession(s) of the player. Thus, our dataset includes information on the name, category, subcategory, and the different price points of the item depending on item quality (regular, silver, gold, and iridium) and player’s profession.

To view the qmd, click here.

Approach

All of our data has been accumulated from the Stardew Valley Wiki page. Since each item in the game has a different page and not all of the pages followed a similar structure, we used a combination of harvesting the data in both table form and anywhere on the webpage using rvest with html_text. In the end, we were able to create a dataset from the more important item categories: crops, fish, animal products, and minerals.

Crops

Crops was the most difficult item to scrape from the wiki, since not all of the pages are structured the same. However, we tried our best to automate where we could.

We start be getting a list of all the different crops in the game.

Code
#check that we are allowed to scrape the wiki
robotstxt::paths_allowed("https://stardewvalleywiki.com/Stardew_Valley_Wiki")

 stardewvalleywiki.com                      
[1] TRUE
Code
session <- bow("https://stardewvalleywiki.com/Stardew_Valley_Wiki", force = TRUE)

# scrape crops page
crops <- bow("https://stardewvalleywiki.com/Crops", force = TRUE)

result <- scrape(crops) |>
  html_nodes(css = "table") |>
  html_table(header = TRUE, fill = TRUE)

seasonal_crops <- result[[134]][2] #table of the season crops so we can use that list

seasonal_crops <- seasonal_crops |>
  mutate(Crops = strsplit(Crops, " • ", fixed = TRUE)) |>
  unnest(Crops) |>
  mutate(Crops = str_replace_all(Crops, " ", "_")) |>
  distinct(Crops)

Create our helper functions for crops:

Code
# function for getting the price at a given page and css selector
get_price <- function(page, css_selector) {
  page |>
  html_nodes(css_selector) |>
  html_text()
}

# function for creating a tibble of base prices, no profession, for a given crop page
crop_base_prices <- function(crop, tiller = FALSE) {
  url <- str_c("https://stardewvalleywiki.com/", crop)
  page <- read_html(url)
  
  qualities <- c("regular", "silver", "gold", "iridium")
  prices <- list()
  
  for (i in seq_along(qualities)) {
    if (tiller) {
      selector <- str_c("tr:nth-child(10) td+ td tr:nth-child(", i, ") td+ td")
    } else {
      selector <- str_c("tr:nth-child(10) tr td:nth-child(1) tr:nth-child(", i, ") td+ td")
    }
    price <- get_price(page, selector)
    prices[[qualities[i]]] <- parse_number(price)
  }
  
  tibble(
    item = crop,
    regular_price = prices$regular,
    silver_price = prices$silver,
    gold_price = prices$gold,
    iridium_price = prices$iridium
  )
}

Create the tibbles for seasonal crops using the helper functions. Note that items 46 (Tea_Leaves), 44 (Sweet Gem Berry), 43 (Qi_Fruit), 41 (Cactus_Fruit), 36 (Grape), 4 (Coffee_Bean) have issues when using the functions, so we will scrape the data manually without the functions.

Code
# list of all our seasonal crops
seasonal_crops_list <- pull(seasonal_crops) # list of our crops tibble

# list of crops, excluding those with known issues
valid_crops_list <- seasonal_crops_list[-c(46, 44, 43, 41, 36, 4)]

# base prices without profession
base_crop_prices <- valid_crops_list |>
  purrr::map_dfr(~ crop_base_prices(.x)) |>
  mutate(profession = as.character(NA))

# prices with Tiller profession
tiller_crop_prices <- valid_crops_list |>
  purrr::map_dfr(~ crop_base_prices(.x, tiller = TRUE)) |>
  mutate(profession = "tiller")

# combine base and tiller crop prices
seasonal_crop_prices <- bind_rows(base_crop_prices, tiller_crop_prices)

Do the same for non seasonal crops:

Code
# non-seasonal crops list, excluding problematic items
other_crops <- c("Apple", "Blackberry", "Pomegranate", "Wild_Plum", "Apricot", 
                 "Cherry", "Spice_Berry", "Peach", "Orange", "Crystal_Fruit", 
                 "Banana", "Mango", "Fiddlehead_Fern")[-c(10, 7, 4, 2)]

# base prices without profession
base_other_crops <- other_crops |>
  purrr::map_dfr(~ crop_base_prices(.x)) |>
  mutate(profession = as.character(NA))

# prices with Tiller profession
tiller_other_crops <- other_crops |>
  purrr::map_dfr(~ crop_base_prices(.x, tiller = TRUE)) |>
  mutate(profession = "tiller")

# combine base and tiller prices into one table and arrange by item
nonseasonal_crop_tbl <- bind_rows(base_other_crops, tiller_other_crops) |>
  arrange(item)

Finally, create a function for the weird crops that have missing quality or selector path was different

Code
# function for the crops that do not have different qualities
crop_weird_prices <- function(item, selector){
  url <- str_c("https://stardewvalleywiki.com/", item)
  page <- read_html(url)
  regular_price <- get_price(page, selector)
  
  tibble(item = item,
      regular_price = parse_number(regular_price))
}

# function for the crops that have different qualities. the Berry is for the fruits that have a weird selector that seems to follow a similar pattern.
crop_weird_prices_w_quality <- function(crop, tiller = FALSE, berry = FALSE ){
  url <- str_c("https://stardewvalleywiki.com/", crop)
  page <- read_html(url)
  
  qualities <- c("regular", "silver", "gold", "iridium")
  prices <- list()
  
  for (i in seq_along(qualities)) {
    if (tiller) {
      selector <- str_c("tr:nth-child(11) td+ td tr:nth-child(", i, ") td+ td")
    } else if (berry){
      selector <- str_c("tr:nth-child(9) tr:nth-child(", i, ") td+ td")
    }else {
      selector <- str_c("tr:nth-child(11) tr td:nth-child(1) tr:nth-child(", i, ") td+ td")
    }
    price <- get_price(page, selector)
    prices[[qualities[i]]] <- parse_number(price)
  }
  
  tibble(
    item = crop,
    regular_price = prices$regular,
    silver_price = prices$silver,
    gold_price = prices$gold,
    iridium_price = prices$iridium
  )
}

Now we make all of the tibbles for the weird crops.

Code
# tea leaves
base_tea_leaves <- crop_weird_prices("Tea_Leaves",
                                     "tr:nth-child(10) tr td:nth-child(1) td+ td")

tiller_tea_leaves <- crop_weird_prices("Tea_Leaves",
                                     "tr:nth-child(10) td+ td td+ td")

tea_leaves <-bind_rows(base_tea_leaves, tiller_tea_leaves)

# qi fruit
base_qi_fruit <-crop_weird_prices("Qi_Fruit",
                                  "tr:nth-child(9) tr td:nth-child(1) td+ td")

tiller_qi_fruit <-crop_weird_prices("Qi_Fruit",
                                  "tr:nth-child(9) td+ td td+ td")

qi_fruit <-bind_rows(base_qi_fruit, tiller_qi_fruit)

# cactus fruit
cactus_fruit <- crop_weird_prices_w_quality("Cactus_Fruit")

cactus_fruit_tiller <- crop_weird_prices_w_quality("Cactus_Fruit", tiller = TRUE)

cactus_fruit <-bind_rows(cactus_fruit, cactus_fruit_tiller)

# grape
grape <- crop_weird_prices_w_quality("Grape")

grape_tiller <- crop_weird_prices_w_quality("Grape", tiller = TRUE)

grape <-bind_rows(grape, grape_tiller)

# coffee bean
coffee_bean <- crop_weird_prices_w_quality("Coffee_Bean")

# wild plum
wild_plum <- crop_weird_prices_w_quality("Wild_Plum", berry = TRUE)

# spice berry
spice_berry <- crop_weird_prices_w_quality("Spice_Berry", berry = TRUE)

# crystal fruit
crystal_fruit <- crop_weird_prices_w_quality("Crystal_Fruit", berry = TRUE)

# Finally, blackberry is just weird and likes to be different, so we did not use a function for it. 
#Blackberry

# base
url <- str_c("https://stardewvalleywiki.com/", "Blackberry")
page <- read_html(url)

qualities <- c("regular", "silver", "gold", "iridium")
prices <- list()

# loop to retrieve and parse prices
for (i in seq_along(qualities)) {
  price <- get_price(page, str_c("tr:nth-child(9) tr td:nth-child(1) tr:nth-child(", i, ") td+ td"))
  prices[[qualities[i]]] <- parse_number(price)
}

blackberry <- tibble(
  item = "Blackberry",
  regular_price = prices$regular,
  silver_price = prices$silver,
  gold_price = prices$gold,
  iridium_price = prices$iridium
)

Now, we can combine all of the crop tibbles into one:

Code
# first chunks of crops 
draft_crops <- bind_rows(seasonal_crop_prices,
                         nonseasonal_crop_tbl,
                         tea_leaves, 
                         qi_fruit, 
                         cactus_fruit, 
                         grape, 
                         coffee_bean, 
                         wild_plum, 
                         blackberry, 
                         spice_berry, 
                         crystal_fruit) |>
  arrange(item)

Lastly, we can add in the category variable and the subcategory variable. to makes things easier, we decided the subcategory would be the crop’s season. Then, we write it to a csv in case the website changes or updates.

Code
# retrieve seasons
seasons <- result[[134]] %>%
  dplyr::select(Season = 1, Crops = 2) |>
  mutate(Crops = strsplit(Crops, " • ", fixed = TRUE)) |>
  unnest(Crops) |>
  mutate(Crops = str_replace_all(Crops, " ", "_"))

# join together seasons and crops
crop_prices <- draft_crops |>
  left_join(seasons, join_by(item == Crops))|>
   mutate(category = "crop",
          sub_category = str_c(Season, " Crop"))|>
  dplyr::select(-Season)

# write csv
#write.csv(crop_prices, "crop_prices.csv")

crop_prices |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item regular_price silver_price gold_price iridium_price profession category sub_category
Amaranth 150 187 225 300 NA crop Fall Crop
Amaranth 165 205 247 330 tiller crop Fall Crop
Ancient_Fruit 550 687 825 1100 NA crop Special Crop
Ancient_Fruit 605 755 907 1210 tiller crop Special Crop
Apple 100 125 150 200 NA crop NA
Apple 110 137 165 220 tiller crop NA
Apricot 50 62 75 100 NA crop NA
Apricot 55 68 82 110 tiller crop NA
Artichoke 160 200 240 320 NA crop Fall Crop
Artichoke 176 220 264 352 tiller crop Fall Crop
Banana 150 187 225 300 NA crop NA
Banana 165 205 247 330 tiller crop NA
Beet 100 125 150 200 NA crop Fall Crop
Beet 110 137 165 220 tiller crop Fall Crop
Blackberry 20 25 30 40 NA crop NA
Blue_Jazz 50 62 75 100 NA crop Spring Crop
Blue_Jazz 55 68 82 110 tiller crop Spring Crop
Blueberry 50 62 75 100 NA crop Summer Crop
Blueberry 55 68 82 110 tiller crop Summer Crop
Bok_Choy 80 100 120 160 NA crop Fall Crop
Bok_Choy 88 110 132 176 tiller crop Fall Crop
Broccoli 70 87 105 140 NA crop Fall Crop
Broccoli 77 95 115 154 tiller crop Fall Crop
Cactus_Fruit 75 93 112 150 NA crop Special Crop
Cactus_Fruit 82 102 123 165 NA crop Special Crop
Carrot 35 43 52 70 NA crop Spring Crop
Carrot 38 47 57 77 tiller crop Spring Crop
Cauliflower 175 218 262 350 NA crop Spring Crop
Cauliflower 192 239 288 385 tiller crop Spring Crop
Cherry 80 100 120 160 NA crop NA
Cherry 88 110 132 176 tiller crop NA
Corn 50 62 75 100 NA crop Summer Crop
Corn 50 62 75 100 NA crop Fall Crop
Corn 55 68 82 110 tiller crop Summer Crop
Corn 55 68 82 110 tiller crop Fall Crop
Cranberries 75 93 112 150 NA crop Fall Crop
Cranberries 82 102 123 165 tiller crop Fall Crop
Crystal_Fruit 150 187 225 300 NA crop NA
Eggplant 60 75 90 120 NA crop Fall Crop
Eggplant 66 82 99 132 tiller crop Fall Crop
Fairy_Rose 290 362 435 580 NA crop Fall Crop
Fairy_Rose 319 398 478 638 tiller crop Fall Crop
Fiddlehead_Fern 90 112 135 180 NA crop NA
Fiddlehead_Fern 99 123 148 198 tiller crop NA
Garlic 60 75 90 120 NA crop Spring Crop
Garlic 66 82 99 132 tiller crop Spring Crop
Grape 80 100 120 160 NA crop Fall Crop
Grape 88 110 132 176 NA crop Fall Crop
Green_Bean 40 50 60 80 NA crop Spring Crop
Green_Bean 44 55 66 88 tiller crop Spring Crop
Hops 25 31 37 50 NA crop Summer Crop
Hops 27 34 40 55 tiller crop Summer Crop
Hot_Pepper 40 50 60 80 NA crop Summer Crop
Hot_Pepper 44 55 66 88 tiller crop Summer Crop
Kale 110 137 165 220 NA crop Spring Crop
Kale 121 150 181 242 tiller crop Spring Crop
Mango 130 162 195 260 NA crop NA
Mango 143 178 214 286 tiller crop NA
Melon 250 312 375 500 NA crop Summer Crop
Melon 275 343 412 550 tiller crop Summer Crop
Orange 100 125 150 200 NA crop NA
Orange 110 137 165 220 tiller crop NA
Parsnip 35 43 52 70 NA crop Spring Crop
Parsnip 38 47 57 77 tiller crop Spring Crop
Peach 140 175 210 280 NA crop NA
Peach 154 192 231 308 tiller crop NA
Pineapple 300 375 450 600 NA crop Special Crop
Pineapple 330 412 495 660 tiller crop Special Crop
Pomegranate 140 175 210 280 NA crop NA
Pomegranate 154 192 231 308 tiller crop NA
Poppy 140 175 210 280 NA crop Summer Crop
Poppy 154 192 231 308 tiller crop Summer Crop
Potato 80 100 120 160 NA crop Spring Crop
Potato 88 110 132 176 tiller crop Spring Crop
Powdermelon 60 75 90 120 NA crop Winter Crop
Powdermelon 66 82 99 132 tiller crop Winter Crop
Pumpkin 320 400 480 640 NA crop Fall Crop
Pumpkin 352 440 528 704 tiller crop Fall Crop
Qi_Fruit 1 NA NA NA NA crop Special Crop
Qi_Fruit 1 NA NA NA NA crop Special Crop
Radish 90 112 135 180 NA crop Summer Crop
Radish 99 123 148 198 tiller crop Summer Crop
Red_Cabbage 260 325 390 520 NA crop Summer Crop
Red_Cabbage 286 357 429 572 tiller crop Summer Crop
Rhubarb 220 275 330 440 NA crop Spring Crop
Rhubarb 242 302 363 484 tiller crop Spring Crop
Spice_Berry 80 100 120 160 NA crop NA
Starfruit 750 937 1125 1500 NA crop Summer Crop
Starfruit 825 1030 1237 1650 tiller crop Summer Crop
Strawberry 120 150 180 240 NA crop Spring Crop
Strawberry 132 165 198 264 tiller crop Spring Crop
Summer_Spangle 90 112 135 180 NA crop Summer Crop
Summer_Spangle 99 123 148 198 tiller crop Summer Crop
Summer_Squash 45 56 67 90 NA crop Summer Crop
Summer_Squash 49 61 73 99 tiller crop Summer Crop
Sunflower 80 100 120 160 NA crop Summer Crop
Sunflower 80 100 120 160 NA crop Fall Crop
Sunflower 88 110 132 176 tiller crop Summer Crop
Sunflower 88 110 132 176 tiller crop Fall Crop
Taro_Root 100 125 150 200 NA crop Special Crop
Taro_Root 110 137 165 220 tiller crop Special Crop
Tea_Leaves 50 NA NA NA NA crop Special Crop
Tea_Leaves 55 NA NA NA NA crop Special Crop
Tomato 60 75 90 120 NA crop Summer Crop
Tomato 66 82 99 132 tiller crop Summer Crop
Tulip 30 37 45 60 NA crop Spring Crop
Tulip 33 40 49 66 tiller crop Spring Crop
Unmilled_Rice 30 37 45 60 NA crop Spring Crop
Unmilled_Rice 33 40 49 66 tiller crop Spring Crop
Wheat 25 31 37 50 NA crop Summer Crop
Wheat 25 31 37 50 NA crop Fall Crop
Wheat 27 34 40 55 tiller crop Summer Crop
Wheat 27 34 40 55 tiller crop Fall Crop
Wild_Plum 80 100 120 160 NA crop NA
Yam 160 200 240 320 NA crop Fall Crop
Yam 176 220 264 352 tiller crop Fall Crop

Fish

Fish was the second most difficult item to scrape from the wiki, since again not all of the pages are structured the same. However, we were able identify 4 different pages in which we could write functions to automate.

We start be getting a list of all the different fish in the game.

Code
# making sure that this irl is scrapable
fish <- bow("https://stardewvalleywiki.com/Fish", force = TRUE) 

# scraping table to get a list of all the fish 
result <- scrape(fish) |>
  html_nodes(css = "table") |>
  html_table(header = TRUE, fill = TRUE)

# the correct table for the list of fish, and only keeping the names of the fish column
fishes <- result[[224]][2] 

# however, it is formatted very poorly so we need to tidy it up 
fishes <- fishes |>
  mutate(Fish = strsplit(Fish, " • ", fixed = TRUE)) |>
  unnest(Fish) |>
  # splitting the string since " • " was used to separate all fish
  mutate(Fish = str_replace_all(Fish, " ", "_")) |> 
  distinct(Fish) |>
  # this is a fish that is in the data set twice but with different spacing 
  filter(Fish != "_Super_Cucumber") 

# tibble with the subcategories of the fish and the fish name for joining later
subcategory <- result[[224]] |> 
  dplyr::select(Location = 1, Fish = 2) |> 
  mutate(Fish = strsplit(Fish, " • ", fixed = TRUE)) |> 
  unnest(Fish) |>
  mutate(Fish = str_replace_all(Fish, " ", "_"))

Create our helper functions for fish:

Code
# function for getting the price at a given page and css selector
get_price <- function(page, css_selector) {
  page |>
  html_nodes(css_selector) |>
  html_text()
}

# function for creating a tibble of prices for a given fish this functions output a tibble of our fish and the 4 different prices of the fish dependent on quality

#fish_base_prices takes our fish name,and takes a profession if we specify true or false, as well as the "nthchild_num" value for where the price is being store on that website

fish_base_prices <- function(fish, fisher = FALSE, angler = FALSE, nthchild_num) {
  url <- str_c("https://stardewvalleywiki.com/", fish)
  page <- read_html(url)
  
  qualities <- c("regular", "silver", "gold", "iridium")
  prices <- list()
  
  for (i in seq_along(qualities)) {
    if (fisher) {
      selector <- str_c("tr:nth-child(", nthchild_num,") tr td:nth-child(2) tr:nth-child(", i, ") td+ td")
    } else if (angler) {
      selector <- str_c("tr:nth-child(", nthchild_num,") tr td:nth-child(3) tr:nth-child(", i, ") td+ td")
    } 
    else {
      selector <- str_c("tr:nth-child(", nthchild_num,") tr td:nth-child(1) tr:nth-child(", i, ") td+ td")
    }
    price <- get_price(page, selector)
    prices[[qualities[i]]] <- parse_number(price)
  }
  
  tibble(
    item = fish,
    regular_price = prices$regular,
    silver_price = prices$silver,
    gold_price = prices$gold,
    iridium_price = prices$iridium
  )
}

As well as the function for the fish with a different webpage format.

Code
# this functions output a tibble of our fish and the 2 different prices of the fish dependent on quality

# fish_base_prices takes our fish name, and takes a profession if we specify true or false, as well as the "nthchild_num" value for where the price is being store on that website

fish_base_prices2 <- function(fish, fisher = FALSE, angler = FALSE, nthchild_num) {
  url <- str_c("https://stardewvalleywiki.com/", fish)
  page <- read_html(url)
  
  qualities <- c("regular", "silver", "gold", "iridium")
  prices <- list()
  
  for (i in seq_along(qualities)) {
    if (fisher) {
      selector <- str_c("tr:nth-child(", nthchild_num,") tr td:nth-child(2) tr:nth-child(", i, ") td+ td")
    } else if (angler) {
      selector <- str_c("tr:nth-child(", nthchild_num,") tr td:nth-child(3) tr:nth-child(", i, ") td+ td")
    } 
    else {
      selector <- str_c("tr:nth-child(", nthchild_num,") tr td:nth-child(1) tr:nth-child(", i, ") td+ td")
    }
    price <- get_price(page, selector)
    prices[[qualities[i]]] <- parse_number(price)
  }
  
  tibble(
    item = fish,
    regular_price = prices$regular,
    silver_price = prices$silver,
  )
}

Now, we will load in our fishes lists so for the type of webpage format they have and then apply our function to the fishes to find their prices.

 [1] "Mutant_Carp"      "Radioactive_Carp" "Albacore"         "Anchovy"         
 [5] "Eel"              "Flounder"         "Halibut"          "Herring"         
 [9] "Octopus"          "Pufferfish"       "Red_Mullet"       "Red_Snapper"     
[13] "Sardine"          "Sea_Cucumber"     "Squid"            "Super_Cucumber"  
[17] "Tilapia"          "Tuna"             "Bream"            "Catfish"         
[21] "Chub"             "Dorado"           "Goby"             "Lingcod"         
[25] "Perch"            "Pike"             "Rainbow_Trout"    "Salmon"          
[29] "Shad"             "Smallmouth_Bass"  "Sunfish"          "Tiger_Trout"     
[33] "Walleye"          "Bullhead"         "Carp"             "Largemouth_Bass" 
[37] "Midnight_Carp"    "Sturgeon"         "Woodskip"         "Ghostfish"       
[41] "Ice_Pip"          "Stonefish"        "Sandfish"         "Slimejack"       
[45] "Void_Salmon"      "Blobfish"         "Midnight_Squid"   "Spook_Fish"      
[49] "Blue_Discus"      "Lionfish"         "Stingray"        
 [1] "Angler"             "Crimsonfish"        "Glacierfish"       
 [4] "Glacierfish_Jr."    "Legend"             "Legend_II"         
 [7] "Ms._Angler"         "Son_of_Crimsonfish" "Lava_Eel"          
[10] "Scorpion_Carp"     
[1] "Clam"   "Cockle" "Mussel" "Oyster"
[1] "Crab"       "Crayfish"   "Lobster"    "Periwinkle" "Shrimp"    
[6] "Snail"     
Code
# creating list of tbl's to store prices so that we can bind into one big tibble
fish_prices <- vector("list", length = 12)

# base prices without profession for tr:nth-child(14)
fish_prices[[1]] <- fishfor14 |>
  purrr::map_dfr(~ fish_base_prices(.x, nthchild_num = 14)) |>
  mutate(profession = as.character(NA))

# prices with Fisher profession
fish_prices[[2]] <- fishfor14 |>
  purrr::map_dfr(~ fish_base_prices(.x, fisher = TRUE, nthchild_num = 14)) |>
  mutate(profession = "fisher")

# prices with Angler profession
fish_prices[[3]] <- fishfor14 |>
  purrr::map_dfr(~ fish_base_prices(.x, angler = TRUE, nthchild_num = 14)) |>
  mutate(profession = "angler")

# base prices without profession for tr:nth-child(15)
fish_prices[[4]] <- fishfor15 |>
  purrr::map_dfr(~ fish_base_prices(.x, nthchild_num = 15)) |>
  mutate(profession = as.character(NA))

# prices with Fisher profession
fish_prices[[5]] <- fishfor15 |>
  purrr::map_dfr(~ fish_base_prices(.x, fisher = TRUE, nthchild_num = 15)) |>
  mutate(profession = "fisher")

# prices with Angler profession
fish_prices[[6]] <- fishfor15 |>
  purrr::map_dfr(~ fish_base_prices(.x, angler = TRUE, nthchild_num = 15)) |>
  mutate(profession = "angler")

# base prices without profession for tr:nth-child(10)
fish_prices[[7]] <- fishfor10 |>
  purrr::map_dfr(~ fish_base_prices(.x, nthchild_num = 10)) |>
  mutate(profession = as.character(NA))

# prices with Fisher profession
fish_prices[[8]] <- fishfor10 |>
  purrr::map_dfr(~ fish_base_prices(.x, fisher = TRUE, nthchild_num = 10)) |>
  mutate(profession = "fisher")

# prices with Angler profession
fish_prices[[9]] <- fishfor10 |>
  purrr::map_dfr(~ fish_base_prices(.x, angler = TRUE, nthchild_num = 10)) |>
  mutate(profession = "angler")

# base prices without profession for tr:nth-child(10) but only two qualities
fish_prices[[10]] <- fishleft |>
  purrr::map_dfr(~ fish_base_prices2(.x, nthchild_num = 10)) |>
  mutate(profession = as.character(NA))

# prices with Fisher profession
fish_prices[[11]] <- fishleft |>
  purrr::map_dfr(~ fish_base_prices2(.x, fisher = TRUE, nthchild_num = 10)) |>
  mutate(profession = "fisher")

# prices with Angler profession
fish_prices[[12]] <- fishleft |>
  purrr::map_dfr(~ fish_base_prices2(.x, angler = TRUE, nthchild_num = 10)) |>
  mutate(profession = "angler")

Finally we will take our fish prices and then create one big tibble.

Code
# first tbl in fish prices assigned to our final tibble 
tidy_fish_prices <- fish_prices[[1]] 

# for loop for iterating each tbl in our fish prices list to our final tibble
for (i in 2:12){
  tidy_fish_prices <- bind_rows(tidy_fish_prices, fish_prices[[i]])
}

# viewing and alphabetizing our tidy fish tbl also joining our subcategories and assigning category
tidy_fish_prices <- tidy_fish_prices |>
  left_join(subcategory, join_by(item == Fish)) |>
  mutate(category = "fish") |>
  rename(sub_category = Location) |>
  arrange(item)

# writing our tbl as a csv so that we can join with the other items 
#write.csv(tidy_fish_prices, "fish_prices.csv")

tidy_fish_prices |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item regular_price silver_price gold_price iridium_price profession sub_category category
Albacore 75 93 112 150 NA The Beach fish
Albacore 93 116 140 187 fisher The Beach fish
Albacore 112 139 168 225 angler The Beach fish
Anchovy 30 37 45 60 NA The Beach fish
Anchovy 37 46 56 75 fisher The Beach fish
Anchovy 45 55 67 90 angler The Beach fish
Angler 900 1125 1350 1800 NA Legendary fish
Angler 900 1125 1350 1800 NA River fish
Angler 1125 1406 1687 2250 fisher Legendary fish
Angler 1125 1406 1687 2250 fisher River fish
Angler 1350 1687 2025 2700 angler Legendary fish
Angler 1350 1687 2025 2700 angler River fish
Blobfish 500 625 750 1000 NA Night Market fish
Blobfish 625 781 937 1250 fisher Night Market fish
Blobfish 750 937 1125 1500 angler Night Market fish
Blue_Discus 120 150 180 240 NA Ginger Island fish
Blue_Discus 150 187 225 300 fisher Ginger Island fish
Blue_Discus 180 225 270 360 angler Ginger Island fish
Bream 45 56 67 90 NA River fish
Bream 56 70 83 112 fisher River fish
Bream 67 84 100 135 angler River fish
Bullhead 75 93 112 150 NA Mountain Lake fish
Bullhead 93 116 140 187 fisher Mountain Lake fish
Bullhead 112 139 168 225 angler Mountain Lake fish
Carp 30 37 45 60 NA Mountain Lake fish
Carp 30 37 45 60 NA Secret Woods fish
Carp 30 37 45 60 NA Sewers fish
Carp 30 37 45 60 NA Mutant Bug Lair fish
Carp 37 46 56 75 fisher Mountain Lake fish
Carp 37 46 56 75 fisher Secret Woods fish
Carp 37 46 56 75 fisher Sewers fish
Carp 37 46 56 75 fisher Mutant Bug Lair fish
Carp 45 55 67 90 angler Mountain Lake fish
Carp 45 55 67 90 angler Secret Woods fish
Carp 45 55 67 90 angler Sewers fish
Carp 45 55 67 90 angler Mutant Bug Lair fish
Catfish 200 250 300 400 NA River fish
Catfish 200 250 300 400 NA Secret Woods fish
Catfish 200 250 300 400 NA Witch's Swamp fish
Catfish 250 312 375 500 fisher River fish
Catfish 250 312 375 500 fisher Secret Woods fish
Catfish 250 312 375 500 fisher Witch's Swamp fish
Catfish 300 375 450 600 angler River fish
Catfish 300 375 450 600 angler Secret Woods fish
Catfish 300 375 450 600 angler Witch's Swamp fish
Chub 50 62 75 100 NA River fish
Chub 50 62 75 100 NA Mountain Lake fish
Chub 62 77 93 125 fisher River fish
Chub 62 77 93 125 fisher Mountain Lake fish
Chub 75 93 112 150 angler River fish
Chub 75 93 112 150 angler Mountain Lake fish
Clam 50 62 75 100 NA Crab Pot fish
Clam 62 77 93 125 fisher Crab Pot fish
Clam 75 93 112 150 angler Crab Pot fish
Cockle 50 62 75 100 NA Crab Pot fish
Cockle 62 77 93 125 fisher Crab Pot fish
Cockle 75 93 112 150 angler Crab Pot fish
Crab 100 125 NA NA NA Crab Pot fish
Crab 125 156 NA NA fisher Crab Pot fish
Crab 150 187 NA NA angler Crab Pot fish
Crayfish 75 93 NA NA NA Crab Pot fish
Crayfish 93 116 NA NA fisher Crab Pot fish
Crayfish 112 139 NA NA angler Crab Pot fish
Crimsonfish 1500 1875 2250 3000 NA Legendary fish
Crimsonfish 1500 1875 2250 3000 NA The Beach fish
Crimsonfish 1875 2343 2812 3750 fisher Legendary fish
Crimsonfish 1875 2343 2812 3750 fisher The Beach fish
Crimsonfish 2250 2812 3375 4500 angler Legendary fish
Crimsonfish 2250 2812 3375 4500 angler The Beach fish
Dorado 100 125 150 200 NA River fish
Dorado 125 156 187 250 fisher River fish
Dorado 150 187 225 300 angler River fish
Eel 85 106 127 170 NA The Beach fish
Eel 106 132 158 212 fisher The Beach fish
Eel 127 159 190 255 angler The Beach fish
Flounder 100 125 150 200 NA The Beach fish
Flounder 100 125 150 200 NA Ginger Island fish
Flounder 125 156 187 250 fisher The Beach fish
Flounder 125 156 187 250 fisher Ginger Island fish
Flounder 150 187 225 300 angler The Beach fish
Flounder 150 187 225 300 angler Ginger Island fish
Ghostfish 45 56 67 90 NA Mines fish
Ghostfish 56 70 83 112 fisher Mines fish
Ghostfish 67 84 100 135 angler Mines fish
Glacierfish 1000 1250 1500 2000 NA Legendary fish
Glacierfish 1000 1250 1500 2000 NA River fish
Glacierfish 1250 1562 1875 2500 fisher Legendary fish
Glacierfish 1250 1562 1875 2500 fisher River fish
Glacierfish 1500 1875 2250 3000 angler Legendary fish
Glacierfish 1500 1875 2250 3000 angler River fish
Glacierfish_Jr. 1000 1250 1500 2000 NA Legendary fish
Glacierfish_Jr. 1000 1250 1500 2000 NA River fish
Glacierfish_Jr. 1250 1562 1875 2500 fisher Legendary fish
Glacierfish_Jr. 1250 1562 1875 2500 fisher River fish
Glacierfish_Jr. 1500 1875 2250 3000 angler Legendary fish
Glacierfish_Jr. 1500 1875 2250 3000 angler River fish
Goby 150 187 225 300 NA River fish
Goby 187 233 281 375 fisher River fish
Goby 225 280 337 450 angler River fish
Halibut 80 100 120 160 NA The Beach fish
Halibut 100 125 150 200 fisher The Beach fish
Halibut 120 150 180 240 angler The Beach fish
Herring 30 37 45 60 NA The Beach fish
Herring 37 46 56 75 fisher The Beach fish
Herring 45 55 67 90 angler The Beach fish
Ice_Pip 500 625 750 1000 NA Mines fish
Ice_Pip 625 781 937 1250 fisher Mines fish
Ice_Pip 750 937 1125 1500 angler Mines fish
Largemouth_Bass 100 125 150 200 NA Mountain Lake fish
Largemouth_Bass 125 156 187 250 fisher Mountain Lake fish
Largemouth_Bass 150 187 225 300 angler Mountain Lake fish
Lava_Eel 700 875 1050 1400 NA Mines fish
Lava_Eel 700 875 1050 1400 NA Ginger Island fish
Lava_Eel 875 1093 1312 1750 fisher Mines fish
Lava_Eel 875 1093 1312 1750 fisher Ginger Island fish
Lava_Eel 1050 1312 1575 2100 angler Mines fish
Lava_Eel 1050 1312 1575 2100 angler Ginger Island fish
Legend 5000 6250 7500 10000 NA Legendary fish
Legend 5000 6250 7500 10000 NA Mountain Lake fish
Legend 6250 7812 9375 12500 fisher Legendary fish
Legend 6250 7812 9375 12500 fisher Mountain Lake fish
Legend 7500 9375 11250 15000 angler Legendary fish
Legend 7500 9375 11250 15000 angler Mountain Lake fish
Legend_II 5000 6250 7500 10000 NA Legendary fish
Legend_II 5000 6250 7500 10000 NA Mountain Lake fish
Legend_II 6250 7812 9375 12500 fisher Legendary fish
Legend_II 6250 7812 9375 12500 fisher Mountain Lake fish
Legend_II 7500 9375 11250 15000 angler Legendary fish
Legend_II 7500 9375 11250 15000 angler Mountain Lake fish
Lingcod 120 150 180 240 NA River fish
Lingcod 120 150 180 240 NA Mountain Lake fish
Lingcod 150 187 225 300 fisher River fish
Lingcod 150 187 225 300 fisher Mountain Lake fish
Lingcod 180 225 270 360 angler River fish
Lingcod 180 225 270 360 angler Mountain Lake fish
Lionfish 100 125 150 200 NA Ginger Island fish
Lionfish 125 156 187 250 fisher Ginger Island fish
Lionfish 150 187 225 300 angler Ginger Island fish
Lobster 120 150 NA NA NA Crab Pot fish
Lobster 150 187 NA NA fisher Crab Pot fish
Lobster 180 225 NA NA angler Crab Pot fish
Midnight_Carp 150 187 225 300 NA Mountain Lake fish
Midnight_Carp 150 187 225 300 NA Cindersap Forest Pond fish
Midnight_Carp 150 187 225 300 NA Ginger Island fish
Midnight_Carp 187 233 281 375 fisher Mountain Lake fish
Midnight_Carp 187 233 281 375 fisher Cindersap Forest Pond fish
Midnight_Carp 187 233 281 375 fisher Ginger Island fish
Midnight_Carp 225 280 337 450 angler Mountain Lake fish
Midnight_Carp 225 280 337 450 angler Cindersap Forest Pond fish
Midnight_Carp 225 280 337 450 angler Ginger Island fish
Midnight_Squid 100 125 150 200 NA Night Market fish
Midnight_Squid 125 156 187 250 fisher Night Market fish
Midnight_Squid 150 187 225 300 angler Night Market fish
Ms._Angler 900 1125 1350 1800 NA Legendary fish
Ms._Angler 900 1125 1350 1800 NA River fish
Ms._Angler 1125 1406 1687 2250 fisher Legendary fish
Ms._Angler 1125 1406 1687 2250 fisher River fish
Ms._Angler 1350 1687 2025 2700 angler Legendary fish
Ms._Angler 1350 1687 2025 2700 angler River fish
Mussel 30 37 45 60 NA Crab Pot fish
Mussel 37 46 56 75 fisher Crab Pot fish
Mussel 45 55 67 90 angler Crab Pot fish
Mutant_Carp 1000 1250 1500 2000 NA Legendary fish
Mutant_Carp 1000 1250 1500 2000 NA Sewers fish
Mutant_Carp 1250 1562 1875 2500 fisher Legendary fish
Mutant_Carp 1250 1562 1875 2500 fisher Sewers fish
Mutant_Carp 1500 1875 2250 3000 angler Legendary fish
Mutant_Carp 1500 1875 2250 3000 angler Sewers fish
Octopus 150 187 225 300 NA The Beach fish
Octopus 150 187 225 300 NA Night Market fish
Octopus 150 187 225 300 NA Ginger Island fish
Octopus 187 233 281 375 fisher The Beach fish
Octopus 187 233 281 375 fisher Night Market fish
Octopus 187 233 281 375 fisher Ginger Island fish
Octopus 225 280 337 450 angler The Beach fish
Octopus 225 280 337 450 angler Night Market fish
Octopus 225 280 337 450 angler Ginger Island fish
Oyster 40 50 60 80 NA Crab Pot fish
Oyster 50 62 75 100 fisher Crab Pot fish
Oyster 60 75 90 120 angler Crab Pot fish
Perch 55 68 82 110 NA River fish
Perch 55 68 82 110 NA Mountain Lake fish
Perch 55 68 82 110 NA Cindersap Forest Pond fish
Perch 68 85 102 137 fisher River fish
Perch 68 85 102 137 fisher Mountain Lake fish
Perch 68 85 102 137 fisher Cindersap Forest Pond fish
Perch 82 102 123 165 angler River fish
Perch 82 102 123 165 angler Mountain Lake fish
Perch 82 102 123 165 angler Cindersap Forest Pond fish
Periwinkle 20 25 NA NA NA Crab Pot fish
Periwinkle 25 31 NA NA fisher Crab Pot fish
Periwinkle 30 37 NA NA angler Crab Pot fish
Pike 100 125 150 200 NA River fish
Pike 100 125 150 200 NA Cindersap Forest Pond fish
Pike 125 156 187 250 fisher River fish
Pike 125 156 187 250 fisher Cindersap Forest Pond fish
Pike 150 187 225 300 angler River fish
Pike 150 187 225 300 angler Cindersap Forest Pond fish
Pufferfish 200 250 300 400 NA The Beach fish
Pufferfish 200 250 300 400 NA Ginger Island fish
Pufferfish 250 312 375 500 fisher The Beach fish
Pufferfish 250 312 375 500 fisher Ginger Island fish
Pufferfish 300 375 450 600 angler The Beach fish
Pufferfish 300 375 450 600 angler Ginger Island fish
Radioactive_Carp 1000 1250 1500 2000 NA Legendary fish
Radioactive_Carp 1000 1250 1500 2000 NA Sewers fish
Radioactive_Carp 1250 1562 1875 2500 fisher Legendary fish
Radioactive_Carp 1250 1562 1875 2500 fisher Sewers fish
Radioactive_Carp 1500 1875 2250 3000 angler Legendary fish
Radioactive_Carp 1500 1875 2250 3000 angler Sewers fish
Rainbow_Trout 65 81 97 130 NA River fish
Rainbow_Trout 65 81 97 130 NA Mountain Lake fish
Rainbow_Trout 81 101 121 162 fisher River fish
Rainbow_Trout 81 101 121 162 fisher Mountain Lake fish
Rainbow_Trout 97 121 145 195 angler River fish
Rainbow_Trout 97 121 145 195 angler Mountain Lake fish
Red_Mullet 75 93 112 150 NA The Beach fish
Red_Mullet 93 116 140 187 fisher The Beach fish
Red_Mullet 112 139 168 225 angler The Beach fish
Red_Snapper 50 62 75 100 NA The Beach fish
Red_Snapper 62 77 93 125 fisher The Beach fish
Red_Snapper 75 93 112 150 angler The Beach fish
Salmon 75 93 112 150 NA River fish
Salmon 93 116 140 187 fisher River fish
Salmon 112 139 168 225 angler River fish
Sandfish 75 93 112 150 NA Desert fish
Sandfish 93 116 140 187 fisher Desert fish
Sandfish 112 139 168 225 angler Desert fish
Sardine 40 50 60 80 NA The Beach fish
Sardine 50 62 75 100 fisher The Beach fish
Sardine 60 75 90 120 angler The Beach fish
Scorpion_Carp 150 187 225 300 NA Desert fish
Scorpion_Carp 187 233 281 375 fisher Desert fish
Scorpion_Carp 225 280 337 450 angler Desert fish
Sea_Cucumber 75 93 112 150 NA The Beach fish
Sea_Cucumber 75 93 112 150 NA Night Market fish
Sea_Cucumber 93 116 140 187 fisher The Beach fish
Sea_Cucumber 93 116 140 187 fisher Night Market fish
Sea_Cucumber 112 139 168 225 angler The Beach fish
Sea_Cucumber 112 139 168 225 angler Night Market fish
Shad 60 75 90 120 NA River fish
Shad 75 93 112 150 fisher River fish
Shad 90 112 135 180 angler River fish
Shrimp 60 75 NA NA NA Crab Pot fish
Shrimp 75 93 NA NA fisher Crab Pot fish
Shrimp 90 112 NA NA angler Crab Pot fish
Slimejack 100 125 150 200 NA Mutant Bug Lair fish
Slimejack 125 156 187 250 fisher Mutant Bug Lair fish
Slimejack 150 187 225 300 angler Mutant Bug Lair fish
Smallmouth_Bass 50 62 75 100 NA River fish
Smallmouth_Bass 50 62 75 100 NA Cindersap Forest Pond fish
Smallmouth_Bass 62 77 93 125 fisher River fish
Smallmouth_Bass 62 77 93 125 fisher Cindersap Forest Pond fish
Smallmouth_Bass 75 93 112 150 angler River fish
Smallmouth_Bass 75 93 112 150 angler Cindersap Forest Pond fish
Snail 65 81 NA NA NA Crab Pot fish
Snail 81 101 NA NA fisher Crab Pot fish
Snail 97 121 NA NA angler Crab Pot fish
Son_of_Crimsonfish 1500 1875 2250 3000 NA Legendary fish
Son_of_Crimsonfish 1500 1875 2250 3000 NA The Beach fish
Son_of_Crimsonfish 1875 2343 2812 3750 fisher Legendary fish
Son_of_Crimsonfish 1875 2343 2812 3750 fisher The Beach fish
Son_of_Crimsonfish 2250 2812 3375 4500 angler Legendary fish
Son_of_Crimsonfish 2250 2812 3375 4500 angler The Beach fish
Spook_Fish 220 275 330 440 NA Night Market fish
Spook_Fish 275 343 412 550 fisher Night Market fish
Spook_Fish 330 412 495 660 angler Night Market fish
Squid 80 100 120 160 NA The Beach fish
Squid 100 125 150 200 fisher The Beach fish
Squid 120 150 180 240 angler The Beach fish
Stingray 180 225 270 360 NA Ginger Island fish
Stingray 225 281 337 450 fisher Ginger Island fish
Stingray 270 337 405 540 angler Ginger Island fish
Stonefish 300 375 450 600 NA Mines fish
Stonefish 375 468 562 750 fisher Mines fish
Stonefish 450 562 675 900 angler Mines fish
Sturgeon 200 250 300 400 NA Mountain Lake fish
Sturgeon 250 312 375 500 fisher Mountain Lake fish
Sturgeon 300 375 450 600 angler Mountain Lake fish
Sunfish 30 37 45 60 NA River fish
Sunfish 37 46 56 75 fisher River fish
Sunfish 45 55 67 90 angler River fish
Super_Cucumber 250 312 375 500 NA The Beach fish
Super_Cucumber 250 312 375 500 NA Night Market fish
Super_Cucumber 312 390 468 625 fisher The Beach fish
Super_Cucumber 312 390 468 625 fisher Night Market fish
Super_Cucumber 375 468 562 750 angler The Beach fish
Super_Cucumber 375 468 562 750 angler Night Market fish
Tiger_Trout 150 187 225 300 NA River fish
Tiger_Trout 187 233 281 375 fisher River fish
Tiger_Trout 225 280 337 450 angler River fish
Tilapia 75 93 112 150 NA The Beach fish
Tilapia 75 93 112 150 NA Ginger Island fish
Tilapia 93 116 140 187 fisher The Beach fish
Tilapia 93 116 140 187 fisher Ginger Island fish
Tilapia 112 139 168 225 angler The Beach fish
Tilapia 112 139 168 225 angler Ginger Island fish
Tuna 100 125 150 200 NA The Beach fish
Tuna 100 125 150 200 NA Ginger Island fish
Tuna 125 156 187 250 fisher The Beach fish
Tuna 125 156 187 250 fisher Ginger Island fish
Tuna 150 187 225 300 angler The Beach fish
Tuna 150 187 225 300 angler Ginger Island fish
Void_Salmon 150 187 225 300 NA Witch's Swamp fish
Void_Salmon 187 233 281 375 fisher Witch's Swamp fish
Void_Salmon 225 280 337 450 angler Witch's Swamp fish
Walleye 105 131 157 210 NA River fish
Walleye 105 131 157 210 NA Mountain Lake fish
Walleye 105 131 157 210 NA Cindersap Forest Pond fish
Walleye 131 163 196 262 fisher River fish
Walleye 131 163 196 262 fisher Mountain Lake fish
Walleye 131 163 196 262 fisher Cindersap Forest Pond fish
Walleye 157 196 235 315 angler River fish
Walleye 157 196 235 315 angler Mountain Lake fish
Walleye 157 196 235 315 angler Cindersap Forest Pond fish
Woodskip 75 93 112 150 NA Secret Woods fish
Woodskip 93 116 140 187 fisher Secret Woods fish
Woodskip 112 139 168 225 angler Secret Woods fish

Animal Products

Animal products was one of the easier items to scrape since we were able to scrape the data from a table.

Code
#first be polite and check that we can scrape it 
robotstxt::paths_allowed("https://stardewvalleywiki.com/Animal_Products_Profitability")

 stardewvalleywiki.com                      
[1] TRUE
Code
session <- bow("https://stardewvalleywiki.com/Animal_Products_Profitability", force = TRUE)

#take the second table, because that is the one we are interested in
result_animals <- scrape(session) |>
  html_nodes(css = "table") |> 
  html_table(header = TRUE, fill = TRUE)

sd_animal_prices <- result_animals[[2]]

After scraping, all all we have to do is clean up our tibble since it isn’t in the format we want it to be to join with the rest of our items.

Code
#clean up the sd_animal_prices tibble
tidy_sd_animal_price <- sd_animal_prices |>
  clean_names()|>
  dplyr::select(item, 
         profession, 
         quality, 
         sell_price) |> #select only the columns we want
  group_by(item, profession)|>
  pivot_wider(names_from = quality, 
              values_from = sell_price, 
              names_glue = "{quality}_price",
              values_fn = mean)|>
  clean_names()|>
  mutate(category = "animal product",
         profession = ifelse(profession == "—", NA, profession))

#write the final version to a csv
#write.csv(tidy_sd_animal_price, "animal_product_prices.csv")

tidy_sd_animal_price |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item profession regular_price silver_price gold_price iridium_price category
Egg NA 50 62 75 100 animal product
Egg Rancher 60 75 90 120 animal product
Egg Artisan 50 62 75 100 animal product
Large Egg NA 95 118 142 190 animal product
Large Egg Rancher 114 142 171 228 animal product
Large Egg Artisan 95 118 142 190 animal product
Void Egg NA 65 81 97 130 animal product
Void Egg Rancher 78 97 117 156 animal product
Void Egg Artisan 65 81 97 130 animal product
Duck Egg NA 95 118 142 190 animal product
Duck Egg Rancher 114 142 171 228 animal product
Duck Egg Artisan 95 118 142 190 animal product
Wool NA 340 425 510 680 animal product
Wool Rancher 408 510 612 816 animal product
Wool Artisan 340 425 510 680 animal product
Dinosaur Egg NA 350 437 525 700 animal product
Dinosaur Egg Rancher 350 437 525 700 animal product
Dinosaur Egg Artisan 350 437 525 700 animal product
Dinosaur Egg Treasure Appraisal Guide and Artisan 1050 1311 1575 2100 animal product
Golden Egg NA 500 625 750 1000 animal product
Golden Egg Rancher 600 750 900 1200 animal product
Golden Egg Artisan 500 625 750 1000 animal product
Ostrich Egg NA 600 750 900 1200 animal product
Ostrich Egg Rancher 720 900 1080 1440 animal product
Ostrich Egg Artisan 600 750 900 1200 animal product
Milk NA 125 156 187 250 animal product
Milk Rancher 150 187 225 300 animal product
Milk Artisan 125 156 187 250 animal product
Large Milk NA 190 237 285 380 animal product
Large Milk Rancher 228 285 342 456 animal product
Large Milk Artisan 190 237 285 380 animal product
Goat Milk NA 225 281 337 450 animal product
Goat Milk Rancher 270 337 405 540 animal product
Goat Milk Artisan 225 281 337 450 animal product
Large Goat Milk NA 345 431 517 690 animal product
Large Goat Milk Rancher 414 517 621 828 animal product
Large Goat Milk Artisan 345 431 517 690 animal product
Truffle NA 625 781 937 1250 animal product
Truffle Rancher 625 781 937 1250 animal product
Truffle Artisan 625 781 937 1250 animal product

Minerals

Minerals was one of the easier items to scrape since we were able to scrape the data from a table. However assigning the category and subcategories is what made the process a little more tedious.

Code
# first be polite and check that we can scrape it 
robotstxt::paths_allowed("https://stardewvalleywiki.com/Minerals")

 stardewvalleywiki.com                      
[1] TRUE
Code
session <- bow("https://stardewvalleywiki.com/Minerals", force = TRUE)

result_minerals <- scrape(session) |>
  html_nodes(css = "table") |> 
  html_table(header = TRUE, fill = TRUE)
# interested in tables 1-4

Again, after collecting our data, all we have to do is clean it up to join with our other categories.

Code
# this function takes a scraped minerals table and preps it for joining with other datasets
tidy_minerals <- function(data, sub_cat){
  data|>
  clean_names()|>
  mutate(item = name,
         category = "mineral",
         sub_category = sub_cat)|>
  rename(regular_sell_price = sell_price)|>
  pivot_longer(
    cols = c(gemologist_sell_price,
             regular_sell_price),
    names_to = "profession",
    values_to = "sell_price"
  )|>
  dplyr::select(item, 
         profession, 
         sell_price,
         category,
         sub_category)|>
  mutate(sell_price = as.numeric(str_extract(sell_price, '(?<=data-sort-value=")\\d+')),
         profession = ifelse(profession == "gemologist_sell_price",
                             "gemologist", NA))
  
 
}

# use function for the 1-3 tables using a for loop
minerals_tbl <- vector("list", length = 4)
mineral_sub_cat <- c("foraged mineral",
                     "gem",
                     "geode mineral",
                     "geode")
for (i in 1:3){
  minerals_tbl[[i]] <- tidy_minerals(result_minerals[[i]], mineral_sub_cat[i])
  
}

# clean up the variable names so that it is ready for the row bind.
# make sure the category is all mineral, and the sub_category is correct
minerals_tbl[[4]]<- result_minerals[[4]]|>
  clean_names()|>
  mutate(item = name,
         category = "mineral",
         sub_category = "geode",
         sell_price = as.numeric(str_extract(sell_price, '(?<=data-sort-value=")\\d+')),
         profession = NA)|>
  dplyr::select(item, sell_price, category, sub_category, profession)

tidy_sd_minerals_price <- bind_rows(minerals_tbl)

Now writing minerals to a csv just in case the website changes or updates.

Code
#write.csv(tidy_sd_minerals_price, "minerals_prices.csv")

tidy_sd_minerals_price |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item profession sell_price category sub_category
Quartz gemologist 32 mineral foraged mineral
Quartz NA 25 mineral foraged mineral
Earth Crystal gemologist 65 mineral foraged mineral
Earth Crystal NA 50 mineral foraged mineral
Frozen Tear gemologist 97 mineral foraged mineral
Frozen Tear NA 75 mineral foraged mineral
Fire Quartz gemologist 130 mineral foraged mineral
Fire Quartz NA 100 mineral foraged mineral
Emerald gemologist 325 mineral gem
Emerald NA 250 mineral gem
Aquamarine gemologist 234 mineral gem
Aquamarine NA 180 mineral gem
Ruby gemologist 325 mineral gem
Ruby NA 250 mineral gem
Amethyst gemologist 130 mineral gem
Amethyst NA 100 mineral gem
Topaz gemologist 104 mineral gem
Topaz NA 80 mineral gem
Jade gemologist 260 mineral gem
Jade NA 200 mineral gem
Diamond gemologist 974 mineral gem
Diamond NA 750 mineral gem
Prismatic Shard gemologist 2600 mineral gem
Prismatic Shard NA 2000 mineral gem
Tigerseye gemologist 357 mineral geode mineral
Tigerseye NA 275 mineral geode mineral
Opal gemologist 195 mineral geode mineral
Opal NA 150 mineral geode mineral
Fire Opal gemologist 455 mineral geode mineral
Fire Opal NA 350 mineral geode mineral
Alamite gemologist 195 mineral geode mineral
Alamite NA 150 mineral geode mineral
Bixite gemologist 390 mineral geode mineral
Bixite NA 300 mineral geode mineral
Baryte gemologist 65 mineral geode mineral
Baryte NA 50 mineral geode mineral
Aerinite gemologist 162 mineral geode mineral
Aerinite NA 125 mineral geode mineral
Calcite gemologist 97 mineral geode mineral
Calcite NA 75 mineral geode mineral
Dolomite gemologist 390 mineral geode mineral
Dolomite NA 300 mineral geode mineral
Esperite gemologist 130 mineral geode mineral
Esperite NA 100 mineral geode mineral
Fluorapatite gemologist 260 mineral geode mineral
Fluorapatite NA 200 mineral geode mineral
Geminite gemologist 195 mineral geode mineral
Geminite NA 150 mineral geode mineral
Helvite gemologist 585 mineral geode mineral
Helvite NA 450 mineral geode mineral
Jamborite gemologist 195 mineral geode mineral
Jamborite NA 150 mineral geode mineral
Jagoite gemologist 149 mineral geode mineral
Jagoite NA 115 mineral geode mineral
Kyanite gemologist 325 mineral geode mineral
Kyanite NA 250 mineral geode mineral
Lunarite gemologist 260 mineral geode mineral
Lunarite NA 200 mineral geode mineral
Malachite gemologist 130 mineral geode mineral
Malachite NA 100 mineral geode mineral
Neptunite gemologist 520 mineral geode mineral
Neptunite NA 400 mineral geode mineral
Lemon Stone gemologist 260 mineral geode mineral
Lemon Stone NA 200 mineral geode mineral
Nekoite gemologist 104 mineral geode mineral
Nekoite NA 80 mineral geode mineral
Orpiment gemologist 104 mineral geode mineral
Orpiment NA 80 mineral geode mineral
Petrified Slime gemologist 156 mineral geode mineral
Petrified Slime NA 120 mineral geode mineral
Thunder Egg gemologist 130 mineral geode mineral
Thunder Egg NA 100 mineral geode mineral
Pyrite gemologist 156 mineral geode mineral
Pyrite NA 120 mineral geode mineral
Ocean Stone gemologist 286 mineral geode mineral
Ocean Stone NA 220 mineral geode mineral
Ghost Crystal gemologist 260 mineral geode mineral
Ghost Crystal NA 200 mineral geode mineral
Jasper gemologist 195 mineral geode mineral
Jasper NA 150 mineral geode mineral
Celestine gemologist 162 mineral geode mineral
Celestine NA 125 mineral geode mineral
Marble gemologist 143 mineral geode mineral
Marble NA 110 mineral geode mineral
Sandstone gemologist 78 mineral geode mineral
Sandstone NA 60 mineral geode mineral
Granite gemologist 97 mineral geode mineral
Granite NA 75 mineral geode mineral
Basalt gemologist 227 mineral geode mineral
Basalt NA 175 mineral geode mineral
Limestone gemologist 19 mineral geode mineral
Limestone NA 15 mineral geode mineral
Soapstone gemologist 156 mineral geode mineral
Soapstone NA 120 mineral geode mineral
Hematite gemologist 195 mineral geode mineral
Hematite NA 150 mineral geode mineral
Mudstone gemologist 32 mineral geode mineral
Mudstone NA 25 mineral geode mineral
Obsidian gemologist 260 mineral geode mineral
Obsidian NA 200 mineral geode mineral
Slate gemologist 110 mineral geode mineral
Slate NA 85 mineral geode mineral
Fairy Stone gemologist 325 mineral geode mineral
Fairy Stone NA 250 mineral geode mineral
Star Shards gemologist 650 mineral geode mineral
Star Shards NA 500 mineral geode mineral
Geode NA 50 mineral geode
Frozen Geode NA 100 mineral geode
Magma Geode NA 150 mineral geode
Omni Geode NA 0 mineral geode

Combined Dataset

We then merge together all of the data sets for each of the 4 categories: crops, fish, animal products, and minerals.

Code
# binding rows for all of different categories 
stardew_items <- bind_rows(crop_prices, 
                           tidy_sd_animal_price, 
                           tidy_sd_minerals_price,
                           tidy_fish_prices)

#write.csv(stardew_items, "stardew_items.csv")

stardew_items |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item regular_price silver_price gold_price iridium_price profession category sub_category sell_price
Amaranth 150 187 225 300 NA crop Fall Crop NA
Amaranth 165 205 247 330 tiller crop Fall Crop NA
Ancient_Fruit 550 687 825 1100 NA crop Special Crop NA
Ancient_Fruit 605 755 907 1210 tiller crop Special Crop NA
Apple 100 125 150 200 NA crop NA NA
Apple 110 137 165 220 tiller crop NA NA
Apricot 50 62 75 100 NA crop NA NA
Apricot 55 68 82 110 tiller crop NA NA
Artichoke 160 200 240 320 NA crop Fall Crop NA
Artichoke 176 220 264 352 tiller crop Fall Crop NA
Banana 150 187 225 300 NA crop NA NA
Banana 165 205 247 330 tiller crop NA NA
Beet 100 125 150 200 NA crop Fall Crop NA
Beet 110 137 165 220 tiller crop Fall Crop NA
Blackberry 20 25 30 40 NA crop NA NA
Blue_Jazz 50 62 75 100 NA crop Spring Crop NA
Blue_Jazz 55 68 82 110 tiller crop Spring Crop NA
Blueberry 50 62 75 100 NA crop Summer Crop NA
Blueberry 55 68 82 110 tiller crop Summer Crop NA
Bok_Choy 80 100 120 160 NA crop Fall Crop NA
Bok_Choy 88 110 132 176 tiller crop Fall Crop NA
Broccoli 70 87 105 140 NA crop Fall Crop NA
Broccoli 77 95 115 154 tiller crop Fall Crop NA
Cactus_Fruit 75 93 112 150 NA crop Special Crop NA
Cactus_Fruit 82 102 123 165 NA crop Special Crop NA
Carrot 35 43 52 70 NA crop Spring Crop NA
Carrot 38 47 57 77 tiller crop Spring Crop NA
Cauliflower 175 218 262 350 NA crop Spring Crop NA
Cauliflower 192 239 288 385 tiller crop Spring Crop NA
Cherry 80 100 120 160 NA crop NA NA
Cherry 88 110 132 176 tiller crop NA NA
Corn 50 62 75 100 NA crop Summer Crop NA
Corn 50 62 75 100 NA crop Fall Crop NA
Corn 55 68 82 110 tiller crop Summer Crop NA
Corn 55 68 82 110 tiller crop Fall Crop NA
Cranberries 75 93 112 150 NA crop Fall Crop NA
Cranberries 82 102 123 165 tiller crop Fall Crop NA
Crystal_Fruit 150 187 225 300 NA crop NA NA
Eggplant 60 75 90 120 NA crop Fall Crop NA
Eggplant 66 82 99 132 tiller crop Fall Crop NA
Fairy_Rose 290 362 435 580 NA crop Fall Crop NA
Fairy_Rose 319 398 478 638 tiller crop Fall Crop NA
Fiddlehead_Fern 90 112 135 180 NA crop NA NA
Fiddlehead_Fern 99 123 148 198 tiller crop NA NA
Garlic 60 75 90 120 NA crop Spring Crop NA
Garlic 66 82 99 132 tiller crop Spring Crop NA
Grape 80 100 120 160 NA crop Fall Crop NA
Grape 88 110 132 176 NA crop Fall Crop NA
Green_Bean 40 50 60 80 NA crop Spring Crop NA
Green_Bean 44 55 66 88 tiller crop Spring Crop NA
Hops 25 31 37 50 NA crop Summer Crop NA
Hops 27 34 40 55 tiller crop Summer Crop NA
Hot_Pepper 40 50 60 80 NA crop Summer Crop NA
Hot_Pepper 44 55 66 88 tiller crop Summer Crop NA
Kale 110 137 165 220 NA crop Spring Crop NA
Kale 121 150 181 242 tiller crop Spring Crop NA
Mango 130 162 195 260 NA crop NA NA
Mango 143 178 214 286 tiller crop NA NA
Melon 250 312 375 500 NA crop Summer Crop NA
Melon 275 343 412 550 tiller crop Summer Crop NA
Orange 100 125 150 200 NA crop NA NA
Orange 110 137 165 220 tiller crop NA NA
Parsnip 35 43 52 70 NA crop Spring Crop NA
Parsnip 38 47 57 77 tiller crop Spring Crop NA
Peach 140 175 210 280 NA crop NA NA
Peach 154 192 231 308 tiller crop NA NA
Pineapple 300 375 450 600 NA crop Special Crop NA
Pineapple 330 412 495 660 tiller crop Special Crop NA
Pomegranate 140 175 210 280 NA crop NA NA
Pomegranate 154 192 231 308 tiller crop NA NA
Poppy 140 175 210 280 NA crop Summer Crop NA
Poppy 154 192 231 308 tiller crop Summer Crop NA
Potato 80 100 120 160 NA crop Spring Crop NA
Potato 88 110 132 176 tiller crop Spring Crop NA
Powdermelon 60 75 90 120 NA crop Winter Crop NA
Powdermelon 66 82 99 132 tiller crop Winter Crop NA
Pumpkin 320 400 480 640 NA crop Fall Crop NA
Pumpkin 352 440 528 704 tiller crop Fall Crop NA
Qi_Fruit 1 NA NA NA NA crop Special Crop NA
Qi_Fruit 1 NA NA NA NA crop Special Crop NA
Radish 90 112 135 180 NA crop Summer Crop NA
Radish 99 123 148 198 tiller crop Summer Crop NA
Red_Cabbage 260 325 390 520 NA crop Summer Crop NA
Red_Cabbage 286 357 429 572 tiller crop Summer Crop NA
Rhubarb 220 275 330 440 NA crop Spring Crop NA
Rhubarb 242 302 363 484 tiller crop Spring Crop NA
Spice_Berry 80 100 120 160 NA crop NA NA
Starfruit 750 937 1125 1500 NA crop Summer Crop NA
Starfruit 825 1030 1237 1650 tiller crop Summer Crop NA
Strawberry 120 150 180 240 NA crop Spring Crop NA
Strawberry 132 165 198 264 tiller crop Spring Crop NA
Summer_Spangle 90 112 135 180 NA crop Summer Crop NA
Summer_Spangle 99 123 148 198 tiller crop Summer Crop NA
Summer_Squash 45 56 67 90 NA crop Summer Crop NA
Summer_Squash 49 61 73 99 tiller crop Summer Crop NA
Sunflower 80 100 120 160 NA crop Summer Crop NA
Sunflower 80 100 120 160 NA crop Fall Crop NA
Sunflower 88 110 132 176 tiller crop Summer Crop NA
Sunflower 88 110 132 176 tiller crop Fall Crop NA
Taro_Root 100 125 150 200 NA crop Special Crop NA
Taro_Root 110 137 165 220 tiller crop Special Crop NA
Tea_Leaves 50 NA NA NA NA crop Special Crop NA
Tea_Leaves 55 NA NA NA NA crop Special Crop NA
Tomato 60 75 90 120 NA crop Summer Crop NA
Tomato 66 82 99 132 tiller crop Summer Crop NA
Tulip 30 37 45 60 NA crop Spring Crop NA
Tulip 33 40 49 66 tiller crop Spring Crop NA
Unmilled_Rice 30 37 45 60 NA crop Spring Crop NA
Unmilled_Rice 33 40 49 66 tiller crop Spring Crop NA
Wheat 25 31 37 50 NA crop Summer Crop NA
Wheat 25 31 37 50 NA crop Fall Crop NA
Wheat 27 34 40 55 tiller crop Summer Crop NA
Wheat 27 34 40 55 tiller crop Fall Crop NA
Wild_Plum 80 100 120 160 NA crop NA NA
Yam 160 200 240 320 NA crop Fall Crop NA
Yam 176 220 264 352 tiller crop Fall Crop NA
Egg 50 62 75 100 NA animal product NA NA
Egg 60 75 90 120 Rancher animal product NA NA
Egg 50 62 75 100 Artisan animal product NA NA
Large Egg 95 118 142 190 NA animal product NA NA
Large Egg 114 142 171 228 Rancher animal product NA NA
Large Egg 95 118 142 190 Artisan animal product NA NA
Void Egg 65 81 97 130 NA animal product NA NA
Void Egg 78 97 117 156 Rancher animal product NA NA
Void Egg 65 81 97 130 Artisan animal product NA NA
Duck Egg 95 118 142 190 NA animal product NA NA
Duck Egg 114 142 171 228 Rancher animal product NA NA
Duck Egg 95 118 142 190 Artisan animal product NA NA
Wool 340 425 510 680 NA animal product NA NA
Wool 408 510 612 816 Rancher animal product NA NA
Wool 340 425 510 680 Artisan animal product NA NA
Dinosaur Egg 350 437 525 700 NA animal product NA NA
Dinosaur Egg 350 437 525 700 Rancher animal product NA NA
Dinosaur Egg 350 437 525 700 Artisan animal product NA NA
Dinosaur Egg 1050 1311 1575 2100 Treasure Appraisal Guide and Artisan animal product NA NA
Golden Egg 500 625 750 1000 NA animal product NA NA
Golden Egg 600 750 900 1200 Rancher animal product NA NA
Golden Egg 500 625 750 1000 Artisan animal product NA NA
Ostrich Egg 600 750 900 1200 NA animal product NA NA
Ostrich Egg 720 900 1080 1440 Rancher animal product NA NA
Ostrich Egg 600 750 900 1200 Artisan animal product NA NA
Milk 125 156 187 250 NA animal product NA NA
Milk 150 187 225 300 Rancher animal product NA NA
Milk 125 156 187 250 Artisan animal product NA NA
Large Milk 190 237 285 380 NA animal product NA NA
Large Milk 228 285 342 456 Rancher animal product NA NA
Large Milk 190 237 285 380 Artisan animal product NA NA
Goat Milk 225 281 337 450 NA animal product NA NA
Goat Milk 270 337 405 540 Rancher animal product NA NA
Goat Milk 225 281 337 450 Artisan animal product NA NA
Large Goat Milk 345 431 517 690 NA animal product NA NA
Large Goat Milk 414 517 621 828 Rancher animal product NA NA
Large Goat Milk 345 431 517 690 Artisan animal product NA NA
Truffle 625 781 937 1250 NA animal product NA NA
Truffle 625 781 937 1250 Rancher animal product NA NA
Truffle 625 781 937 1250 Artisan animal product NA NA
Quartz NA NA NA NA gemologist mineral foraged mineral 32
Quartz NA NA NA NA NA mineral foraged mineral 25
Earth Crystal NA NA NA NA gemologist mineral foraged mineral 65
Earth Crystal NA NA NA NA NA mineral foraged mineral 50
Frozen Tear NA NA NA NA gemologist mineral foraged mineral 97
Frozen Tear NA NA NA NA NA mineral foraged mineral 75
Fire Quartz NA NA NA NA gemologist mineral foraged mineral 130
Fire Quartz NA NA NA NA NA mineral foraged mineral 100
Emerald NA NA NA NA gemologist mineral gem 325
Emerald NA NA NA NA NA mineral gem 250
Aquamarine NA NA NA NA gemologist mineral gem 234
Aquamarine NA NA NA NA NA mineral gem 180
Ruby NA NA NA NA gemologist mineral gem 325
Ruby NA NA NA NA NA mineral gem 250
Amethyst NA NA NA NA gemologist mineral gem 130
Amethyst NA NA NA NA NA mineral gem 100
Topaz NA NA NA NA gemologist mineral gem 104
Topaz NA NA NA NA NA mineral gem 80
Jade NA NA NA NA gemologist mineral gem 260
Jade NA NA NA NA NA mineral gem 200
Diamond NA NA NA NA gemologist mineral gem 974
Diamond NA NA NA NA NA mineral gem 750
Prismatic Shard NA NA NA NA gemologist mineral gem 2600
Prismatic Shard NA NA NA NA NA mineral gem 2000
Tigerseye NA NA NA NA gemologist mineral geode mineral 357
Tigerseye NA NA NA NA NA mineral geode mineral 275
Opal NA NA NA NA gemologist mineral geode mineral 195
Opal NA NA NA NA NA mineral geode mineral 150
Fire Opal NA NA NA NA gemologist mineral geode mineral 455
Fire Opal NA NA NA NA NA mineral geode mineral 350
Alamite NA NA NA NA gemologist mineral geode mineral 195
Alamite NA NA NA NA NA mineral geode mineral 150
Bixite NA NA NA NA gemologist mineral geode mineral 390
Bixite NA NA NA NA NA mineral geode mineral 300
Baryte NA NA NA NA gemologist mineral geode mineral 65
Baryte NA NA NA NA NA mineral geode mineral 50
Aerinite NA NA NA NA gemologist mineral geode mineral 162
Aerinite NA NA NA NA NA mineral geode mineral 125
Calcite NA NA NA NA gemologist mineral geode mineral 97
Calcite NA NA NA NA NA mineral geode mineral 75
Dolomite NA NA NA NA gemologist mineral geode mineral 390
Dolomite NA NA NA NA NA mineral geode mineral 300
Esperite NA NA NA NA gemologist mineral geode mineral 130
Esperite NA NA NA NA NA mineral geode mineral 100
Fluorapatite NA NA NA NA gemologist mineral geode mineral 260
Fluorapatite NA NA NA NA NA mineral geode mineral 200
Geminite NA NA NA NA gemologist mineral geode mineral 195
Geminite NA NA NA NA NA mineral geode mineral 150
Helvite NA NA NA NA gemologist mineral geode mineral 585
Helvite NA NA NA NA NA mineral geode mineral 450
Jamborite NA NA NA NA gemologist mineral geode mineral 195
Jamborite NA NA NA NA NA mineral geode mineral 150
Jagoite NA NA NA NA gemologist mineral geode mineral 149
Jagoite NA NA NA NA NA mineral geode mineral 115
Kyanite NA NA NA NA gemologist mineral geode mineral 325
Kyanite NA NA NA NA NA mineral geode mineral 250
Lunarite NA NA NA NA gemologist mineral geode mineral 260
Lunarite NA NA NA NA NA mineral geode mineral 200
Malachite NA NA NA NA gemologist mineral geode mineral 130
Malachite NA NA NA NA NA mineral geode mineral 100
Neptunite NA NA NA NA gemologist mineral geode mineral 520
Neptunite NA NA NA NA NA mineral geode mineral 400
Lemon Stone NA NA NA NA gemologist mineral geode mineral 260
Lemon Stone NA NA NA NA NA mineral geode mineral 200
Nekoite NA NA NA NA gemologist mineral geode mineral 104
Nekoite NA NA NA NA NA mineral geode mineral 80
Orpiment NA NA NA NA gemologist mineral geode mineral 104
Orpiment NA NA NA NA NA mineral geode mineral 80
Petrified Slime NA NA NA NA gemologist mineral geode mineral 156
Petrified Slime NA NA NA NA NA mineral geode mineral 120
Thunder Egg NA NA NA NA gemologist mineral geode mineral 130
Thunder Egg NA NA NA NA NA mineral geode mineral 100
Pyrite NA NA NA NA gemologist mineral geode mineral 156
Pyrite NA NA NA NA NA mineral geode mineral 120
Ocean Stone NA NA NA NA gemologist mineral geode mineral 286
Ocean Stone NA NA NA NA NA mineral geode mineral 220
Ghost Crystal NA NA NA NA gemologist mineral geode mineral 260
Ghost Crystal NA NA NA NA NA mineral geode mineral 200
Jasper NA NA NA NA gemologist mineral geode mineral 195
Jasper NA NA NA NA NA mineral geode mineral 150
Celestine NA NA NA NA gemologist mineral geode mineral 162
Celestine NA NA NA NA NA mineral geode mineral 125
Marble NA NA NA NA gemologist mineral geode mineral 143
Marble NA NA NA NA NA mineral geode mineral 110
Sandstone NA NA NA NA gemologist mineral geode mineral 78
Sandstone NA NA NA NA NA mineral geode mineral 60
Granite NA NA NA NA gemologist mineral geode mineral 97
Granite NA NA NA NA NA mineral geode mineral 75
Basalt NA NA NA NA gemologist mineral geode mineral 227
Basalt NA NA NA NA NA mineral geode mineral 175
Limestone NA NA NA NA gemologist mineral geode mineral 19
Limestone NA NA NA NA NA mineral geode mineral 15
Soapstone NA NA NA NA gemologist mineral geode mineral 156
Soapstone NA NA NA NA NA mineral geode mineral 120
Hematite NA NA NA NA gemologist mineral geode mineral 195
Hematite NA NA NA NA NA mineral geode mineral 150
Mudstone NA NA NA NA gemologist mineral geode mineral 32
Mudstone NA NA NA NA NA mineral geode mineral 25
Obsidian NA NA NA NA gemologist mineral geode mineral 260
Obsidian NA NA NA NA NA mineral geode mineral 200
Slate NA NA NA NA gemologist mineral geode mineral 110
Slate NA NA NA NA NA mineral geode mineral 85
Fairy Stone NA NA NA NA gemologist mineral geode mineral 325
Fairy Stone NA NA NA NA NA mineral geode mineral 250
Star Shards NA NA NA NA gemologist mineral geode mineral 650
Star Shards NA NA NA NA NA mineral geode mineral 500
Geode NA NA NA NA NA mineral geode 50
Frozen Geode NA NA NA NA NA mineral geode 100
Magma Geode NA NA NA NA NA mineral geode 150
Omni Geode NA NA NA NA NA mineral geode 0
Albacore 75 93 112 150 NA fish The Beach NA
Albacore 93 116 140 187 fisher fish The Beach NA
Albacore 112 139 168 225 angler fish The Beach NA
Anchovy 30 37 45 60 NA fish The Beach NA
Anchovy 37 46 56 75 fisher fish The Beach NA
Anchovy 45 55 67 90 angler fish The Beach NA
Angler 900 1125 1350 1800 NA fish Legendary NA
Angler 900 1125 1350 1800 NA fish River NA
Angler 1125 1406 1687 2250 fisher fish Legendary NA
Angler 1125 1406 1687 2250 fisher fish River NA
Angler 1350 1687 2025 2700 angler fish Legendary NA
Angler 1350 1687 2025 2700 angler fish River NA
Blobfish 500 625 750 1000 NA fish Night Market NA
Blobfish 625 781 937 1250 fisher fish Night Market NA
Blobfish 750 937 1125 1500 angler fish Night Market NA
Blue_Discus 120 150 180 240 NA fish Ginger Island NA
Blue_Discus 150 187 225 300 fisher fish Ginger Island NA
Blue_Discus 180 225 270 360 angler fish Ginger Island NA
Bream 45 56 67 90 NA fish River NA
Bream 56 70 83 112 fisher fish River NA
Bream 67 84 100 135 angler fish River NA
Bullhead 75 93 112 150 NA fish Mountain Lake NA
Bullhead 93 116 140 187 fisher fish Mountain Lake NA
Bullhead 112 139 168 225 angler fish Mountain Lake NA
Carp 30 37 45 60 NA fish Mountain Lake NA
Carp 30 37 45 60 NA fish Secret Woods NA
Carp 30 37 45 60 NA fish Sewers NA
Carp 30 37 45 60 NA fish Mutant Bug Lair NA
Carp 37 46 56 75 fisher fish Mountain Lake NA
Carp 37 46 56 75 fisher fish Secret Woods NA
Carp 37 46 56 75 fisher fish Sewers NA
Carp 37 46 56 75 fisher fish Mutant Bug Lair NA
Carp 45 55 67 90 angler fish Mountain Lake NA
Carp 45 55 67 90 angler fish Secret Woods NA
Carp 45 55 67 90 angler fish Sewers NA
Carp 45 55 67 90 angler fish Mutant Bug Lair NA
Catfish 200 250 300 400 NA fish River NA
Catfish 200 250 300 400 NA fish Secret Woods NA
Catfish 200 250 300 400 NA fish Witch's Swamp NA
Catfish 250 312 375 500 fisher fish River NA
Catfish 250 312 375 500 fisher fish Secret Woods NA
Catfish 250 312 375 500 fisher fish Witch's Swamp NA
Catfish 300 375 450 600 angler fish River NA
Catfish 300 375 450 600 angler fish Secret Woods NA
Catfish 300 375 450 600 angler fish Witch's Swamp NA
Chub 50 62 75 100 NA fish River NA
Chub 50 62 75 100 NA fish Mountain Lake NA
Chub 62 77 93 125 fisher fish River NA
Chub 62 77 93 125 fisher fish Mountain Lake NA
Chub 75 93 112 150 angler fish River NA
Chub 75 93 112 150 angler fish Mountain Lake NA
Clam 50 62 75 100 NA fish Crab Pot NA
Clam 62 77 93 125 fisher fish Crab Pot NA
Clam 75 93 112 150 angler fish Crab Pot NA
Cockle 50 62 75 100 NA fish Crab Pot NA
Cockle 62 77 93 125 fisher fish Crab Pot NA
Cockle 75 93 112 150 angler fish Crab Pot NA
Crab 100 125 NA NA NA fish Crab Pot NA
Crab 125 156 NA NA fisher fish Crab Pot NA
Crab 150 187 NA NA angler fish Crab Pot NA
Crayfish 75 93 NA NA NA fish Crab Pot NA
Crayfish 93 116 NA NA fisher fish Crab Pot NA
Crayfish 112 139 NA NA angler fish Crab Pot NA
Crimsonfish 1500 1875 2250 3000 NA fish Legendary NA
Crimsonfish 1500 1875 2250 3000 NA fish The Beach NA
Crimsonfish 1875 2343 2812 3750 fisher fish Legendary NA
Crimsonfish 1875 2343 2812 3750 fisher fish The Beach NA
Crimsonfish 2250 2812 3375 4500 angler fish Legendary NA
Crimsonfish 2250 2812 3375 4500 angler fish The Beach NA
Dorado 100 125 150 200 NA fish River NA
Dorado 125 156 187 250 fisher fish River NA
Dorado 150 187 225 300 angler fish River NA
Eel 85 106 127 170 NA fish The Beach NA
Eel 106 132 158 212 fisher fish The Beach NA
Eel 127 159 190 255 angler fish The Beach NA
Flounder 100 125 150 200 NA fish The Beach NA
Flounder 100 125 150 200 NA fish Ginger Island NA
Flounder 125 156 187 250 fisher fish The Beach NA
Flounder 125 156 187 250 fisher fish Ginger Island NA
Flounder 150 187 225 300 angler fish The Beach NA
Flounder 150 187 225 300 angler fish Ginger Island NA
Ghostfish 45 56 67 90 NA fish Mines NA
Ghostfish 56 70 83 112 fisher fish Mines NA
Ghostfish 67 84 100 135 angler fish Mines NA
Glacierfish 1000 1250 1500 2000 NA fish Legendary NA
Glacierfish 1000 1250 1500 2000 NA fish River NA
Glacierfish 1250 1562 1875 2500 fisher fish Legendary NA
Glacierfish 1250 1562 1875 2500 fisher fish River NA
Glacierfish 1500 1875 2250 3000 angler fish Legendary NA
Glacierfish 1500 1875 2250 3000 angler fish River NA
Glacierfish_Jr. 1000 1250 1500 2000 NA fish Legendary NA
Glacierfish_Jr. 1000 1250 1500 2000 NA fish River NA
Glacierfish_Jr. 1250 1562 1875 2500 fisher fish Legendary NA
Glacierfish_Jr. 1250 1562 1875 2500 fisher fish River NA
Glacierfish_Jr. 1500 1875 2250 3000 angler fish Legendary NA
Glacierfish_Jr. 1500 1875 2250 3000 angler fish River NA
Goby 150 187 225 300 NA fish River NA
Goby 187 233 281 375 fisher fish River NA
Goby 225 280 337 450 angler fish River NA
Halibut 80 100 120 160 NA fish The Beach NA
Halibut 100 125 150 200 fisher fish The Beach NA
Halibut 120 150 180 240 angler fish The Beach NA
Herring 30 37 45 60 NA fish The Beach NA
Herring 37 46 56 75 fisher fish The Beach NA
Herring 45 55 67 90 angler fish The Beach NA
Ice_Pip 500 625 750 1000 NA fish Mines NA
Ice_Pip 625 781 937 1250 fisher fish Mines NA
Ice_Pip 750 937 1125 1500 angler fish Mines NA
Largemouth_Bass 100 125 150 200 NA fish Mountain Lake NA
Largemouth_Bass 125 156 187 250 fisher fish Mountain Lake NA
Largemouth_Bass 150 187 225 300 angler fish Mountain Lake NA
Lava_Eel 700 875 1050 1400 NA fish Mines NA
Lava_Eel 700 875 1050 1400 NA fish Ginger Island NA
Lava_Eel 875 1093 1312 1750 fisher fish Mines NA
Lava_Eel 875 1093 1312 1750 fisher fish Ginger Island NA
Lava_Eel 1050 1312 1575 2100 angler fish Mines NA
Lava_Eel 1050 1312 1575 2100 angler fish Ginger Island NA
Legend 5000 6250 7500 10000 NA fish Legendary NA
Legend 5000 6250 7500 10000 NA fish Mountain Lake NA
Legend 6250 7812 9375 12500 fisher fish Legendary NA
Legend 6250 7812 9375 12500 fisher fish Mountain Lake NA
Legend 7500 9375 11250 15000 angler fish Legendary NA
Legend 7500 9375 11250 15000 angler fish Mountain Lake NA
Legend_II 5000 6250 7500 10000 NA fish Legendary NA
Legend_II 5000 6250 7500 10000 NA fish Mountain Lake NA
Legend_II 6250 7812 9375 12500 fisher fish Legendary NA
Legend_II 6250 7812 9375 12500 fisher fish Mountain Lake NA
Legend_II 7500 9375 11250 15000 angler fish Legendary NA
Legend_II 7500 9375 11250 15000 angler fish Mountain Lake NA
Lingcod 120 150 180 240 NA fish River NA
Lingcod 120 150 180 240 NA fish Mountain Lake NA
Lingcod 150 187 225 300 fisher fish River NA
Lingcod 150 187 225 300 fisher fish Mountain Lake NA
Lingcod 180 225 270 360 angler fish River NA
Lingcod 180 225 270 360 angler fish Mountain Lake NA
Lionfish 100 125 150 200 NA fish Ginger Island NA
Lionfish 125 156 187 250 fisher fish Ginger Island NA
Lionfish 150 187 225 300 angler fish Ginger Island NA
Lobster 120 150 NA NA NA fish Crab Pot NA
Lobster 150 187 NA NA fisher fish Crab Pot NA
Lobster 180 225 NA NA angler fish Crab Pot NA
Midnight_Carp 150 187 225 300 NA fish Mountain Lake NA
Midnight_Carp 150 187 225 300 NA fish Cindersap Forest Pond NA
Midnight_Carp 150 187 225 300 NA fish Ginger Island NA
Midnight_Carp 187 233 281 375 fisher fish Mountain Lake NA
Midnight_Carp 187 233 281 375 fisher fish Cindersap Forest Pond NA
Midnight_Carp 187 233 281 375 fisher fish Ginger Island NA
Midnight_Carp 225 280 337 450 angler fish Mountain Lake NA
Midnight_Carp 225 280 337 450 angler fish Cindersap Forest Pond NA
Midnight_Carp 225 280 337 450 angler fish Ginger Island NA
Midnight_Squid 100 125 150 200 NA fish Night Market NA
Midnight_Squid 125 156 187 250 fisher fish Night Market NA
Midnight_Squid 150 187 225 300 angler fish Night Market NA
Ms._Angler 900 1125 1350 1800 NA fish Legendary NA
Ms._Angler 900 1125 1350 1800 NA fish River NA
Ms._Angler 1125 1406 1687 2250 fisher fish Legendary NA
Ms._Angler 1125 1406 1687 2250 fisher fish River NA
Ms._Angler 1350 1687 2025 2700 angler fish Legendary NA
Ms._Angler 1350 1687 2025 2700 angler fish River NA
Mussel 30 37 45 60 NA fish Crab Pot NA
Mussel 37 46 56 75 fisher fish Crab Pot NA
Mussel 45 55 67 90 angler fish Crab Pot NA
Mutant_Carp 1000 1250 1500 2000 NA fish Legendary NA
Mutant_Carp 1000 1250 1500 2000 NA fish Sewers NA
Mutant_Carp 1250 1562 1875 2500 fisher fish Legendary NA
Mutant_Carp 1250 1562 1875 2500 fisher fish Sewers NA
Mutant_Carp 1500 1875 2250 3000 angler fish Legendary NA
Mutant_Carp 1500 1875 2250 3000 angler fish Sewers NA
Octopus 150 187 225 300 NA fish The Beach NA
Octopus 150 187 225 300 NA fish Night Market NA
Octopus 150 187 225 300 NA fish Ginger Island NA
Octopus 187 233 281 375 fisher fish The Beach NA
Octopus 187 233 281 375 fisher fish Night Market NA
Octopus 187 233 281 375 fisher fish Ginger Island NA
Octopus 225 280 337 450 angler fish The Beach NA
Octopus 225 280 337 450 angler fish Night Market NA
Octopus 225 280 337 450 angler fish Ginger Island NA
Oyster 40 50 60 80 NA fish Crab Pot NA
Oyster 50 62 75 100 fisher fish Crab Pot NA
Oyster 60 75 90 120 angler fish Crab Pot NA
Perch 55 68 82 110 NA fish River NA
Perch 55 68 82 110 NA fish Mountain Lake NA
Perch 55 68 82 110 NA fish Cindersap Forest Pond NA
Perch 68 85 102 137 fisher fish River NA
Perch 68 85 102 137 fisher fish Mountain Lake NA
Perch 68 85 102 137 fisher fish Cindersap Forest Pond NA
Perch 82 102 123 165 angler fish River NA
Perch 82 102 123 165 angler fish Mountain Lake NA
Perch 82 102 123 165 angler fish Cindersap Forest Pond NA
Periwinkle 20 25 NA NA NA fish Crab Pot NA
Periwinkle 25 31 NA NA fisher fish Crab Pot NA
Periwinkle 30 37 NA NA angler fish Crab Pot NA
Pike 100 125 150 200 NA fish River NA
Pike 100 125 150 200 NA fish Cindersap Forest Pond NA
Pike 125 156 187 250 fisher fish River NA
Pike 125 156 187 250 fisher fish Cindersap Forest Pond NA
Pike 150 187 225 300 angler fish River NA
Pike 150 187 225 300 angler fish Cindersap Forest Pond NA
Pufferfish 200 250 300 400 NA fish The Beach NA
Pufferfish 200 250 300 400 NA fish Ginger Island NA
Pufferfish 250 312 375 500 fisher fish The Beach NA
Pufferfish 250 312 375 500 fisher fish Ginger Island NA
Pufferfish 300 375 450 600 angler fish The Beach NA
Pufferfish 300 375 450 600 angler fish Ginger Island NA
Radioactive_Carp 1000 1250 1500 2000 NA fish Legendary NA
Radioactive_Carp 1000 1250 1500 2000 NA fish Sewers NA
Radioactive_Carp 1250 1562 1875 2500 fisher fish Legendary NA
Radioactive_Carp 1250 1562 1875 2500 fisher fish Sewers NA
Radioactive_Carp 1500 1875 2250 3000 angler fish Legendary NA
Radioactive_Carp 1500 1875 2250 3000 angler fish Sewers NA
Rainbow_Trout 65 81 97 130 NA fish River NA
Rainbow_Trout 65 81 97 130 NA fish Mountain Lake NA
Rainbow_Trout 81 101 121 162 fisher fish River NA
Rainbow_Trout 81 101 121 162 fisher fish Mountain Lake NA
Rainbow_Trout 97 121 145 195 angler fish River NA
Rainbow_Trout 97 121 145 195 angler fish Mountain Lake NA
Red_Mullet 75 93 112 150 NA fish The Beach NA
Red_Mullet 93 116 140 187 fisher fish The Beach NA
Red_Mullet 112 139 168 225 angler fish The Beach NA
Red_Snapper 50 62 75 100 NA fish The Beach NA
Red_Snapper 62 77 93 125 fisher fish The Beach NA
Red_Snapper 75 93 112 150 angler fish The Beach NA
Salmon 75 93 112 150 NA fish River NA
Salmon 93 116 140 187 fisher fish River NA
Salmon 112 139 168 225 angler fish River NA
Sandfish 75 93 112 150 NA fish Desert NA
Sandfish 93 116 140 187 fisher fish Desert NA
Sandfish 112 139 168 225 angler fish Desert NA
Sardine 40 50 60 80 NA fish The Beach NA
Sardine 50 62 75 100 fisher fish The Beach NA
Sardine 60 75 90 120 angler fish The Beach NA
Scorpion_Carp 150 187 225 300 NA fish Desert NA
Scorpion_Carp 187 233 281 375 fisher fish Desert NA
Scorpion_Carp 225 280 337 450 angler fish Desert NA
Sea_Cucumber 75 93 112 150 NA fish The Beach NA
Sea_Cucumber 75 93 112 150 NA fish Night Market NA
Sea_Cucumber 93 116 140 187 fisher fish The Beach NA
Sea_Cucumber 93 116 140 187 fisher fish Night Market NA
Sea_Cucumber 112 139 168 225 angler fish The Beach NA
Sea_Cucumber 112 139 168 225 angler fish Night Market NA
Shad 60 75 90 120 NA fish River NA
Shad 75 93 112 150 fisher fish River NA
Shad 90 112 135 180 angler fish River NA
Shrimp 60 75 NA NA NA fish Crab Pot NA
Shrimp 75 93 NA NA fisher fish Crab Pot NA
Shrimp 90 112 NA NA angler fish Crab Pot NA
Slimejack 100 125 150 200 NA fish Mutant Bug Lair NA
Slimejack 125 156 187 250 fisher fish Mutant Bug Lair NA
Slimejack 150 187 225 300 angler fish Mutant Bug Lair NA
Smallmouth_Bass 50 62 75 100 NA fish River NA
Smallmouth_Bass 50 62 75 100 NA fish Cindersap Forest Pond NA
Smallmouth_Bass 62 77 93 125 fisher fish River NA
Smallmouth_Bass 62 77 93 125 fisher fish Cindersap Forest Pond NA
Smallmouth_Bass 75 93 112 150 angler fish River NA
Smallmouth_Bass 75 93 112 150 angler fish Cindersap Forest Pond NA
Snail 65 81 NA NA NA fish Crab Pot NA
Snail 81 101 NA NA fisher fish Crab Pot NA
Snail 97 121 NA NA angler fish Crab Pot NA
Son_of_Crimsonfish 1500 1875 2250 3000 NA fish Legendary NA
Son_of_Crimsonfish 1500 1875 2250 3000 NA fish The Beach NA
Son_of_Crimsonfish 1875 2343 2812 3750 fisher fish Legendary NA
Son_of_Crimsonfish 1875 2343 2812 3750 fisher fish The Beach NA
Son_of_Crimsonfish 2250 2812 3375 4500 angler fish Legendary NA
Son_of_Crimsonfish 2250 2812 3375 4500 angler fish The Beach NA
Spook_Fish 220 275 330 440 NA fish Night Market NA
Spook_Fish 275 343 412 550 fisher fish Night Market NA
Spook_Fish 330 412 495 660 angler fish Night Market NA
Squid 80 100 120 160 NA fish The Beach NA
Squid 100 125 150 200 fisher fish The Beach NA
Squid 120 150 180 240 angler fish The Beach NA
Stingray 180 225 270 360 NA fish Ginger Island NA
Stingray 225 281 337 450 fisher fish Ginger Island NA
Stingray 270 337 405 540 angler fish Ginger Island NA
Stonefish 300 375 450 600 NA fish Mines NA
Stonefish 375 468 562 750 fisher fish Mines NA
Stonefish 450 562 675 900 angler fish Mines NA
Sturgeon 200 250 300 400 NA fish Mountain Lake NA
Sturgeon 250 312 375 500 fisher fish Mountain Lake NA
Sturgeon 300 375 450 600 angler fish Mountain Lake NA
Sunfish 30 37 45 60 NA fish River NA
Sunfish 37 46 56 75 fisher fish River NA
Sunfish 45 55 67 90 angler fish River NA
Super_Cucumber 250 312 375 500 NA fish The Beach NA
Super_Cucumber 250 312 375 500 NA fish Night Market NA
Super_Cucumber 312 390 468 625 fisher fish The Beach NA
Super_Cucumber 312 390 468 625 fisher fish Night Market NA
Super_Cucumber 375 468 562 750 angler fish The Beach NA
Super_Cucumber 375 468 562 750 angler fish Night Market NA
Tiger_Trout 150 187 225 300 NA fish River NA
Tiger_Trout 187 233 281 375 fisher fish River NA
Tiger_Trout 225 280 337 450 angler fish River NA
Tilapia 75 93 112 150 NA fish The Beach NA
Tilapia 75 93 112 150 NA fish Ginger Island NA
Tilapia 93 116 140 187 fisher fish The Beach NA
Tilapia 93 116 140 187 fisher fish Ginger Island NA
Tilapia 112 139 168 225 angler fish The Beach NA
Tilapia 112 139 168 225 angler fish Ginger Island NA
Tuna 100 125 150 200 NA fish The Beach NA
Tuna 100 125 150 200 NA fish Ginger Island NA
Tuna 125 156 187 250 fisher fish The Beach NA
Tuna 125 156 187 250 fisher fish Ginger Island NA
Tuna 150 187 225 300 angler fish The Beach NA
Tuna 150 187 225 300 angler fish Ginger Island NA
Void_Salmon 150 187 225 300 NA fish Witch's Swamp NA
Void_Salmon 187 233 281 375 fisher fish Witch's Swamp NA
Void_Salmon 225 280 337 450 angler fish Witch's Swamp NA
Walleye 105 131 157 210 NA fish River NA
Walleye 105 131 157 210 NA fish Mountain Lake NA
Walleye 105 131 157 210 NA fish Cindersap Forest Pond NA
Walleye 131 163 196 262 fisher fish River NA
Walleye 131 163 196 262 fisher fish Mountain Lake NA
Walleye 131 163 196 262 fisher fish Cindersap Forest Pond NA
Walleye 157 196 235 315 angler fish River NA
Walleye 157 196 235 315 angler fish Mountain Lake NA
Walleye 157 196 235 315 angler fish Cindersap Forest Pond NA
Woodskip 75 93 112 150 NA fish Secret Woods NA
Woodskip 93 116 140 187 fisher fish Secret Woods NA
Woodskip 112 139 168 225 angler fish Secret Woods NA

Additional Data

Seeds

While working on our shiny app we realized that we needed additional data for crops involving the seed data for the crop because it consisted of growth time which is how long the crop takes to grow.

Code
# make sure can scrape
seed <- bow("https://stardewvalleywiki.com/Potato_Seeds", force = TRUE)

result <- scrape(seed) |>
  html_nodes(css = "table") |>
  html_table(header = TRUE, fill = TRUE)

seeds <- result[[4]][2] #table of the seeds so we can use that list

seeds <- seeds |>
  mutate(Seed = strsplit(`Seeds, Starters, and Saplings`, " • ", fixed = TRUE)) |>
  unnest(Seed) |>
  mutate(Seed = str_replace_all(Seed, " ", "_")) |>
  distinct(Seed) |>
  filter(Seed != "Coffee_Beans")

Like our other categories we created a function to scrape the seed data.

Code
get_growth <- function(page, css_selector) {
  page |>
  html_nodes(css_selector) |>
  html_text()
}

# function for growth time
seeddeets <- function(seed) {
  url <- str_c("https://stardewvalleywiki.com/", seed)
    page <- read_html(url)
    growth_time <- get_growth(page, "tr:nth-child(6) #infoboxdetail")
    general_store <- get_growth(page, "tr:nth-child(10) #infoboxdetail .no-wrap")
    jojamart <- get_growth(page, "tr:nth-child(11) #infoboxdetail .no-wrap")
    oasis <- get_growth(page, "tr:nth-child(12) #infoboxdetail , .no-wrap+ #infoboxdetail .no-wrap")
    item <- seed
    
    seedinfo_tbl <- tibble(
      item = item,
      growth_time = parse_number(growth_time),
      general_store = parse_number(general_store), 
      jojamart = parse_number(jojamart),
      #oasis = parse_number(oasis)
    )
}

# list of all seeds
seeds_list <- as.vector(seeds$Seed)

details <- purrr::map(seeds_list, seeddeets)

draft_seed <- bind_rows(details) |>
  arrange(item)

# check which seeds didn't work
empty_indices <- which(sapply(details, function(tbl) nrow(tbl) == 0))

# assign to list
seeds_needed <- seeds_list[empty_indices]

Another function for the seeds needed from above.

Code
# function for growth time
seeddeets2 <- function(seed) {
  url <- str_c("https://stardewvalleywiki.com/", seed)
    page <- read_html(url)
    growth_time <- get_growth(page, "tr:nth-child(6) #infoboxdetail")
    general_store <- get_growth(page, "tr:nth-child(10) #infoboxdetail")
    jojamart <- get_growth(page, "tr:nth-child(11) #infoboxdetail")
    item <- seed
    
    seedinfo_tbl <- tibble(
      item = item,
      growth_time = parse_number(growth_time),
      general_store = parse_number(str_extract(general_store, "[0-9]+")), 
      jojamart = parse_number(jojamart)
      )}

details2 <- purrr::map(seeds_needed, seeddeets2)

draft_seed2 <- bind_rows(details2) |>
  arrange(item)

empty_indices2 <- which(sapply(details2, function(tbl) nrow(tbl) == 0))

# seeds needed again
seeds_needed2 <- seeds_needed[empty_indices2]

#bind together rows since no more seeds needed
seed_details <- bind_rows(details, details2) |>
  arrange(item)

After collecting all the information we found that we weren’t able to just join the crops dataset with our seed details since the names are very off, for example we aren’t able to join Amarath_Seeds with Amarath since it has the seeds at the end or Apples with Apple_Saplings, or Pepper_Seeds with Hot_Pepper, so we had to manually look at our data and string replace lots of items that would’ve ended up lost in the join.

Code
# manually change names so we can join together with crops later.
seed_deets <- seed_details |>
  mutate(item = str_replace(item, "_Seeds?", ""),
         item = str_replace(item, "_Saplings?", ""),
         item = str_replace(item, "_Bulb", ""),
         item = str_replace(item, "_Starter", ""),
         item = str_replace(item, "_Shoots?", ""),
         item = str_replace(item, "_Tuber", ""),
         item = str_replace(item, "_Bean", "_Fruit"),
         item = str_replace(item, "Cactus", "Cactus_Fruit"),
         item = str_replace(item, "Fairy", "Fairy_Rose"),
         item = str_replace(item, "Jazz", "Blue_Jazz"),
         item = str_replace(item, "Tea", "Tea_Leaves"),
         item = str_replace(item, "Taro", "Taro_Root"),
         item = str_replace(item, "Spangle", "Summer_Spangle"),
         item = str_replace(item, "Rare", "Sweet_Gem_Berry"),
         item = str_replace(item, "Bean", "Green_Bean"),
         item = str_replace(item, "Ancient", "Ancient_Fruit"),
         item = str_replace(item, "Pepper", "Hot_Pepper"),
         item = str_replace(item, "Rice", "Unmilled_Rice"))

oasis <- data.frame(
    item = c("Cactus_Fruit", "Rhubarb", "Starfruit", "Beet"),
    oasis_price = c(150, 100, 400, 20)
  )

seed_deets <- seed_deets|>
  left_join(oasis, join_by(item))

#write.csv(seed_deets, "seed_deets.csv")

seed_deets |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item growth_time general_store jojamart oasis_price
Acorn NA NA NA NA
Amaranth 7 70 87 NA
Ancient_Fruit 28 NA NA NA
Apple 28 4000 NA NA
Apricot 28 2000 NA NA
Artichoke 8 30 NA NA
Banana 28 NA NA NA
Green_Bean 10 60 75 NA
Beet 6 NA NA 20
Blue_Grass NA NA NA NA
Blueberry 13 80 NA NA
Bok_Choy 4 50 62 NA
Broccoli 8 NA NA NA
Cactus_Fruit 12 NA NA 150
Carrot 3 NA NA NA
Cauliflower 12 80 100 NA
Cherry 28 3400 NA NA
Corn 14 150 187 NA
Cranberry 7 240 300 NA
Eggplant 5 20 25 NA
Fairy_Rose 12 200 250 NA
Fall 7 NA NA NA
Fiber 7 NA NA NA
Garlic 4 40 NA NA
Grape 10 60 75 NA
Grass NA 100 125 NA
Hops 11 60 75 NA
Blue_Jazz 7 30 37 NA
Kale 6 70 87 NA
Mahogany NA NA NA NA
Mango 28 NA NA NA
Maple NA NA NA NA
Melon 12 80 100 NA
Mixed_Flower NA NA NA NA
Mixed NA NA NA NA
Mossy NA NA NA NA
Mushroom_Tree NA NA NA NA
Mystic_Tree NA NA NA NA
Orange 28 4000 NA NA
Parsnip 4 20 25 NA
Peach 28 6000 NA NA
Hot_Pepper 5 40 50 NA
Pine_Cone NA NA NA NA
Pineapple 14 NA NA NA
Pomegranate 28 6000 NA NA
Poppy 7 100 125 NA
Potato 6 50 62 NA
Powdermelon 7 NA NA NA
Pumpkin 13 100 125 NA
Qi_Fruit 4 NA NA NA
Radish 6 40 50 NA
Sweet_Gem_Berry 24 NA NA NA
Red_Cabbage 9 100 NA NA
Rhubarb 13 NA NA 100
Unmilled_Rice 8 40 NA NA
Summer_Spangle 8 50 62 NA
Spring 7 NA NA NA
Starfruit 13 NA NA 400
Strawberry 8 NA NA NA
Summer 7 NA NA NA
Summer_Squash 6 NA NA NA
Sunflower 8 200 125 NA
Taro_Root 10 NA NA NA
Tea_Leaves 20 NA NA NA
Tomato 11 50 62 NA
Tulip 6 20 25 NA
Wheat 4 10 12 NA
Winter 7 NA NA NA
Yam 10 60 75 NA

Animal Origins

We also wanted the origins of where a product came, this took two steps, first scraping the animal products table and then joining it with another table, we also set the profession instead of NA to be none and did not pivot it for future use in our app.

Code
animaltable <- bow("https://stardewvalleywiki.com/Animal_Products_Profitability", force = TRUE)

result <- scrape(animaltable) |>
  html_nodes(css = "table") |>
  html_table(header = TRUE, fill = TRUE)

animal_table <- result[[2]] 

animal_table <- animal_table |>
  clean_names() |>
  mutate(profession = ifelse(profession == "—", "none", profession)) |>
  filter(profession != "Treasure Appraisal Guide and  Artisan")

animal_table |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item quality profession sell_price processed_item processed_item_quality processed_item_sell_price profit_increase
Egg Regular none 50 Mayonnaise Regular 190 380%
Egg Silver none 62 Mayonnaise Regular 190 306%
Egg Gold none 75 Mayonnaise Regular 190 253%
Egg Iridium none 100 Mayonnaise Regular 190 190%
Egg Regular Rancher 60 Mayonnaise Regular 228 380%
Egg Silver Rancher 75 Mayonnaise Regular 228 304%
Egg Gold Rancher 90 Mayonnaise Regular 228 253%
Egg Iridium Rancher 120 Mayonnaise Regular 228 190%
Egg Regular Artisan 50 Mayonnaise Regular 266 532%
Egg Silver Artisan 62 Mayonnaise Regular 266 429%
Egg Gold Artisan 75 Mayonnaise Regular 266 355%
Egg Iridium Artisan 100 Mayonnaise Regular 266 266%
Large Egg Regular none 95 Mayonnaise Gold 285 300%
Large Egg Silver none 118 Mayonnaise Gold 285 242%
Large Egg Gold none 142 Mayonnaise Gold 285 201%
Large Egg Iridium none 190 Mayonnaise Gold 285 150%
Large Egg Regular Rancher 114 Mayonnaise Gold 342 300%
Large Egg Silver Rancher 142 Mayonnaise Gold 342 241%
Large Egg Gold Rancher 171 Mayonnaise Gold 342 200%
Large Egg Iridium Rancher 228 Mayonnaise Gold 342 150%
Large Egg Regular Artisan 95 Mayonnaise Gold 399 420%
Large Egg Silver Artisan 118 Mayonnaise Gold 399 338%
Large Egg Gold Artisan 142 Mayonnaise Gold 399 281%
Large Egg Iridium Artisan 190 Mayonnaise Gold 399 210%
Void Egg Regular none 65 Void Mayonnaise Regular 275 423%
Void Egg Silver none 81 Void Mayonnaise Regular 275 340%
Void Egg Gold none 97 Void Mayonnaise Regular 275 284%
Void Egg Iridium none 130 Void Mayonnaise Regular 275 212%
Void Egg Regular Rancher 78 Void Mayonnaise Regular 330 423%
Void Egg Silver Rancher 97 Void Mayonnaise Regular 330 340%
Void Egg Gold Rancher 117 Void Mayonnaise Regular 330 282%
Void Egg Iridium Rancher 156 Void Mayonnaise Regular 330 212%
Void Egg Regular Artisan 65 Void Mayonnaise Regular 385 592%
Void Egg Silver Artisan 81 Void Mayonnaise Regular 385 475%
Void Egg Gold Artisan 97 Void Mayonnaise Regular 385 397%
Void Egg Iridium Artisan 130 Void Mayonnaise Regular 385 296%
Duck Egg Regular none 95 Duck Mayonnaise Regular 375 395%
Duck Egg Silver none 118 Duck Mayonnaise Regular 375 318%
Duck Egg Gold none 142 Duck Mayonnaise Regular 375 264%
Duck Egg Iridium none 190 Duck Mayonnaise Regular 375 197%
Duck Egg Regular Rancher 114 Duck Mayonnaise Regular 450 395%
Duck Egg Silver Rancher 142 Duck Mayonnaise Regular 450 317%
Duck Egg Gold Rancher 171 Duck Mayonnaise Regular 450 263%
Duck Egg Iridium Rancher 228 Duck Mayonnaise Regular 450 197%
Duck Egg Regular Artisan 95 Duck Mayonnaise Regular 525 553%
Duck Egg Silver Artisan 118 Duck Mayonnaise Regular 525 445%
Duck Egg Gold Artisan 142 Duck Mayonnaise Regular 525 370%
Duck Egg Iridium Artisan 190 Duck Mayonnaise Regular 525 276%
Wool Regular none 340 Cloth (1) Regular 470 138%
Wool Silver none 425 Cloth (1) Regular 470 111%
Wool Silver none 425 Cloth (2) Regular 940 221%
Wool Gold none 510 Cloth (1) Regular 470 92%
Wool Gold none 510 Cloth (2) Regular 940 184%
Wool Iridium none 680 Cloth (2) Regular 940 138%
Wool Regular Rancher 408 Cloth (1) Regular 564 138%
Wool Regular Rancher 408 Cloth (2) Regular 1128 276%
Wool Silver Rancher 510 Cloth (1) Regular 564 111%
Wool Silver Rancher 510 Cloth (2) Regular 1128 221%
Wool Gold Rancher 612 Cloth (1) Regular 564 92%
Wool Gold Rancher 612 Cloth (2) Regular 1128 184%
Wool Iridium Rancher 816 Cloth (2) Regular 1128 138%
Wool Regular Artisan 340 Cloth (1) Regular 658 194%
Wool Regular Artisan 340 Cloth (2) Regular 1316 387%
Wool Silver Artisan 425 Cloth (1) Regular 658 155%
Wool Silver Artisan 425 Cloth (2) Regular 1316 310%
Wool Gold Artisan 510 Cloth (1) Regular 658 129%
Wool Gold Artisan 510 Cloth (2) Regular 1316 258%
Wool Iridium Artisan 680 Cloth (2) Regular 1316 194%
Dinosaur Egg Regular none 350 Dinosaur Mayonnaise Regular 800 229%
Dinosaur Egg Silver none 437 Dinosaur Mayonnaise Regular 800 183%
Dinosaur Egg Gold none 525 Dinosaur Mayonnaise Regular 800 152%
Dinosaur Egg Iridium none 700 Dinosaur Mayonnaise Regular 800 114%
Dinosaur Egg Regular Rancher 350 Dinosaur Mayonnaise Regular 960 274%
Dinosaur Egg Silver Rancher 437 Dinosaur Mayonnaise Regular 960 220%
Dinosaur Egg Gold Rancher 525 Dinosaur Mayonnaise Regular 960 183%
Dinosaur Egg Iridium Rancher 700 Dinosaur Mayonnaise Regular 960 137%
Dinosaur Egg Regular Artisan 350 Dinosaur Mayonnaise Regular 1120 320%
Dinosaur Egg Silver Artisan 437 Dinosaur Mayonnaise Regular 1120 256%
Dinosaur Egg Gold Artisan 525 Dinosaur Mayonnaise Regular 1120 213%
Dinosaur Egg Iridium Artisan 700 Dinosaur Mayonnaise Regular 1120 160%
Golden Egg Regular none 500 Mayonnaise (3) Gold 855 171%
Golden Egg Silver none 625 Mayonnaise (3) Gold 855 137%
Golden Egg Gold none 750 Mayonnaise (3) Gold 855 114%
Golden Egg Iridium none 1000 Mayonnaise (3) Gold 855 86%
Golden Egg Regular Rancher 600 Mayonnaise (3) Gold 1026 171%
Golden Egg Silver Rancher 750 Mayonnaise (3) Gold 1026 137%
Golden Egg Gold Rancher 900 Mayonnaise (3) Gold 1026 114%
Golden Egg Iridium Rancher 1200 Mayonnaise (3) Gold 1026 86%
Golden Egg Regular Artisan 500 Mayonnaise (3) Gold 1197 239%
Golden Egg Silver Artisan 625 Mayonnaise (3) Gold 1197 192%
Golden Egg Gold Artisan 750 Mayonnaise (3) Gold 1197 160%
Golden Egg Iridium Artisan 1000 Mayonnaise (3) Gold 1197 120%
Ostrich Egg Regular none 600 Mayonnaise (10) Regular 1900 317%
Ostrich Egg Silver none 750 Mayonnaise (10) Silver 2370 316%
Ostrich Egg Gold none 900 Mayonnaise (10) Gold 2850 317%
Ostrich Egg Iridium none 1200 Mayonnaise (10) Iridium 3800 317%
Ostrich Egg Regular Rancher 720 Mayonnaise (10) Regular 2280 317%
Ostrich Egg Silver Rancher 900 Mayonnaise (10) Silver 2840 316%
Ostrich Egg Gold Rancher 1080 Mayonnaise (10) Gold 3420 317%
Ostrich Egg Iridium Rancher 1440 Mayonnaise (10) Iridium 4560 317%
Ostrich Egg Regular Artisan 600 Mayonnaise (10) Regular 2660 443%
Ostrich Egg Silver Artisan 750 Mayonnaise (10) Silver 3310 441%
Ostrich Egg Gold Artisan 900 Mayonnaise (10) Gold 3990 443%
Ostrich Egg Iridium Artisan 1200 Mayonnaise (10) Iridium 5320 443%
Milk Regular none 125 Cheese Regular 230 184%
Milk Regular none 125 Cheese Silver 287 230%
Milk Regular none 125 Cheese Gold 345 276%
Milk Regular none 125 Cheese Iridium 460 368%
Milk Silver none 156 Cheese Regular 230 147%
Milk Silver none 156 Cheese Silver 287 184%
Milk Silver none 156 Cheese Gold 345 221%
Milk Silver none 156 Cheese Iridium 460 295%
Milk Gold none 187 Cheese Regular 230 123%
Milk Gold none 187 Cheese Silver 287 153%
Milk Gold none 187 Cheese Gold 345 184%
Milk Gold none 187 Cheese Iridium 460 246%
Milk Iridium none 250 Cheese Regular 230 92%
Milk Iridium none 250 Cheese Silver 287 115%
Milk Iridium none 250 Cheese Gold 345 138%
Milk Iridium none 250 Cheese Iridium 460 184%
Milk Regular Rancher 150 Cheese Regular 276 184%
Milk Regular Rancher 150 Cheese Silver 345 230%
Milk Regular Rancher 150 Cheese Gold 414 276%
Milk Regular Rancher 150 Cheese Iridium 552 368%
Milk Silver Rancher 187 Cheese Regular 276 148%
Milk Silver Rancher 187 Cheese Silver 345 184%
Milk Silver Rancher 187 Cheese Gold 414 221%
Milk Silver Rancher 187 Cheese Iridium 552 295%
Milk Gold Rancher 225 Cheese Regular 276 123%
Milk Gold Rancher 225 Cheese Silver 345 153%
Milk Gold Rancher 225 Cheese Gold 414 184%
Milk Gold Rancher 225 Cheese Iridium 552 245%
Milk Iridium Rancher 300 Cheese Regular 276 92%
Milk Iridium Rancher 300 Cheese Silver 345 115%
Milk Iridium Rancher 300 Cheese Gold 414 138%
Milk Iridium Rancher 300 Cheese Iridium 552 184%
Milk Regular Artisan 125 Cheese Regular 322 258%
Milk Regular Artisan 125 Cheese Silver 402 322%
Milk Regular Artisan 125 Cheese Gold 483 386%
Milk Regular Artisan 125 Cheese Iridium 644 515%
Milk Silver Artisan 156 Cheese Regular 322 206%
Milk Silver Artisan 156 Cheese Silver 402 258%
Milk Silver Artisan 156 Cheese Gold 483 310%
Milk Silver Artisan 156 Cheese Iridium 644 413%
Milk Gold Artisan 187 Cheese Regular 322 172%
Milk Gold Artisan 187 Cheese Silver 402 215%
Milk Gold Artisan 187 Cheese Gold 483 258%
Milk Gold Artisan 187 Cheese Iridium 644 344%
Milk Iridium Artisan 250 Cheese Regular 322 129%
Milk Iridium Artisan 250 Cheese Silver 402 161%
Milk Iridium Artisan 250 Cheese Gold 483 193%
Milk Iridium Artisan 250 Cheese Iridium 644 258%
Large Milk Regular none 190 Cheese Gold 345 182%
Large Milk Regular none 190 Cheese Iridium 460 242%
Large Milk Silver none 237 Cheese Gold 345 146%
Large Milk Silver none 237 Cheese Iridium 460 194%
Large Milk Gold none 285 Cheese Gold 345 121%
Large Milk Gold none 285 Cheese Iridium 460 161%
Large Milk Iridium none 380 Cheese Gold 345 91%
Large Milk Iridium none 380 Cheese Iridium 460 121%
Large Milk Regular Rancher 228 Cheese Gold 414 182%
Large Milk Regular Rancher 228 Cheese Iridium 552 242%
Large Milk Silver Rancher 285 Cheese Gold 414 145%
Large Milk Silver Rancher 285 Cheese Iridium 552 194%
Large Milk Gold Rancher 342 Cheese Gold 414 121%
Large Milk Gold Rancher 342 Cheese Iridium 552 161%
Large Milk Iridium Rancher 456 Cheese Gold 414 91%
Large Milk Iridium Rancher 456 Cheese Iridium 552 121%
Large Milk Regular Artisan 190 Cheese Gold 483 254%
Large Milk Regular Artisan 190 Cheese Iridium 644 339%
Large Milk Silver Artisan 237 Cheese Gold 483 204%
Large Milk Silver Artisan 237 Cheese Iridium 644 272%
Large Milk Gold Artisan 285 Cheese Gold 483 169%
Large Milk Gold Artisan 285 Cheese Iridium 644 226%
Large Milk Iridium Artisan 380 Cheese Gold 483 127%
Large Milk Iridium Artisan 380 Cheese Iridium 644 169%
Goat Milk Regular none 225 Goat Cheese Regular 400 178%
Goat Milk Regular none 225 Goat Cheese Silver 500 222%
Goat Milk Regular none 225 Goat Cheese Gold 600 267%
Goat Milk Regular none 225 Goat Cheese Iridium 800 356%
Goat Milk Silver none 281 Goat Cheese Regular 400 142%
Goat Milk Silver none 281 Goat Cheese Silver 500 178%
Goat Milk Silver none 281 Goat Cheese Gold 600 214%
Goat Milk Silver none 281 Goat Cheese Iridium 800 285%
Goat Milk Gold none 337 Goat Cheese Regular 400 119%
Goat Milk Gold none 337 Goat Cheese Silver 500 148%
Goat Milk Gold none 337 Goat Cheese Gold 600 178%
Goat Milk Gold none 337 Goat Cheese Iridium 800 237%
Goat Milk Iridium none 450 Goat Cheese Regular 400 89%
Goat Milk Iridium none 450 Goat Cheese Silver 500 111%
Goat Milk Iridium none 450 Goat Cheese Gold 600 133%
Goat Milk Iridium none 450 Goat Cheese Iridium 800 178%
Goat Milk Regular Rancher 270 Goat Cheese Regular 480 178%
Goat Milk Regular Rancher 270 Goat Cheese Silver 600 222%
Goat Milk Regular Rancher 270 Goat Cheese Gold 720 267%
Goat Milk Regular Rancher 270 Goat Cheese Iridium 960 356%
Goat Milk Silver Rancher 337 Goat Cheese Regular 480 142%
Goat Milk Silver Rancher 337 Goat Cheese Silver 600 178%
Goat Milk Silver Rancher 337 Goat Cheese Gold 720 214%
Goat Milk Silver Rancher 337 Goat Cheese Iridium 960 285%
Goat Milk Gold Rancher 405 Goat Cheese Regular 480 118%
Goat Milk Gold Rancher 405 Goat Cheese Silver 600 148%
Goat Milk Gold Rancher 405 Goat Cheese Gold 720 178%
Goat Milk Gold Rancher 405 Goat Cheese Iridium 960 237%
Goat Milk Iridium Rancher 540 Goat Cheese Regular 480 89%
Goat Milk Iridium Rancher 540 Goat Cheese Silver 600 111%
Goat Milk Iridium Rancher 540 Goat Cheese Gold 720 133%
Goat Milk Iridium Rancher 540 Goat Cheese Iridium 960 178%
Goat Milk Regular Artisan 225 Goat Cheese Regular 560 249%
Goat Milk Regular Artisan 225 Goat Cheese Silver 700 311%
Goat Milk Regular Artisan 225 Goat Cheese Gold 840 373%
Goat Milk Regular Artisan 225 Goat Cheese Iridium 1120 498%
Goat Milk Silver Artisan 281 Goat Cheese Regular 560 199%
Goat Milk Silver Artisan 281 Goat Cheese Silver 700 249%
Goat Milk Silver Artisan 281 Goat Cheese Gold 840 299%
Goat Milk Silver Artisan 281 Goat Cheese Iridium 1120 399%
Goat Milk Gold Artisan 337 Goat Cheese Regular 560 166%
Goat Milk Gold Artisan 337 Goat Cheese Silver 700 208%
Goat Milk Gold Artisan 337 Goat Cheese Gold 840 249%
Goat Milk Gold Artisan 337 Goat Cheese Iridium 1120 332%
Goat Milk Iridium Artisan 450 Goat Cheese Regular 560 124%
Goat Milk Iridium Artisan 450 Goat Cheese Silver 700 156%
Goat Milk Iridium Artisan 450 Goat Cheese Gold 840 187%
Goat Milk Iridium Artisan 450 Goat Cheese Iridium 1120 249%
Large Goat Milk Regular none 345 Goat Cheese Gold 600 174%
Large Goat Milk Regular none 345 Goat Cheese Iridium 800 232%
Large Goat Milk Silver none 431 Goat Cheese Gold 600 139%
Large Goat Milk Silver none 431 Goat Cheese Iridium 800 186%
Large Goat Milk Gold none 517 Goat Cheese Gold 600 116%
Large Goat Milk Gold none 517 Goat Cheese Iridium 800 155%
Large Goat Milk Iridium none 690 Goat Cheese Gold 600 97%
Large Goat Milk Iridium none 690 Goat Cheese Iridium 800 116%
Large Goat Milk Regular Rancher 414 Goat Cheese Gold 720 174%
Large Goat Milk Regular Rancher 414 Goat Cheese Iridium 960 232%
Large Goat Milk Silver Rancher 517 Goat Cheese Gold 720 139%
Large Goat Milk Silver Rancher 517 Goat Cheese Iridium 960 186%
Large Goat Milk Gold Rancher 621 Goat Cheese Gold 720 116%
Large Goat Milk Gold Rancher 621 Goat Cheese Iridium 960 155%
Large Goat Milk Iridium Rancher 828 Goat Cheese Gold 720 87%
Large Goat Milk Iridium Rancher 828 Goat Cheese Iridium 960 116%
Large Goat Milk Regular Artisan 345 Goat Cheese Gold 840 243%
Large Goat Milk Regular Artisan 345 Goat Cheese Iridium 1120 325%
Large Goat Milk Silver Artisan 431 Goat Cheese Gold 840 195%
Large Goat Milk Silver Artisan 431 Goat Cheese Iridium 1120 260%
Large Goat Milk Gold Artisan 517 Goat Cheese Gold 840 162%
Large Goat Milk Gold Artisan 517 Goat Cheese Iridium 1120 217%
Large Goat Milk Iridium Artisan 690 Goat Cheese Gold 840 122%
Large Goat Milk Iridium Artisan 690 Goat Cheese Iridium 1120 162%
Truffle Regular none 625 Truffle Oil Regular 1065 170%
Truffle Silver none 781 Truffle Oil Regular 1065 136%
Truffle Gold none 937 Truffle Oil Regular 1065 114%
Truffle Iridium none 1250 Truffle Oil Regular 1065 85%
Truffle Regular Rancher 625 Truffle Oil Regular 1065 170%
Truffle Silver Rancher 781 Truffle Oil Regular 1065 136%
Truffle Gold Rancher 937 Truffle Oil Regular 1065 114%
Truffle Iridium Rancher 1250 Truffle Oil Regular 1065 85%
Truffle Regular Artisan 625 Truffle Oil Regular 1491 239%
Truffle Silver Artisan 781 Truffle Oil Regular 1491 191%
Truffle Gold Artisan 937 Truffle Oil Regular 1491 159%
Truffle Iridium Artisan 1250 Truffle Oil Regular 1491 119%

This data below was collected from another table and then intensely formatted with string functions so that we could then join the animal to the product it produced.

Code
animalasso <- bow("https://stardewvalleywiki.com/Animals", force = TRUE)

result <- scrape(animalasso) |>
  html_nodes(css = "table") |>
  html_table(header = TRUE, fill = TRUE)

animal_asso <- result[[14]][2]

animal_n_items <- animal_asso |>
  clean_names() |>
  mutate(animals_and_produce = strsplit(animals_and_produce, ") • ", fixed = TRUE)) |>
  unnest(animals_and_produce) |>
  filter(row_number() != 14) |>
  mutate(animal = str_extract(animals_and_produce, "^[^(]+"),
         product = str_extract(animals_and_produce, "\\(.*")) |>
  dplyr::select(animal, product) |>
  mutate(animal = str_replace(animal, " ", "_"),
         animal = str_replace(animal, " ", ""),
         animal = str_replace(animal, "_$", ""),
         product = str_replace(product, "\\(", ""),
         product = str_replace(product, "\\)", ""),
         product = strsplit(product, " • ", fixed = TRUE)) |>
  unnest(product)

full_animal_table <- animal_table |>
  left_join(animal_n_items, join_by(item == product), relationship =
  "many-to-many")

#write_csv(full_animal_table, "full_animal_table.csv")

full_animal_table |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item quality profession sell_price processed_item processed_item_quality processed_item_sell_price profit_increase animal
Egg Regular none 50 Mayonnaise Regular 190 380% Chicken
Egg Silver none 62 Mayonnaise Regular 190 306% Chicken
Egg Gold none 75 Mayonnaise Regular 190 253% Chicken
Egg Iridium none 100 Mayonnaise Regular 190 190% Chicken
Egg Regular Rancher 60 Mayonnaise Regular 228 380% Chicken
Egg Silver Rancher 75 Mayonnaise Regular 228 304% Chicken
Egg Gold Rancher 90 Mayonnaise Regular 228 253% Chicken
Egg Iridium Rancher 120 Mayonnaise Regular 228 190% Chicken
Egg Regular Artisan 50 Mayonnaise Regular 266 532% Chicken
Egg Silver Artisan 62 Mayonnaise Regular 266 429% Chicken
Egg Gold Artisan 75 Mayonnaise Regular 266 355% Chicken
Egg Iridium Artisan 100 Mayonnaise Regular 266 266% Chicken
Large Egg Regular none 95 Mayonnaise Gold 285 300% Chicken
Large Egg Silver none 118 Mayonnaise Gold 285 242% Chicken
Large Egg Gold none 142 Mayonnaise Gold 285 201% Chicken
Large Egg Iridium none 190 Mayonnaise Gold 285 150% Chicken
Large Egg Regular Rancher 114 Mayonnaise Gold 342 300% Chicken
Large Egg Silver Rancher 142 Mayonnaise Gold 342 241% Chicken
Large Egg Gold Rancher 171 Mayonnaise Gold 342 200% Chicken
Large Egg Iridium Rancher 228 Mayonnaise Gold 342 150% Chicken
Large Egg Regular Artisan 95 Mayonnaise Gold 399 420% Chicken
Large Egg Silver Artisan 118 Mayonnaise Gold 399 338% Chicken
Large Egg Gold Artisan 142 Mayonnaise Gold 399 281% Chicken
Large Egg Iridium Artisan 190 Mayonnaise Gold 399 210% Chicken
Void Egg Regular none 65 Void Mayonnaise Regular 275 423% Void_Chicken
Void Egg Silver none 81 Void Mayonnaise Regular 275 340% Void_Chicken
Void Egg Gold none 97 Void Mayonnaise Regular 275 284% Void_Chicken
Void Egg Iridium none 130 Void Mayonnaise Regular 275 212% Void_Chicken
Void Egg Regular Rancher 78 Void Mayonnaise Regular 330 423% Void_Chicken
Void Egg Silver Rancher 97 Void Mayonnaise Regular 330 340% Void_Chicken
Void Egg Gold Rancher 117 Void Mayonnaise Regular 330 282% Void_Chicken
Void Egg Iridium Rancher 156 Void Mayonnaise Regular 330 212% Void_Chicken
Void Egg Regular Artisan 65 Void Mayonnaise Regular 385 592% Void_Chicken
Void Egg Silver Artisan 81 Void Mayonnaise Regular 385 475% Void_Chicken
Void Egg Gold Artisan 97 Void Mayonnaise Regular 385 397% Void_Chicken
Void Egg Iridium Artisan 130 Void Mayonnaise Regular 385 296% Void_Chicken
Duck Egg Regular none 95 Duck Mayonnaise Regular 375 395% Duck
Duck Egg Silver none 118 Duck Mayonnaise Regular 375 318% Duck
Duck Egg Gold none 142 Duck Mayonnaise Regular 375 264% Duck
Duck Egg Iridium none 190 Duck Mayonnaise Regular 375 197% Duck
Duck Egg Regular Rancher 114 Duck Mayonnaise Regular 450 395% Duck
Duck Egg Silver Rancher 142 Duck Mayonnaise Regular 450 317% Duck
Duck Egg Gold Rancher 171 Duck Mayonnaise Regular 450 263% Duck
Duck Egg Iridium Rancher 228 Duck Mayonnaise Regular 450 197% Duck
Duck Egg Regular Artisan 95 Duck Mayonnaise Regular 525 553% Duck
Duck Egg Silver Artisan 118 Duck Mayonnaise Regular 525 445% Duck
Duck Egg Gold Artisan 142 Duck Mayonnaise Regular 525 370% Duck
Duck Egg Iridium Artisan 190 Duck Mayonnaise Regular 525 276% Duck
Wool Regular none 340 Cloth (1) Regular 470 138% Rabbit
Wool Regular none 340 Cloth (1) Regular 470 138% Sheep
Wool Silver none 425 Cloth (1) Regular 470 111% Rabbit
Wool Silver none 425 Cloth (1) Regular 470 111% Sheep
Wool Silver none 425 Cloth (2) Regular 940 221% Rabbit
Wool Silver none 425 Cloth (2) Regular 940 221% Sheep
Wool Gold none 510 Cloth (1) Regular 470 92% Rabbit
Wool Gold none 510 Cloth (1) Regular 470 92% Sheep
Wool Gold none 510 Cloth (2) Regular 940 184% Rabbit
Wool Gold none 510 Cloth (2) Regular 940 184% Sheep
Wool Iridium none 680 Cloth (2) Regular 940 138% Rabbit
Wool Iridium none 680 Cloth (2) Regular 940 138% Sheep
Wool Regular Rancher 408 Cloth (1) Regular 564 138% Rabbit
Wool Regular Rancher 408 Cloth (1) Regular 564 138% Sheep
Wool Regular Rancher 408 Cloth (2) Regular 1128 276% Rabbit
Wool Regular Rancher 408 Cloth (2) Regular 1128 276% Sheep
Wool Silver Rancher 510 Cloth (1) Regular 564 111% Rabbit
Wool Silver Rancher 510 Cloth (1) Regular 564 111% Sheep
Wool Silver Rancher 510 Cloth (2) Regular 1128 221% Rabbit
Wool Silver Rancher 510 Cloth (2) Regular 1128 221% Sheep
Wool Gold Rancher 612 Cloth (1) Regular 564 92% Rabbit
Wool Gold Rancher 612 Cloth (1) Regular 564 92% Sheep
Wool Gold Rancher 612 Cloth (2) Regular 1128 184% Rabbit
Wool Gold Rancher 612 Cloth (2) Regular 1128 184% Sheep
Wool Iridium Rancher 816 Cloth (2) Regular 1128 138% Rabbit
Wool Iridium Rancher 816 Cloth (2) Regular 1128 138% Sheep
Wool Regular Artisan 340 Cloth (1) Regular 658 194% Rabbit
Wool Regular Artisan 340 Cloth (1) Regular 658 194% Sheep
Wool Regular Artisan 340 Cloth (2) Regular 1316 387% Rabbit
Wool Regular Artisan 340 Cloth (2) Regular 1316 387% Sheep
Wool Silver Artisan 425 Cloth (1) Regular 658 155% Rabbit
Wool Silver Artisan 425 Cloth (1) Regular 658 155% Sheep
Wool Silver Artisan 425 Cloth (2) Regular 1316 310% Rabbit
Wool Silver Artisan 425 Cloth (2) Regular 1316 310% Sheep
Wool Gold Artisan 510 Cloth (1) Regular 658 129% Rabbit
Wool Gold Artisan 510 Cloth (1) Regular 658 129% Sheep
Wool Gold Artisan 510 Cloth (2) Regular 1316 258% Rabbit
Wool Gold Artisan 510 Cloth (2) Regular 1316 258% Sheep
Wool Iridium Artisan 680 Cloth (2) Regular 1316 194% Rabbit
Wool Iridium Artisan 680 Cloth (2) Regular 1316 194% Sheep
Dinosaur Egg Regular none 350 Dinosaur Mayonnaise Regular 800 229% Dinosaur
Dinosaur Egg Silver none 437 Dinosaur Mayonnaise Regular 800 183% Dinosaur
Dinosaur Egg Gold none 525 Dinosaur Mayonnaise Regular 800 152% Dinosaur
Dinosaur Egg Iridium none 700 Dinosaur Mayonnaise Regular 800 114% Dinosaur
Dinosaur Egg Regular Rancher 350 Dinosaur Mayonnaise Regular 960 274% Dinosaur
Dinosaur Egg Silver Rancher 437 Dinosaur Mayonnaise Regular 960 220% Dinosaur
Dinosaur Egg Gold Rancher 525 Dinosaur Mayonnaise Regular 960 183% Dinosaur
Dinosaur Egg Iridium Rancher 700 Dinosaur Mayonnaise Regular 960 137% Dinosaur
Dinosaur Egg Regular Artisan 350 Dinosaur Mayonnaise Regular 1120 320% Dinosaur
Dinosaur Egg Silver Artisan 437 Dinosaur Mayonnaise Regular 1120 256% Dinosaur
Dinosaur Egg Gold Artisan 525 Dinosaur Mayonnaise Regular 1120 213% Dinosaur
Dinosaur Egg Iridium Artisan 700 Dinosaur Mayonnaise Regular 1120 160% Dinosaur
Golden Egg Regular none 500 Mayonnaise (3) Gold 855 171% Golden_Chicken
Golden Egg Silver none 625 Mayonnaise (3) Gold 855 137% Golden_Chicken
Golden Egg Gold none 750 Mayonnaise (3) Gold 855 114% Golden_Chicken
Golden Egg Iridium none 1000 Mayonnaise (3) Gold 855 86% Golden_Chicken
Golden Egg Regular Rancher 600 Mayonnaise (3) Gold 1026 171% Golden_Chicken
Golden Egg Silver Rancher 750 Mayonnaise (3) Gold 1026 137% Golden_Chicken
Golden Egg Gold Rancher 900 Mayonnaise (3) Gold 1026 114% Golden_Chicken
Golden Egg Iridium Rancher 1200 Mayonnaise (3) Gold 1026 86% Golden_Chicken
Golden Egg Regular Artisan 500 Mayonnaise (3) Gold 1197 239% Golden_Chicken
Golden Egg Silver Artisan 625 Mayonnaise (3) Gold 1197 192% Golden_Chicken
Golden Egg Gold Artisan 750 Mayonnaise (3) Gold 1197 160% Golden_Chicken
Golden Egg Iridium Artisan 1000 Mayonnaise (3) Gold 1197 120% Golden_Chicken
Ostrich Egg Regular none 600 Mayonnaise (10) Regular 1900 317% Ostrich
Ostrich Egg Silver none 750 Mayonnaise (10) Silver 2370 316% Ostrich
Ostrich Egg Gold none 900 Mayonnaise (10) Gold 2850 317% Ostrich
Ostrich Egg Iridium none 1200 Mayonnaise (10) Iridium 3800 317% Ostrich
Ostrich Egg Regular Rancher 720 Mayonnaise (10) Regular 2280 317% Ostrich
Ostrich Egg Silver Rancher 900 Mayonnaise (10) Silver 2840 316% Ostrich
Ostrich Egg Gold Rancher 1080 Mayonnaise (10) Gold 3420 317% Ostrich
Ostrich Egg Iridium Rancher 1440 Mayonnaise (10) Iridium 4560 317% Ostrich
Ostrich Egg Regular Artisan 600 Mayonnaise (10) Regular 2660 443% Ostrich
Ostrich Egg Silver Artisan 750 Mayonnaise (10) Silver 3310 441% Ostrich
Ostrich Egg Gold Artisan 900 Mayonnaise (10) Gold 3990 443% Ostrich
Ostrich Egg Iridium Artisan 1200 Mayonnaise (10) Iridium 5320 443% Ostrich
Milk Regular none 125 Cheese Regular 230 184% Cow
Milk Regular none 125 Cheese Silver 287 230% Cow
Milk Regular none 125 Cheese Gold 345 276% Cow
Milk Regular none 125 Cheese Iridium 460 368% Cow
Milk Silver none 156 Cheese Regular 230 147% Cow
Milk Silver none 156 Cheese Silver 287 184% Cow
Milk Silver none 156 Cheese Gold 345 221% Cow
Milk Silver none 156 Cheese Iridium 460 295% Cow
Milk Gold none 187 Cheese Regular 230 123% Cow
Milk Gold none 187 Cheese Silver 287 153% Cow
Milk Gold none 187 Cheese Gold 345 184% Cow
Milk Gold none 187 Cheese Iridium 460 246% Cow
Milk Iridium none 250 Cheese Regular 230 92% Cow
Milk Iridium none 250 Cheese Silver 287 115% Cow
Milk Iridium none 250 Cheese Gold 345 138% Cow
Milk Iridium none 250 Cheese Iridium 460 184% Cow
Milk Regular Rancher 150 Cheese Regular 276 184% Cow
Milk Regular Rancher 150 Cheese Silver 345 230% Cow
Milk Regular Rancher 150 Cheese Gold 414 276% Cow
Milk Regular Rancher 150 Cheese Iridium 552 368% Cow
Milk Silver Rancher 187 Cheese Regular 276 148% Cow
Milk Silver Rancher 187 Cheese Silver 345 184% Cow
Milk Silver Rancher 187 Cheese Gold 414 221% Cow
Milk Silver Rancher 187 Cheese Iridium 552 295% Cow
Milk Gold Rancher 225 Cheese Regular 276 123% Cow
Milk Gold Rancher 225 Cheese Silver 345 153% Cow
Milk Gold Rancher 225 Cheese Gold 414 184% Cow
Milk Gold Rancher 225 Cheese Iridium 552 245% Cow
Milk Iridium Rancher 300 Cheese Regular 276 92% Cow
Milk Iridium Rancher 300 Cheese Silver 345 115% Cow
Milk Iridium Rancher 300 Cheese Gold 414 138% Cow
Milk Iridium Rancher 300 Cheese Iridium 552 184% Cow
Milk Regular Artisan 125 Cheese Regular 322 258% Cow
Milk Regular Artisan 125 Cheese Silver 402 322% Cow
Milk Regular Artisan 125 Cheese Gold 483 386% Cow
Milk Regular Artisan 125 Cheese Iridium 644 515% Cow
Milk Silver Artisan 156 Cheese Regular 322 206% Cow
Milk Silver Artisan 156 Cheese Silver 402 258% Cow
Milk Silver Artisan 156 Cheese Gold 483 310% Cow
Milk Silver Artisan 156 Cheese Iridium 644 413% Cow
Milk Gold Artisan 187 Cheese Regular 322 172% Cow
Milk Gold Artisan 187 Cheese Silver 402 215% Cow
Milk Gold Artisan 187 Cheese Gold 483 258% Cow
Milk Gold Artisan 187 Cheese Iridium 644 344% Cow
Milk Iridium Artisan 250 Cheese Regular 322 129% Cow
Milk Iridium Artisan 250 Cheese Silver 402 161% Cow
Milk Iridium Artisan 250 Cheese Gold 483 193% Cow
Milk Iridium Artisan 250 Cheese Iridium 644 258% Cow
Large Milk Regular none 190 Cheese Gold 345 182% Cow
Large Milk Regular none 190 Cheese Iridium 460 242% Cow
Large Milk Silver none 237 Cheese Gold 345 146% Cow
Large Milk Silver none 237 Cheese Iridium 460 194% Cow
Large Milk Gold none 285 Cheese Gold 345 121% Cow
Large Milk Gold none 285 Cheese Iridium 460 161% Cow
Large Milk Iridium none 380 Cheese Gold 345 91% Cow
Large Milk Iridium none 380 Cheese Iridium 460 121% Cow
Large Milk Regular Rancher 228 Cheese Gold 414 182% Cow
Large Milk Regular Rancher 228 Cheese Iridium 552 242% Cow
Large Milk Silver Rancher 285 Cheese Gold 414 145% Cow
Large Milk Silver Rancher 285 Cheese Iridium 552 194% Cow
Large Milk Gold Rancher 342 Cheese Gold 414 121% Cow
Large Milk Gold Rancher 342 Cheese Iridium 552 161% Cow
Large Milk Iridium Rancher 456 Cheese Gold 414 91% Cow
Large Milk Iridium Rancher 456 Cheese Iridium 552 121% Cow
Large Milk Regular Artisan 190 Cheese Gold 483 254% Cow
Large Milk Regular Artisan 190 Cheese Iridium 644 339% Cow
Large Milk Silver Artisan 237 Cheese Gold 483 204% Cow
Large Milk Silver Artisan 237 Cheese Iridium 644 272% Cow
Large Milk Gold Artisan 285 Cheese Gold 483 169% Cow
Large Milk Gold Artisan 285 Cheese Iridium 644 226% Cow
Large Milk Iridium Artisan 380 Cheese Gold 483 127% Cow
Large Milk Iridium Artisan 380 Cheese Iridium 644 169% Cow
Goat Milk Regular none 225 Goat Cheese Regular 400 178% Goat
Goat Milk Regular none 225 Goat Cheese Silver 500 222% Goat
Goat Milk Regular none 225 Goat Cheese Gold 600 267% Goat
Goat Milk Regular none 225 Goat Cheese Iridium 800 356% Goat
Goat Milk Silver none 281 Goat Cheese Regular 400 142% Goat
Goat Milk Silver none 281 Goat Cheese Silver 500 178% Goat
Goat Milk Silver none 281 Goat Cheese Gold 600 214% Goat
Goat Milk Silver none 281 Goat Cheese Iridium 800 285% Goat
Goat Milk Gold none 337 Goat Cheese Regular 400 119% Goat
Goat Milk Gold none 337 Goat Cheese Silver 500 148% Goat
Goat Milk Gold none 337 Goat Cheese Gold 600 178% Goat
Goat Milk Gold none 337 Goat Cheese Iridium 800 237% Goat
Goat Milk Iridium none 450 Goat Cheese Regular 400 89% Goat
Goat Milk Iridium none 450 Goat Cheese Silver 500 111% Goat
Goat Milk Iridium none 450 Goat Cheese Gold 600 133% Goat
Goat Milk Iridium none 450 Goat Cheese Iridium 800 178% Goat
Goat Milk Regular Rancher 270 Goat Cheese Regular 480 178% Goat
Goat Milk Regular Rancher 270 Goat Cheese Silver 600 222% Goat
Goat Milk Regular Rancher 270 Goat Cheese Gold 720 267% Goat
Goat Milk Regular Rancher 270 Goat Cheese Iridium 960 356% Goat
Goat Milk Silver Rancher 337 Goat Cheese Regular 480 142% Goat
Goat Milk Silver Rancher 337 Goat Cheese Silver 600 178% Goat
Goat Milk Silver Rancher 337 Goat Cheese Gold 720 214% Goat
Goat Milk Silver Rancher 337 Goat Cheese Iridium 960 285% Goat
Goat Milk Gold Rancher 405 Goat Cheese Regular 480 118% Goat
Goat Milk Gold Rancher 405 Goat Cheese Silver 600 148% Goat
Goat Milk Gold Rancher 405 Goat Cheese Gold 720 178% Goat
Goat Milk Gold Rancher 405 Goat Cheese Iridium 960 237% Goat
Goat Milk Iridium Rancher 540 Goat Cheese Regular 480 89% Goat
Goat Milk Iridium Rancher 540 Goat Cheese Silver 600 111% Goat
Goat Milk Iridium Rancher 540 Goat Cheese Gold 720 133% Goat
Goat Milk Iridium Rancher 540 Goat Cheese Iridium 960 178% Goat
Goat Milk Regular Artisan 225 Goat Cheese Regular 560 249% Goat
Goat Milk Regular Artisan 225 Goat Cheese Silver 700 311% Goat
Goat Milk Regular Artisan 225 Goat Cheese Gold 840 373% Goat
Goat Milk Regular Artisan 225 Goat Cheese Iridium 1120 498% Goat
Goat Milk Silver Artisan 281 Goat Cheese Regular 560 199% Goat
Goat Milk Silver Artisan 281 Goat Cheese Silver 700 249% Goat
Goat Milk Silver Artisan 281 Goat Cheese Gold 840 299% Goat
Goat Milk Silver Artisan 281 Goat Cheese Iridium 1120 399% Goat
Goat Milk Gold Artisan 337 Goat Cheese Regular 560 166% Goat
Goat Milk Gold Artisan 337 Goat Cheese Silver 700 208% Goat
Goat Milk Gold Artisan 337 Goat Cheese Gold 840 249% Goat
Goat Milk Gold Artisan 337 Goat Cheese Iridium 1120 332% Goat
Goat Milk Iridium Artisan 450 Goat Cheese Regular 560 124% Goat
Goat Milk Iridium Artisan 450 Goat Cheese Silver 700 156% Goat
Goat Milk Iridium Artisan 450 Goat Cheese Gold 840 187% Goat
Goat Milk Iridium Artisan 450 Goat Cheese Iridium 1120 249% Goat
Large Goat Milk Regular none 345 Goat Cheese Gold 600 174% Goat
Large Goat Milk Regular none 345 Goat Cheese Iridium 800 232% Goat
Large Goat Milk Silver none 431 Goat Cheese Gold 600 139% Goat
Large Goat Milk Silver none 431 Goat Cheese Iridium 800 186% Goat
Large Goat Milk Gold none 517 Goat Cheese Gold 600 116% Goat
Large Goat Milk Gold none 517 Goat Cheese Iridium 800 155% Goat
Large Goat Milk Iridium none 690 Goat Cheese Gold 600 97% Goat
Large Goat Milk Iridium none 690 Goat Cheese Iridium 800 116% Goat
Large Goat Milk Regular Rancher 414 Goat Cheese Gold 720 174% Goat
Large Goat Milk Regular Rancher 414 Goat Cheese Iridium 960 232% Goat
Large Goat Milk Silver Rancher 517 Goat Cheese Gold 720 139% Goat
Large Goat Milk Silver Rancher 517 Goat Cheese Iridium 960 186% Goat
Large Goat Milk Gold Rancher 621 Goat Cheese Gold 720 116% Goat
Large Goat Milk Gold Rancher 621 Goat Cheese Iridium 960 155% Goat
Large Goat Milk Iridium Rancher 828 Goat Cheese Gold 720 87% Goat
Large Goat Milk Iridium Rancher 828 Goat Cheese Iridium 960 116% Goat
Large Goat Milk Regular Artisan 345 Goat Cheese Gold 840 243% Goat
Large Goat Milk Regular Artisan 345 Goat Cheese Iridium 1120 325% Goat
Large Goat Milk Silver Artisan 431 Goat Cheese Gold 840 195% Goat
Large Goat Milk Silver Artisan 431 Goat Cheese Iridium 1120 260% Goat
Large Goat Milk Gold Artisan 517 Goat Cheese Gold 840 162% Goat
Large Goat Milk Gold Artisan 517 Goat Cheese Iridium 1120 217% Goat
Large Goat Milk Iridium Artisan 690 Goat Cheese Gold 840 122% Goat
Large Goat Milk Iridium Artisan 690 Goat Cheese Iridium 1120 162% Goat
Truffle Regular none 625 Truffle Oil Regular 1065 170% Pig
Truffle Silver none 781 Truffle Oil Regular 1065 136% Pig
Truffle Gold none 937 Truffle Oil Regular 1065 114% Pig
Truffle Iridium none 1250 Truffle Oil Regular 1065 85% Pig
Truffle Regular Rancher 625 Truffle Oil Regular 1065 170% Pig
Truffle Silver Rancher 781 Truffle Oil Regular 1065 136% Pig
Truffle Gold Rancher 937 Truffle Oil Regular 1065 114% Pig
Truffle Iridium Rancher 1250 Truffle Oil Regular 1065 85% Pig
Truffle Regular Artisan 625 Truffle Oil Regular 1491 239% Pig
Truffle Silver Artisan 781 Truffle Oil Regular 1491 191% Pig
Truffle Gold Artisan 937 Truffle Oil Regular 1491 159% Pig
Truffle Iridium Artisan 1250 Truffle Oil Regular 1491 119% Pig

Wrangling:

Crops

Additional wrangling had to be done because our app wouldn’t work if there were NA values, so instead of NA values for if an item wasn’t sold at a store we set the values to zero. However, we first worked with our crops dataset, we needed to join the grow times and add more information.

Code
# zero out everything with crop prices and create crop prices2
crop_prices2 <- crop_prices |>
  left_join(seed_deets, join_by(item)) |>
  mutate(profession = replace_na(profession, "none"),
         sub_category = replace_na(sub_category, "Special Crop"),
         growth_time = replace_na(growth_time, 0),
         general_store = replace_na(general_store, 0),
         jojamart = replace_na(jojamart, 0),
         oasis_price = replace_na(oasis_price, 0)) |>
  filter(!item %in% c("Qi_Fruit", "Tea_Leaves"))

#write.csv(crop_prices2, "crop_prices2.csv")

An issue we ran into was that some plants drop multiple crops when harvested so for calculating the profit we had to take that into account as well. For those specific crops we made a new data frame and specified how many crops they drop. Another issue was that some plants can regrow, so you only have to buy the seed and plant the seed once in a season so planting these early on so that they can continue produce crops throughout the season. After finally accounting for these things we are able to join our data together and ultimately create a gold per day column for each quality of crop.

Code
regrow <- as.data.frame(
  list(item = c("Ancient Fruit", "Blueberry", "Broccoli", "Cactus Fruit", "Coffee Bean",
             "Corn", "Cranberries", "Eggplant", "Grape", "Green Bean", "Hops", "Hot Pepper",
             "Pineapple", "Strawberry", "Summer Squash", "Tea Leaves", "Tomato"),
    crops_per_harvest = c(1, 3, 1, 1, 4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)))

regrow <- regrow|>
  mutate(can_regrow = "TRUE")
  
crop_prices3 <- crop_prices2 |>
  mutate(
    season = str_replace(sub_category, " Crop", ""),
    seed_price = ifelse(general_store != 0, 
                        general_store, 
                        ifelse(oasis_price != 0, oasis_price, 0)),
    seed_price = ifelse(item == "Strawberry", 100, seed_price)
  ) |>
  left_join(regrow, join_by(item)) |>
  mutate(
    crops_per_harvest = ifelse(is.na(crops_per_harvest), 1, crops_per_harvest),
    can_regrow = ifelse(is.na(can_regrow), FALSE, TRUE)
  ) |>
  mutate(
    regular_gold_per_day = round(((regular_price * crops_per_harvest) - seed_price) / growth_time, 3),
    silver_gold_per_day = round(((silver_price * crops_per_harvest) - seed_price) / growth_time, 3),
    gold_gold_per_day = round(((gold_price * crops_per_harvest) - seed_price) / growth_time, 3),
    iridium_gold_per_day = round(((iridium_price * crops_per_harvest) - seed_price) / growth_time, 3)
  )

#write.csv(crop_prices3, "final_crop_prices.csv")

crop_prices3 |>
  # kable for nice table in html
  kable() |>
    kable_styling(full_width = FALSE) |>
    scroll_box(width = "100%", height = "200px")
item regular_price silver_price gold_price iridium_price profession category sub_category growth_time general_store jojamart oasis_price season seed_price crops_per_harvest can_regrow regular_gold_per_day silver_gold_per_day gold_gold_per_day iridium_gold_per_day
Amaranth 150 187 225 300 none crop Fall Crop 7 70 87 0 Fall 70 1 FALSE 11.429 16.714 22.143 32.857
Amaranth 165 205 247 330 tiller crop Fall Crop 7 70 87 0 Fall 70 1 FALSE 13.571 19.286 25.286 37.143
Ancient_Fruit 550 687 825 1100 none crop Special Crop 28 0 0 0 Special 0 1 FALSE 19.643 24.536 29.464 39.286
Ancient_Fruit 605 755 907 1210 tiller crop Special Crop 28 0 0 0 Special 0 1 FALSE 21.607 26.964 32.393 43.214
Apple 100 125 150 200 none crop Special Crop 28 4000 0 0 Special 4000 1 FALSE -139.286 -138.393 -137.500 -135.714
Apple 110 137 165 220 tiller crop Special Crop 28 4000 0 0 Special 4000 1 FALSE -138.929 -137.964 -136.964 -135.000
Apricot 50 62 75 100 none crop Special Crop 28 2000 0 0 Special 2000 1 FALSE -69.643 -69.214 -68.750 -67.857
Apricot 55 68 82 110 tiller crop Special Crop 28 2000 0 0 Special 2000 1 FALSE -69.464 -69.000 -68.500 -67.500
Artichoke 160 200 240 320 none crop Fall Crop 8 30 0 0 Fall 30 1 FALSE 16.250 21.250 26.250 36.250
Artichoke 176 220 264 352 tiller crop Fall Crop 8 30 0 0 Fall 30 1 FALSE 18.250 23.750 29.250 40.250
Banana 150 187 225 300 none crop Special Crop 28 0 0 0 Special 0 1 FALSE 5.357 6.679 8.036 10.714
Banana 165 205 247 330 tiller crop Special Crop 28 0 0 0 Special 0 1 FALSE 5.893 7.321 8.821 11.786
Beet 100 125 150 200 none crop Fall Crop 6 0 0 20 Fall 20 1 FALSE 13.333 17.500 21.667 30.000
Beet 110 137 165 220 tiller crop Fall Crop 6 0 0 20 Fall 20 1 FALSE 15.000 19.500 24.167 33.333
Blackberry 20 25 30 40 none crop Special Crop 0 0 0 0 Special 0 1 FALSE Inf Inf Inf Inf
Blue_Jazz 50 62 75 100 none crop Spring Crop 7 30 37 0 Spring 30 1 FALSE 2.857 4.571 6.429 10.000
Blue_Jazz 55 68 82 110 tiller crop Spring Crop 7 30 37 0 Spring 30 1 FALSE 3.571 5.429 7.429 11.429
Blueberry 50 62 75 100 none crop Summer Crop 13 80 0 0 Summer 80 3 TRUE 5.385 8.154 11.154 16.923
Blueberry 55 68 82 110 tiller crop Summer Crop 13 80 0 0 Summer 80 3 TRUE 6.538 9.538 12.769 19.231
Bok_Choy 80 100 120 160 none crop Fall Crop 4 50 62 0 Fall 50 1 FALSE 7.500 12.500 17.500 27.500
Bok_Choy 88 110 132 176 tiller crop Fall Crop 4 50 62 0 Fall 50 1 FALSE 9.500 15.000 20.500 31.500
Broccoli 70 87 105 140 none crop Fall Crop 8 0 0 0 Fall 0 1 TRUE 8.750 10.875 13.125 17.500
Broccoli 77 95 115 154 tiller crop Fall Crop 8 0 0 0 Fall 0 1 TRUE 9.625 11.875 14.375 19.250
Cactus_Fruit 75 93 112 150 none crop Special Crop 12 0 0 150 Special 150 1 FALSE -6.250 -4.750 -3.167 0.000
Cactus_Fruit 82 102 123 165 none crop Special Crop 12 0 0 150 Special 150 1 FALSE -5.667 -4.000 -2.250 1.250
Carrot 35 43 52 70 none crop Spring Crop 3 0 0 0 Spring 0 1 FALSE 11.667 14.333 17.333 23.333
Carrot 38 47 57 77 tiller crop Spring Crop 3 0 0 0 Spring 0 1 FALSE 12.667 15.667 19.000 25.667
Cauliflower 175 218 262 350 none crop Spring Crop 12 80 100 0 Spring 80 1 FALSE 7.917 11.500 15.167 22.500
Cauliflower 192 239 288 385 tiller crop Spring Crop 12 80 100 0 Spring 80 1 FALSE 9.333 13.250 17.333 25.417
Cherry 80 100 120 160 none crop Special Crop 28 3400 0 0 Special 3400 1 FALSE -118.571 -117.857 -117.143 -115.714
Cherry 88 110 132 176 tiller crop Special Crop 28 3400 0 0 Special 3400 1 FALSE -118.286 -117.500 -116.714 -115.143
Corn 50 62 75 100 none crop Summer Crop 14 150 187 0 Summer 150 1 TRUE -7.143 -6.286 -5.357 -3.571
Corn 50 62 75 100 none crop Fall Crop 14 150 187 0 Fall 150 1 TRUE -7.143 -6.286 -5.357 -3.571
Corn 55 68 82 110 tiller crop Summer Crop 14 150 187 0 Summer 150 1 TRUE -6.786 -5.857 -4.857 -2.857
Corn 55 68 82 110 tiller crop Fall Crop 14 150 187 0 Fall 150 1 TRUE -6.786 -5.857 -4.857 -2.857
Cranberries 75 93 112 150 none crop Fall Crop 0 0 0 0 Fall 0 2 TRUE Inf Inf Inf Inf
Cranberries 82 102 123 165 tiller crop Fall Crop 0 0 0 0 Fall 0 2 TRUE Inf Inf Inf Inf
Crystal_Fruit 150 187 225 300 none crop Special Crop 0 0 0 0 Special 0 1 FALSE Inf Inf Inf Inf
Eggplant 60 75 90 120 none crop Fall Crop 5 20 25 0 Fall 20 1 TRUE 8.000 11.000 14.000 20.000
Eggplant 66 82 99 132 tiller crop Fall Crop 5 20 25 0 Fall 20 1 TRUE 9.200 12.400 15.800 22.400
Fairy_Rose 290 362 435 580 none crop Fall Crop 12 200 250 0 Fall 200 1 FALSE 7.500 13.500 19.583 31.667
Fairy_Rose 319 398 478 638 tiller crop Fall Crop 12 200 250 0 Fall 200 1 FALSE 9.917 16.500 23.167 36.500
Fiddlehead_Fern 90 112 135 180 none crop Special Crop 0 0 0 0 Special 0 1 FALSE Inf Inf Inf Inf
Fiddlehead_Fern 99 123 148 198 tiller crop Special Crop 0 0 0 0 Special 0 1 FALSE Inf Inf Inf Inf
Garlic 60 75 90 120 none crop Spring Crop 4 40 0 0 Spring 40 1 FALSE 5.000 8.750 12.500 20.000
Garlic 66 82 99 132 tiller crop Spring Crop 4 40 0 0 Spring 40 1 FALSE 6.500 10.500 14.750 23.000
Grape 80 100 120 160 none crop Fall Crop 10 60 75 0 Fall 60 1 TRUE 2.000 4.000 6.000 10.000
Grape 88 110 132 176 none crop Fall Crop 10 60 75 0 Fall 60 1 TRUE 2.800 5.000 7.200 11.600
Green_Bean 40 50 60 80 none crop Spring Crop 10 60 75 0 Spring 60 1 FALSE -2.000 -1.000 0.000 2.000
Green_Bean 44 55 66 88 tiller crop Spring Crop 10 60 75 0 Spring 60 1 FALSE -1.600 -0.500 0.600 2.800
Hops 25 31 37 50 none crop Summer Crop 11 60 75 0 Summer 60 1 TRUE -3.182 -2.636 -2.091 -0.909
Hops 27 34 40 55 tiller crop Summer Crop 11 60 75 0 Summer 60 1 TRUE -3.000 -2.364 -1.818 -0.455
Hot_Pepper 40 50 60 80 none crop Summer Crop 5 40 50 0 Summer 40 1 FALSE 0.000 2.000 4.000 8.000
Hot_Pepper 44 55 66 88 tiller crop Summer Crop 5 40 50 0 Summer 40 1 FALSE 0.800 3.000 5.200 9.600
Kale 110 137 165 220 none crop Spring Crop 6 70 87 0 Spring 70 1 FALSE 6.667 11.167 15.833 25.000
Kale 121 150 181 242 tiller crop Spring Crop 6 70 87 0 Spring 70 1 FALSE 8.500 13.333 18.500 28.667
Mango 130 162 195 260 none crop Special Crop 28 0 0 0 Special 0 1 FALSE 4.643 5.786 6.964 9.286
Mango 143 178 214 286 tiller crop Special Crop 28 0 0 0 Special 0 1 FALSE 5.107 6.357 7.643 10.214
Melon 250 312 375 500 none crop Summer Crop 12 80 100 0 Summer 80 1 FALSE 14.167 19.333 24.583 35.000
Melon 275 343 412 550 tiller crop Summer Crop 12 80 100 0 Summer 80 1 FALSE 16.250 21.917 27.667 39.167
Orange 100 125 150 200 none crop Special Crop 28 4000 0 0 Special 4000 1 FALSE -139.286 -138.393 -137.500 -135.714
Orange 110 137 165 220 tiller crop Special Crop 28 4000 0 0 Special 4000 1 FALSE -138.929 -137.964 -136.964 -135.000
Parsnip 35 43 52 70 none crop Spring Crop 4 20 25 0 Spring 20 1 FALSE 3.750 5.750 8.000 12.500
Parsnip 38 47 57 77 tiller crop Spring Crop 4 20 25 0 Spring 20 1 FALSE 4.500 6.750 9.250 14.250
Peach 140 175 210 280 none crop Special Crop 28 6000 0 0 Special 6000 1 FALSE -209.286 -208.036 -206.786 -204.286
Peach 154 192 231 308 tiller crop Special Crop 28 6000 0 0 Special 6000 1 FALSE -208.786 -207.429 -206.036 -203.286
Pineapple 300 375 450 600 none crop Special Crop 14 0 0 0 Special 0 1 TRUE 21.429 26.786 32.143 42.857
Pineapple 330 412 495 660 tiller crop Special Crop 14 0 0 0 Special 0 1 TRUE 23.571 29.429 35.357 47.143
Pomegranate 140 175 210 280 none crop Special Crop 28 6000 0 0 Special 6000 1 FALSE -209.286 -208.036 -206.786 -204.286
Pomegranate 154 192 231 308 tiller crop Special Crop 28 6000 0 0 Special 6000 1 FALSE -208.786 -207.429 -206.036 -203.286
Poppy 140 175 210 280 none crop Summer Crop 7 100 125 0 Summer 100 1 FALSE 5.714 10.714 15.714 25.714
Poppy 154 192 231 308 tiller crop Summer Crop 7 100 125 0 Summer 100 1 FALSE 7.714 13.143 18.714 29.714
Potato 80 100 120 160 none crop Spring Crop 6 50 62 0 Spring 50 1 FALSE 5.000 8.333 11.667 18.333
Potato 88 110 132 176 tiller crop Spring Crop 6 50 62 0 Spring 50 1 FALSE 6.333 10.000 13.667 21.000
Powdermelon 60 75 90 120 none crop Winter Crop 7 0 0 0 Winter 0 1 FALSE 8.571 10.714 12.857 17.143
Powdermelon 66 82 99 132 tiller crop Winter Crop 7 0 0 0 Winter 0 1 FALSE 9.429 11.714 14.143 18.857
Pumpkin 320 400 480 640 none crop Fall Crop 13 100 125 0 Fall 100 1 FALSE 16.923 23.077 29.231 41.538
Pumpkin 352 440 528 704 tiller crop Fall Crop 13 100 125 0 Fall 100 1 FALSE 19.385 26.154 32.923 46.462
Radish 90 112 135 180 none crop Summer Crop 6 40 50 0 Summer 40 1 FALSE 8.333 12.000 15.833 23.333
Radish 99 123 148 198 tiller crop Summer Crop 6 40 50 0 Summer 40 1 FALSE 9.833 13.833 18.000 26.333
Red_Cabbage 260 325 390 520 none crop Summer Crop 9 100 0 0 Summer 100 1 FALSE 17.778 25.000 32.222 46.667
Red_Cabbage 286 357 429 572 tiller crop Summer Crop 9 100 0 0 Summer 100 1 FALSE 20.667 28.556 36.556 52.444
Rhubarb 220 275 330 440 none crop Spring Crop 13 0 0 100 Spring 100 1 FALSE 9.231 13.462 17.692 26.154
Rhubarb 242 302 363 484 tiller crop Spring Crop 13 0 0 100 Spring 100 1 FALSE 10.923 15.538 20.231 29.538
Spice_Berry 80 100 120 160 none crop Special Crop 0 0 0 0 Special 0 1 FALSE Inf Inf Inf Inf
Starfruit 750 937 1125 1500 none crop Summer Crop 13 0 0 400 Summer 400 1 FALSE 26.923 41.308 55.769 84.615
Starfruit 825 1030 1237 1650 tiller crop Summer Crop 13 0 0 400 Summer 400 1 FALSE 32.692 48.462 64.385 96.154
Strawberry 120 150 180 240 none crop Spring Crop 8 0 0 0 Spring 100 1 TRUE 2.500 6.250 10.000 17.500
Strawberry 132 165 198 264 tiller crop Spring Crop 8 0 0 0 Spring 100 1 TRUE 4.000 8.125 12.250 20.500
Summer_Spangle 90 112 135 180 none crop Summer Crop 8 50 62 0 Summer 50 1 FALSE 5.000 7.750 10.625 16.250
Summer_Spangle 99 123 148 198 tiller crop Summer Crop 8 50 62 0 Summer 50 1 FALSE 6.125 9.125 12.250 18.500
Summer_Squash 45 56 67 90 none crop Summer Crop 6 0 0 0 Summer 0 1 FALSE 7.500 9.333 11.167 15.000
Summer_Squash 49 61 73 99 tiller crop Summer Crop 6 0 0 0 Summer 0 1 FALSE 8.167 10.167 12.167 16.500
Sunflower 80 100 120 160 none crop Summer Crop 8 200 125 0 Summer 200 1 FALSE -15.000 -12.500 -10.000 -5.000
Sunflower 80 100 120 160 none crop Fall Crop 8 200 125 0 Fall 200 1 FALSE -15.000 -12.500 -10.000 -5.000
Sunflower 88 110 132 176 tiller crop Summer Crop 8 200 125 0 Summer 200 1 FALSE -14.000 -11.250 -8.500 -3.000
Sunflower 88 110 132 176 tiller crop Fall Crop 8 200 125 0 Fall 200 1 FALSE -14.000 -11.250 -8.500 -3.000
Taro_Root 100 125 150 200 none crop Special Crop 10 0 0 0 Special 0 1 FALSE 10.000 12.500 15.000 20.000
Taro_Root 110 137 165 220 tiller crop Special Crop 10 0 0 0 Special 0 1 FALSE 11.000 13.700 16.500 22.000
Tomato 60 75 90 120 none crop Summer Crop 11 50 62 0 Summer 50 1 TRUE 0.909 2.273 3.636 6.364
Tomato 66 82 99 132 tiller crop Summer Crop 11 50 62 0 Summer 50 1 TRUE 1.455 2.909 4.455 7.455
Tulip 30 37 45 60 none crop Spring Crop 6 20 25 0 Spring 20 1 FALSE 1.667 2.833 4.167 6.667
Tulip 33 40 49 66 tiller crop Spring Crop 6 20 25 0 Spring 20 1 FALSE 2.167 3.333 4.833 7.667
Unmilled_Rice 30 37 45 60 none crop Spring Crop 8 40 0 0 Spring 40 1 FALSE -1.250 -0.375 0.625 2.500
Unmilled_Rice 33 40 49 66 tiller crop Spring Crop 8 40 0 0 Spring 40 1 FALSE -0.875 0.000 1.125 3.250
Wheat 25 31 37 50 none crop Summer Crop 4 10 12 0 Summer 10 1 FALSE 3.750 5.250 6.750 10.000
Wheat 25 31 37 50 none crop Fall Crop 4 10 12 0 Fall 10 1 FALSE 3.750 5.250 6.750 10.000
Wheat 27 34 40 55 tiller crop Summer Crop 4 10 12 0 Summer 10 1 FALSE 4.250 6.000 7.500 11.250
Wheat 27 34 40 55 tiller crop Fall Crop 4 10 12 0 Fall 10 1 FALSE 4.250 6.000 7.500 11.250
Wild_Plum 80 100 120 160 none crop Special Crop 0 0 0 0 Special 0 1 FALSE Inf Inf Inf Inf
Yam 160 200 240 320 none crop Fall Crop 10 60 75 0 Fall 60 1 FALSE 10.000 14.000 18.000 26.000
Yam 176 220 264 352 tiller crop Fall Crop 10 60 75 0 Fall 60 1 FALSE 11.600 16.000 20.400 29.200

NA Professions

Similar to the NA values for if the seed wasn’t sold at the mart, our app wouldn’t run if there were NA values for the profession, so for every category we will update the NA value with “none”

Code
final_minerals_prices <- tidy_sd_minerals_price |>
  mutate(profession = replace_na(profession, "none"))
#write_csv(final_minerals_prices, "final_minerals_prices.csv")

fish_prices <- tidy_fish_prices |>
  mutate(profession = replace_na(profession, "none"))
#write_csv(fish_prices, "fish_prices.csv")

Fish Map

Lastly, we need the data for creating our map for the locations of the fish.

Code
line_thick = 0.05
width = 1224
height = 742

# Draw a rectangle that defines the shape of map
map_int <- rbind(
  c(0, 0),
  c(0, height),
  c(width, height),
  c(width, 0),
  c(0,0)
  )

# Draw a rectangle that defines the map exterior
map_ext <- rbind(
  c(0-line_thick, 0-line_thick),
  c(0-line_thick, height + line_thick),
  c(width + line_thick, height + line_thick),
  c(width + line_thick, 0-line_thick),
  c(0-line_thick, 0-line_thick)
  )

# Define a sfg polygon object in sf by subtracting interior from exterior
map_shape <- st_polygon(list(map_ext, map_int))

# verify sfg class of polygon
#class(map_shape)

# save shapefile as rds
#saveRDS(map_shape, "projects/archived_folder/stardew_folder/stardew_data_folder/map_shape.rds")

# load the image as a raster
#img <- brick("projects/archived_folder/stardew_folder/stardew_data_folder/stardewmap.png") 

# inspect the image dimensions
#print(img)

# extract bounds(xmin, xmax, ymin, ymax)
#bounds <- extent(img)
#print(bounds)

# create image map df with center map pixel size
stardewmap_df <- data.frame(
  x = 612, 
  y = 371, 
  image = "stardewmap.png"
)

# write it in csv form 
#write_csv(stardewmap_df, "projects/archived_folder/stardew_folder/stardew_data_folder/stardewmap_df.csv")
#stardewmap_df <-read_csv("projects/archived_folder/stardew_folder/stardew_data_folder/stardewmap_df.csv")

# testing map
ggplot() +
  geom_sf(data = map_shape) +
  geom_image(data = stardewmap_df, aes(x, y, image = image), size = 1.496)

Now that we have our map, we want to specify the x and y coodinates of our location, we did this by creating a new data frame with these locations.

Code
# get data ready
xy <- data.frame(
    sub_category = c("The Beach", "River", "Night Market", "Ginger Island", "Mountain Lake", "Secret Woods", "Sewers", "Mutant Bug Lair", "Witch's Swamp", "Crab Pot", "Mines", "Cindersap Forest Pond", "Desert"),
    x = c(850, 850, 800, 1150, 900, 200, 725, 725, 210, 400, 900, 300, 20),
    y = c(120, 300, 100, 50, 550, 400, 260, 260, 305, 390, 610, 300, 710)
  )

# write in our x and y coordinates
#write_csv(xy, "projects/archived_folder/stardew_data_folder/xy.csv")
#read_csv("projects/archived_folder/stardew_data_folder/xy.csv")

fish_prices_sf <- fish_prices |>
  left_join(xy, join_by(sub_category)) |>
  filter(!is.na(x)) |>
  mutate(x = ifelse(item == "Angler", 815, x),
         y = ifelse(item == "Angler", 500, y),
         x = ifelse(item == "Ms._Angler", 815, x),
         y = ifelse(item == "Ms._Angler", 500, y),
         x = ifelse(item == "Crimson", 805, x),
         y = ifelse(item == "Crimson", 70, y),
         x = ifelse(item == "Son_of_Crimsonfish", 805, x),
         y = ifelse(item == "Son_of_Crimsonfish", 70, y),
         ) |>  
  st_as_sf(coords = c("x", "y"))

# save shapefile
#saveRDS(fish_prices_sf, "projects/archived_folder/stardew_data_folder/fish_prices_sf.rds")
#fish_prices_sf <- readRDS("data/fish_prices_sf.rds")

Finally, we have all the information needed to make our app work.

© Ziling Zhen, 2026

 

This website is built in Quarto