Learn R Programming

SEER2R (version 1.0)

SEER2R-package: read from and write to SEER*STAT export files

Description

The Surveillance, Epidemiology, and End Results (SEER) Program of the National Cancer Institute (NCI) is an authoritative source of information on cancer incidence and survival in the United States. The SEER*Stat software developed by NCI provides a convenient, intuitive mechanism for the analysis of SEER and other cancer-related databases. SEER*STAT presents results in matrix session and users can export results into data file (either in plain text format or gz format) and dictionary information into dic file. read.SeerStat reads data and dictionary information from SEER*STAT export files. write.SeerStat writes data and dictionary information to files in the formats of SEER*STAT export files

Arguments

Details

Package:
SEER2R
Type:
Package
Version:
1.0
Date:
2011-09-28
License:
LazyLoad:
yes

References

Jun Luo and Binbing Yu, 'SEER2R: An interface between SEER cancer registry data and R'

See Also

read.SeerStat, write.SeerStat

Examples

Run this code

#load testing data: there are three data objects, i.e. SEER2RTestData1,SEER2RTestData2,SEER2RTestData3 
data("SEER2RTestdata");

#create one SEER*STAT export dic and the associated text data file for testing purpose
dicinfoused = write.SeerStat(SEER2RTestData2, DICfileName = "testrun1.dic",UseVarLabelsInTxtFile=FALSE);

#usage of read.SeerStat
mydata = read.SeerStat("testrun1.dic",UseVarLabelsInData=FALSE);
#get informatin inside the dic file
DICInfo = attr(mydata, "DICInfo");

#change names of columns whose names contains strings "site" or "sex"; 
#the order of strings does not matter
testdatanewnames = attr(mydata,"assignColNames")(mydata,c("sex","site"));

#extract columns whose names contains strings "site" or "sex";
testdata = attr(mydata,"getSubDataByVarName")(mydata,c("site","sex"));

#usage of write.SeerStat
dicinfoused = write.SeerStat(mydata, DICfileName = "testrun2.dic", UseVarLabelsInTxtFile = FALSE);

Run the code above in your browser using DataLab