[datatable-help] What statistical test to use for species abundance between wet and dry season?
Carl Sutton
suttoncarl at ymail.com
Sun Jan 8 16:19:49 CET 2017
Really difficult to answer since I do not know what it really is you are attempting to determine. It appears your data consists of:Long (tidy) format layout
a) species- mode character or mode factor (categorical if you want them that way). If you know how R treats factors and what functions to use for factors, then it's just a choice. If not familiar with how R treats factors then definitely character and save yourself some unwelcome surprises
b) season - same treatment as species, or perhaps better described by date??? Read the lubridate package vignette to learn how it makes working with dates simple.
c) counts-numerical
Wide data formata) each species a column each per season such as black bear- wet,turtle - dry etcb) counts filing the columns along with numerous NA
definitely an "untidy" data set but perhaps easiest to manually enter and verify?
You can always use the data.table melt function to go from wide to long format when or if you want, or use cast to go the other way.
Here is a toy example in the long format layout (I'm to lazy to type the wide one)
# critter pics
library(data.table)
library(lubridate)
species <- c("bear","chipmunk","garter_snake","cardinal")
date <- mdy(c("01-15-2016", "02-25-2016", "06-01-2016", "08-31-2016"))
counts<- c(15,20,2,50)
pics_data <- data.table(species,date,counts)
pics_data
str(pics_data)
Data printout
| species date counts
1: bear 2016-01-15 15
2: chipmunck 2016-02-25 20
3: garter_snake 2016-06-01 2
4: cardinal 2016-08-31 50
> str(pics_data)
Classes ‘data.table’ and 'data.frame': 4 obs. of 3 variables:
$ species: chr "bear" "chipmunck" "garter_snake" "cardinal"
$ date : Date, format: "2016-01-15" "2016-02-25" ...
$ counts : num 15 20 2 50
- attr(*, ".internal.selfref")=<externalptr>
|
|
|
|
| > |
|
Carl Sutton
On Saturday, January 7, 2017 8:15 PM, BondHR <Hannah.Bond at outlook.com> wrote:
Sorry if this question is trivial,
I have a collection of camera trap data of recorded species during the rainy
season and the dry season.
I am confused how to lay out a table to import to R, do I have species down
the left (then counts of how many of that species) and columns of wet season
and dry season?
Also, I am confused on what statistical test to use :(
I've read so many books and websites and every thing seems to be
contradicting each other, please can anyone help!
--
View this message in context: http://r.789695.n4.nabble.com/What-statistical-test-to-use-for-species-abundance-between-wet-and-dry-season-tp4727949.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
datatable-help at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20170108/f0aabf85/attachment.html>
More information about the datatable-help
mailing list