0

I have a dataset with 58,000 observations for 13 variables. This dataset is characterized by Receiver Names, Transmitter IDs, and empty columns for Latitude and Longitude that I need to fill. I have a different dataset that contains the metadata for the receiver names (i.e. contains the corresponding lat/long for each specific receiver that I need to use to fill those columns in the large dataset). I'm trying to select rows that contain the specific receiver names and fill the lat/long columns with the information from the metadata.

I tried using mutate

All_Detections %>% 
  mutate(Latitude = case_when(str_detect(Station.Name, "Honokowai Shallow") ~ "20.97426"))

to just manually input the value, which worked, but there are 15 distinct receiver names I would have to do this for (both lat and long). I'm wondering if there is a quicker way to do this? Thank you in advance for any advice

  • 3
    You’ll need to merge in the values using a left join. See this thread for how: [How to join (merge) data frames (inner, outer, left, right)](https://stackoverflow.com/questions/1299871/how-to-join-merge-data-frames-inner-outer-left-right) – zephryl Nov 09 '22 at 02:55

0 Answers0