Joint species distribution modelling of birds in California

The Question: Do four different species in California compete?

The Data:

Information about the bird species was taken from the eBird database, opened in Open Refine, and cleaned. Here the data was cut down to just observations from California from 1996-2016.


In [10]:



Error in eval(expr, envir, enclos): object 'birdDist' not found
Traceback:

In R, the seperate bird data were converted into the same format and combined into one csv file.


In [11]:
#####################################################
##
## change multiple bird script to combined bird csv
##
####################################################

#fix MOCH
mountainchickadee <-read.table("C://Users/kate.reid709/Documents/Data/mountain_chick.csv", header = TRUE, sep = ",")

head(mountainchickadee)

mountainchickadee<-setNames(mountainchickadee, c("species", "lat", "long")) #hooray it's fixed

MOCH<-na.omit(mountainchickadee)

MOCH<- unique(MOCH)

#fix Mountain bluebird MOBL

mountainbluebird <-read.table("C://Users/kate.reid709/Documents/Data/mountain_bluebird.csv", header = TRUE, sep = ",")

head(mountainbluebird)
mountainbluebird<-setNames(mountainbluebird, c("species", "lat", "long")) #hooray it's fixed

MOBL<-na.omit(mountainbluebird)

MOBL<- unique(MOBL)

#fix the Lewis's woodpecker LEWO

lewiswoodpecker <-read.table("C://Users/kate.reid709/Documents/Data/lewis_wp.csv", header = TRUE, sep = ",")

head(lewiswoodpecker)

lewiswoodpecker<-setNames(lewiswoodpecker, c("species", "lat", "long")) #hooray it's fixed

LEWO<-na.omit(lewiswoodpecker)

LEWO<- unique(LEWO)

#fix housewren data

housewren <-read.table("C://Users/kate.reid709/Documents/Data/house_wren.csv", header = TRUE, sep = ",")

head(housewren)

housewren<-setNames(housewren, c("species", "lat", "long")) #hooray it's fixed
HOWR<-na.omit(housewren)

HOWR<- unique(HOWR)

#fix black-backed woodpecker BBWO


black <-read.table("C://Users/kate.reid709/Documents/Data/black_back_wp.csv", header = TRUE, sep = ",")

head(black)

black<-setNames(black, c("species", "lat", "long")) #hooray it's fixed
BBWO<-na.omit(black)

BBWO<- unique(BBWO)

allbird<- rbind(HOWR,BBWO,LEWO,MOCH,MOBL) #rbind all cleaned scripts together

plot(allbird$long, allbird$lat) #what's the lat long plot look like?

head(allbird)

write.csv(allbird,file = "C://Users/kate.reid709/Documents/Data/allbird_combined.csv", row.names = FALSE)


COMMON_NAMELATITUDELONGITUDE
Mountain_Chickadee38.41718 -119.7492
Mountain_Chickadee38.74602 -119.7780
Mountain_Chickadee38.59111 -119.7846
Mountain_Chickadee38.69454 -119.7800
Mountain_Chickadee38.68812 -120.0670
Mountain_Chickadee38.68812 -120.0670
COMMON_NAMELATITUDELONGITUDE
Mountain_Bluebird37.68668 -121.6401
Mountain_Bluebird37.69095 -121.5934
Mountain_Bluebird37.68668 -121.6401
Mountain_Bluebird37.69401 -121.6765
Mountain_Bluebird37.69095 -121.5934
Mountain_Bluebird37.69095 -121.5934
COMMON_NAMELATITUDELONGITUDE
Lewis_Woodpecker37.55342 -121.5735
Lewis_Woodpecker37.55342 -121.5735
Lewis_Woodpecker37.55342 -121.5735
Lewis_Woodpecker37.55342 -121.5735
Lewis_Woodpecker37.55342 -121.5735
Lewis_Woodpecker37.55342 -121.5735
COMMON_NAMELATITUDELONGITUDE
House_Wren37.87163 -122.2731
House_Wren37.87163 -122.2731
House_Wren37.55342 -121.5735
House_Wren37.55342 -121.5735
House_Wren37.51590 -121.8318
House_Wren37.80043 -122.1547
COMMON_NAMELATITUDELONGITUDE
Black_backed_Woodpecker37.72492 -119.0192
Black_backed_Woodpecker37.72492 -119.0192
Black_backed_Woodpecker38.06060 -118.9246
Black_backed_Woodpecker37.88705 -118.9596
Black_backed_Woodpecker38.06060 -118.9246
Black_backed_Woodpecker37.89799 -118.9816
specieslatlong
1House_Wren37.87163 -122.2731
3House_Wren37.55342 -121.5735
5House_Wren37.51590 -121.8318
6House_Wren37.80043 -122.1547
8House_Wren37.83252 -122.2355
9House_Wren37.87402 -122.2378

Climate data was taken from World Clim, cleaned in R and the precipitation and temperture were formed into raster layers.


In [ ]:
insert code

A Raster layer for land use data was also created in R using a US gov tif image cropped for the Calfornia region.


In [ ]:
Insert code

To get the pseudoabsences


In [ ]:
insert code

Script