Maps

Author

Steffi LaZerte

Published

July 4, 2024

This script produces maps by species and by individuals for birds who moved at least 100km (travelled, see Summaries).

Setup

source("XX_setup.R")
trans <- read_csv("Data/03_Final/transitions_final.csv") |>
  left_join(read_csv("Data/03_Final/summary_birds.csv"), 
            by = c("tagDeployID", "english")) |>
  filter(travelled) |> 
  mutate(month = month(mid_date)) |>
  mutate(n = n_distinct(tagDeployID), .by = "english") |>
  arrange(desc(n))

Maps by species

Code
walk(unique(trans$speciesID), \(x) {
  t1 <- filter(trans, speciesID == x)
  g <- ggplot(t1, aes(x = lon1, y = lat1)) +
    annotation_map_tile(type = "cartolight", zoomin = 0) +
    geom_spatial_segment(
      aes(xend = lon2, yend = lat2, colour = month),
      arrow = arrow(length = unit(10, "pt"), type = "closed"), crs = 4326, na.rm = TRUE) +
    scale_colour_viridis_c(option = "inferno", 
                           begin = 0.20, end = 0.85) +
    guides(colour = guide_colourbar(reverse = TRUE)) +
    labs(title = t1$english[1], 
         subtitle = paste0("n = ", n_distinct(t1$tagDeployID), "; ", as_date(min(t1$b1)), " to ", as_date(max(t1$e2))))
  
  cat(paste0("\n\n### ", t1$english[1], "\n\n"))
  print(g)
})

Swainson’s Thrush

Ovenbird

Hermit Thrush

Song Sparrow

Yellow-rumped Warbler (Myrtle)

Chestnut-collared Longspur

Purple Finch

Tennessee Warbler

Magnolia Warbler

Red-eyed Vireo

Sprague’s Pipit

Western Meadowlark

Gray Catbird

White-throated Sparrow

Golden-crowned Sparrow

Blue-headed Vireo

Pine Siskin

Spotted Towhee

Northern Cardinal

Lazuli Bunting

Baird’s Sparrow

Black-throated Blue Warbler

Common Yellowthroat

Northern Waterthrush

Horned Lark

Maps by individual

Code
walk(unique(trans$speciesID), \(x) {
  
  cat(paste0("\n\n### ", trans$english[trans$speciesID == x][1], "\n\n"))
  
  walk(unique(trans$tagDeployID[trans$speciesID == x]), \(y) {
    t1 <- filter(trans, tagDeployID == y)
    g <- plot_map(trans, y, pad = FALSE, lowres = TRUE) + 
      labs(title = paste0(t1$english[1], " - ", t1$tagDeployID[1]),
           subtitle = paste0(min(t1$b1), " to ", max(t1$e2)))
    
    cat(paste0("\n\n#### ", t1$tagDeployID[1], "\n\n"))
    print(g)
  })
})

Swainson’s Thrush

13854

13850

14299

13844

13845

13847

13846

13852

14164

13859

14163

14162

14167

14161

18877

18916

17852

18548

19419

17854

19420

17856

18880

19412

18885

19421

19972

18894

18886

19973

18881

18897

17853

18899

19975

19410

18890

18912

18904

18902

17695

18903

19971

18900

19970

18901

18914

18910

17671

19414

17672

18913

19417

18915

18911

25876

26121

28168

29458

29547

25521

29548

30180

29549

30119

30142

33362

35290

35734

35737

35307

35740

29918

35731

35733

35732

35914

35915

36320

36319

35605

35916

36315

36317

35486

35485

36316

36995

36500

36311

36321

35911

36314

36318

36313

36994

35306

36998

36312

36993

36997

35739

42753

42755

42749

42751

41683

41826

42476

42756

42787

42474

42244

41580

41676

41673

42752

42750

42974

42970

42900

42899

42971

42902

42475

42896

43067

42973

43149

41657

41579

41700

42002

41678

41677

41682

43016

42975

43065

42898

43066

Warning: ggrepel: 4 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

42969

42972

41674

42242

41680

42001

41675

43426

42243

43427

42241

43929

Warning: ggrepel: 7 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

44111

45239

49421

Warning: ggrepel: 1 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

49420

49578

49418

49423

49422

49424

49583

Warning: ggrepel: 6 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

49585

49417

49419

49579

49779

49780

49581

49582

51086

Ovenbird

34663

35300

35301

35302

34279

34479

34473

34278

34267

34266

34269

34662

34476

34668

34658

34277

34477

34268

34671

34271

34491

34478

34490

34272

34276

35303

34672

34673

34667

34661

34480

34280

37515

39603

39593

39587

39606

39607

39571

39618

39614

39542

39570

39619

39625

39564

39613

39624

39617

39623

39584

39588

39599

39563

39546

39552

39585

39565

39119

39616

39601

39573

39560

39621

39612

39596

39605

39592

39567

39600

39569

39627

Hermit Thrush

43351

43456

43633

43634

43331

43329

43669

43333

43258

43635

43636

43330

43259

43261

43260

43516

43455

43517

44752

50714

50720

50719

50718

50626

50716

50717

51121

50944

51151

51122

51148

50930

50983

51152

50929

51147

51213

51214

51150

51238

51272

51149

51294

Song Sparrow

34484

34492

34741

34665

35295

34664

34740

34666

34656

39578

39539

39598

39568

39561

43253

39574

43000

42999

39553

42890

43250

39581

39586

39594

39611

39610

42487

39576

39595

42558

43670

43519

43721

Yellow-rumped Warbler (Myrtle)

42995

42996

42686

43346

43407

43459

43458

43409

43410

42998

43457

43249

43631

43408

43334

50935

50428

50612

50934

50939

50933

50713

50932

50941

51119

50936

50938

50984

50942

51131

50943

Chestnut-collared Longspur

40626

40623

40625

40635

40881

41188

40906

40638

40629

40475

41194

40846

40867

40894

40913

48763

40896

47954

48765

40884

47998

Purple Finch

38307

38303

38287

38297

38290

38309

38296

38289

38292

38291

38943

38951

38942

38944

38941

45370

45345

45367

45365

45363

Tennessee Warbler

19409

17845

18888

19418

18878

19407

18892

26765

26766

26771

35604

35793

36310

36502

41542

41539

41540

41578

41543

Magnolia Warbler

50234

50248

50239

50238

50249

50247

50237

50326

50244

50242

50245

50422

50327

50236

50421

50246

50723

Red-eyed Vireo

39551

39591

39572

39547

39554

39549

39555

39559

39558

39589

39556

39609

39615

39089

39620

39557

Sprague’s Pipit

41192

41197

40624

40850

41186

40636

48771

48762

48768

48758

48776

48772

48767

Western Meadowlark

40488

40712

41370

47334

47377

46158

47329

47324

47328

46532

47339

47322

Gray Catbird

26019

26120

29551

29767

29766

29572

29769

25846

29768

37506

White-throated Sparrow

34739

34474

44498

44485

44725

45603

45605

45604

44722

44723

Golden-crowned Sparrow

44345

44352

44355

44359

44350

44344

44343

44346

44358

44348

Blue-headed Vireo

50722

50919

50715

50931

50721

51123

50945

51153

Pine Siskin

4350

2661

29306

29772

29770

29074

Spotted Towhee

41242

45745

45747

Northern Cardinal

43978

43720

43779

Lazuli Bunting

35009

41371

Baird’s Sparrow

40628

40612

Black-throated Blue Warbler

37524

Common Yellowthroat

37525

Northern Waterthrush

45402

Horned Lark

47959

Back to top