Importing data into RMark

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

Importing data into RMark

Postby ms2018 » Wed Nov 21, 2018 5:15 pm

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?
ms2018
 
Posts: 7
Joined: Sun Apr 22, 2018 6:05 pm

Re: Importing data into RMark

Postby jlaake » Wed Nov 21, 2018 6:05 pm

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.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to RMark

Who is online

Users browsing this forum: No registered users and 10 guests

cron