Page 1 of 1

Importing data into RMark

PostPosted: Wed Nov 21, 2018 5:15 pm
by ms2018
I realize it's the day before Thanksgiving but this is a bit of a hail mary for me... I am struggling to even import data into R Mark. I have my text file ready to go, and I believe it's formatted correctly, the first two rows of my text file look like this:

001001. AI1a Y Shore AI 1830 Early 2017 0 0 0 8 0 14 10 ;
111101. AI2a Y Shore AI 1830 Early 2017 0 0 0 0 0 0 0 ;

When I got import it into RMark, I run the following code:

brownbear <- import.chdata(filename="BrownRMark.txt", header=F,
field.names = c("ch", "station",
"human", "Shore_Inland", "Location", "SiteAge",
"Season", "Year",
"W1","W2","W3","W4","W5","W6","W7"),
field.types=c( "f", "f", "f",
"f","n", "f", "n",
"n","n","n","n","n","n","n"))

And I get multiple errors saying the following:
9: In import.chdata(filename = "BrownRMark.txt", header = F, field.names = c("ch", :
NAs introduced by coercion

Any suggestions on this?

Re: Importing data into RMark

PostPosted: Wed Nov 21, 2018 6:05 pm
by jlaake
Remove the semi-colon at the end. That is for MARK format but not RMark. If you can't get import.chdata to work you can use any R function to read in the data. Just make sure ch is read in as type character.