ࡱ> =?< bjbjWW 4"55rr''''4['w(   $ !J "   KRRR Z8R RR5S'%'fq0 , "@ "5 "5<  R     R        "         r : Ghement Statistical Consulting Company Ltd. 2014 Web:  HYPERLINK "http://www.ghement.ca" www.ghement.ca E-mail:  HYPERLINK "mailto:info@ghement.ca" info@ghement.ca Phone: 604-767-1250 Reading .dat files in R To read .dat files in R, you can use the function read.delim() which comes with the default R installation. The function read.delim() is related to other functions for reading data files into R, such as read.csv() or read.table(). As a consequence, read.delim() has arguments (or options) that are similar to the arguments of read.csv() or read.table(). Some of the most commonly used options for read.delim() include:  For more details on other options for read.delim(), please refer to Rs help file for this function: ?read.delim Example: The example below illustrates the use of read.delim() to read a .dat file pulled from the Internet. filename <- "http://www.nilu.no/projects/ccc/onlinedata/ozone/CZ03_2009.dat" data <- read.delim(filename, header = TRUE, sep="", skip=2, as.is=TRUE) head(data) If the .dat file in this example were stored in our R working directory, we would read it in R and then view it using the commands below: data <- read.delim("CZ03_2009.dat", header = TRUE, sep="", skip=2, as.is=TRUE) View(data) header = TRUE (if the .dat file includes a first row which lists the variable names) sep = "" (if the data columns present in the .dat file are separated by white spaces) OR sep = "," (if the data columns present in the .dat file are separated by commas) OR sep = "/t" (if the data columns present in the .dat file are separated by tabs) skip = 2 (if the first 2 rows of the .dat file include comments and must be ignored by R) as.is = TRUE (to prevent R from automatically converting character variables, such as date variables or ID variables, into factors) na.strings = "NA" (if missing values are coded as NA in the .dat file, where NA stands for Not Available) OR na.strings = "" (if missing values are coded as blank cells in the .dat file) 389\]klvw    W c d 毜zr`rU`Ur`Ur`r`r`hKhKOJQJ#hKhK5CJOJQJ^JaJhKOJQJh*Qh*QCJOJQJaJ%hKhB*CJOJQJaJph%hKhOLB*CJOJQJaJph%h*QhOLB*CJOJQJaJph h*QhOL0JCJOJQJaJ%jh*QhOLCJOJQJUaJh*QhOLCJOJQJaJh*QhOLOJQJ!3J C  gdKgdsje$a$gdK $a$gd*Q$a$gdOL$&dPa$gdOL % / 3 ?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ph0hsjehsje5B*CJOJPJQJ^JaJphhsjehsjeB*OJQJphgd*Q^gdsje21h:p*Q/ =!"#$% j 666666666vvvvvvvvv666666>6666666666666666666666666666666666666666666666666hH6666666666666666666666666666666666666666666666666666666666666666662 0@P`p2( 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p 0@P`p8XV~ OJPJQJ_HmH nH sH tH J`J I.#Normal dCJ_HaJmH sH tH DA`D Default Paragraph FontRiR 0 Table Normal4 l4a (k ( 0No List 6U@6 OL0 Hyperlink >*B*phRR sje0 Balloon Text dCJOJQJ^JaJR/R sje0Balloon Text CharCJOJQJ^JaJtH PK![Content_Types].xmlj0Eжr(΢Iw},-j4 wP-t#bΙ{UTU^hd}㨫)*1P' ^W0)T9<l#$yi};~@(Hu* Dנz/0ǰ $ X3aZ,D0j~3߶b~i>3\`?/[G\!-Rk.sԻ..a濭?PK!֧6 _rels/.relsj0 }Q%v/C/}(h"O = C?hv=Ʌ%[xp{۵_Pѣ<1H0ORBdJE4b$q_6LR7`0̞O,En7Lib/SeеPK!kytheme/theme/themeManager.xml M @}w7c(EbˮCAǠҟ7՛K Y, e.|,H,lxɴIsQ}#Ր ֵ+!,^$j=GW)E+& 8PK!`theme/theme/theme1.xmlYOoE#F{oc'vGuرhR-q;ޝfvg53NjHH8PTj%.H ]k9o7 !)O^rC$y@/yH*񄴽)޵߻UDb`"qۋJחX^)I٘+*¥@#Zmu)4Pc{ቒzgb ppP9]&!fmthH)1,L1Lg?|z|d9qw}|틇_Veۏ@蟙9ϿzϿV7Cn#cpDŵv #L;6Pk-{*r7eq7Gc E+4߈b9pQZW)IV+2n*]8MR`μ,ǻqc8Q8$ QH?TxwR'\Bw(`Z!94۴Mc˴gȷۨY[EBW`Va0'DJǬ*#Sq= !aϴH@YieE Ed`-~ЍpVa4(F{\Uw!;' }'ݧ-:& D?(^'ܩ11TpuL"nF#n)d]A^5Jز?Mϲs/?lvx Rma0`d_nBX/ʁ 6:+kP o Z2_]Zѱ_3*E ЈM>R*}ahG.9gMW~'fpv4; !6o%JۍswŴR.+<+΀/FS*BiDpT PTz/ȡanjHP8T$Z2wzvvY,d*dL#rHPs>=A6hN֟=Qr9LV638h&T-;ƬFtEyZƚxY(HH>#:~ l/i#-&-ʆ6t'B`kΒs\uN/^d;k C =٢4o2&1GY|t?L*a>֍PK! ѐ'theme/theme/_rels/themeManager.xml.relsM 0wooӺ&݈Э5 6?$Q ,.aic21h:qm@RN;d`o7gK(M&$R(.1r'JЊT8V"AȻHu}|$b{P8g/]QAsم(#L[PK-![Content_Types].xmlPK-!֧6 +_rels/.relsPK-!kytheme/theme/themeManager.xmlPK-!`theme/theme/theme1.xmlPK-! ѐ' theme/theme/_rels/themeManager.xml.relsPK] " L [ P   8\kvXX8@(  h  3 3"` B S  ?8$MtWa3=nx5?MP!14wz0:mpWbny5@rz 3333333333333,23 Bt!6h^`OJQJo(hHh^`OJ QJ ^J o(hHohp^p`OJ QJ o(hHh@ ^@ `OJQJo(hHh^`OJ QJ ^J o(hHoh^`OJ QJ o(hHh^`OJQJo(hHh^`OJ QJ ^J o(hHohP^P`OJ QJ o(hHB          9I.#X(%OLsje1u*QK@XHp@Unknown G*Ax Times New Roman5Symbol3. *Cx ArialQ. Franklin Gothic DemiQ. Franklin Gothic BookI5  &(DejaVu Sans MonoI. ??Arial Unicode MS7.@Calibri5. .[`)Tahoma?= *Cx Courier New;WingdingsA$BCambria Math"qhgC"ǜC"1= /!202QHX $P90! xxIsabellaIsabella Oh+'0  px   IsabellaNormal Isabella3Microsoft Office Word@f`@r-%@%=՜.+,D՜.+,@ hp  Hewlett-Packard Company   Title 8@ _PID_HLINKSA ; mailto:info@ghement.ca tthttp://www.ghement.ca/   !"#$%&'()*+-./012356789:;>Root Entry FW'%@Data 1Table"WordDocument4"SummaryInformation(,DocumentSummaryInformation84CompObjy  F'Microsoft Office Word 97-2003 Document MSWordDocWord.Document.89q