[R] import and export data for RMark package

Kristi Glover kristi.glover at hotmail.com
Wed Oct 22 14:55:26 CEST 2014


Dear R users,I wondering how I can import and extract the data of .txt format to the format that is compatible with RMark package for further analysis. I tried following example but did not work. Would you give any suggestions?

install.packages("RMark")library(RMark)
#Import table (inp format)  in R and Exportexample.1 <- convert.inp("http://www.montana.edu/rotella/502/deer.inp")head(example.1)
# wanted to add the variable "states" (locations)example.1$state<-ifelse(row.names(example.1) > 76, c("B"), c("A"))
# to save it in txtwrite.table(example.1, "testing.txt", row.names=F, sep = "\t")
# import the txt file data<-import.chdata("testing.txt", field.names=c("ch","freq","states"), header=FALSE)data<-data[-1,]mstrata.processed=process.data(data, model="Multistrata")# it did not work
# to export the data into inp formatexport.chdata(mstrata.processed, filename="testing")

Thanks Kristi
 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list