[R] how to import and export data in RMark package

Kristi Glover kristi.glover at hotmail.com
Wed Oct 22 17:36:15 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 . I tried following script to import and export. Importing was OK but did not work for exporting. Would you give any suggestions?

install.packages("RMark")library(RMark)# example 

#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