R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-apple-darwin9.8.0/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [R.app GUI 1.43 (5989) i386-apple-darwin9.8.0] [Workspace restored from /Users/breannawalker/.RData] [History restored from /Users/breannawalker/.Rapp.history] > setwd("/Users/breannawalker/Desktop") > Calibrated AIS<-read.table("BR_Bre_R_Data.txt") Error: unexpected symbol in "Calibrated AIS" > Calibrated_AIS<-read.table("BR_Bre_R_Data") Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'BR_Bre_R_Data': No such file or directory > Calibrated_AIS<-read.table("BR_Bre_R_Data.txt", header=T) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 2 did not have 13 elements > Calibrated_AIS<-read.table("BR_Bre_R_Data.txt") Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 2 did not have 13 elements > Calibrated_AIS<-read.table("BR_Bre_R_Calibrated_AIS_Data.txt") Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 2 did not have 13 elements > Calibrated_AIS<-read.table("BR_Bre_R_Calibrated_AIS_Data.txt") Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 1 did not have 13 elements > Calibrated_AIS<-read.delim("BR_Bre_R_Calibrated_AIS_Data.txt") > Calibrated_AIS Date TOD Waypoint Name Type Range 1 2-May 11:39 Kellett Bluff M.V.THOR IN Cargo Ship 4.81 2 2-May 11:39 Kellett Bluff CHELAN Passenger 7.91 3 2-May 11:39 Kellett Bluff Unknown Unknown 14.39 4 2-May 11:39 Kellett Bluff Unknown Unknown 14.25 5 2-May 11:39 Kellett Bluff Unknown Unknown 18.87 6 2-May 13:52 Turn Point 27.00 7 2-May 13:52 Turn Point 27.00 8 2-May 13:52 Turn Point 27.00 9 2-May 13:52 Turn Point 27.00 10 2-May 15:06 Boundary Pass 27.00 11 2-May 15:06 Boundary Pass 27.00 12 2-May 17:03 Kellett Bluff Unknown Unknown 10.15 13 2-May 17:03 Kellett Bluff NAVIOS HYP\xc9 Cargo Ship 10.06 14 2-May 17:03 Kellett Bluff Unknown Unknown 11.07 15 2-May 17:03 Kellett Bluff Unknown Unknown 10.29 16 2-May 17:03 Kellett Bluff Unknown Unknown 10.90 17 4-May 15:32 Turn Point ELM GALAXY Tanker 0.76 18 4-May 15:32 Turn Point Unknown Unknown 6.09 19 4-May 15:32 Turn Point QUEEN OF C\xc9 Passenger 5.87 20 4-May 15:32 Turn Point COASTAL CE\xc9 Passenger 6.26 21 4-May 15:32 Turn Point Unknown Unknown 6.27 22 4-May 15:32 Turn Point SPRIT OF VI Passenger 6.71 23 4-May 15:32 Turn Point Unknown Unknown 8.32 24 4-May 15:32 Turn Point SKEENA QU\xc9 Passenger 8.95 25 4-May 15:32 Turn Point ROSEMARY Cargo Ship 10.21 26 4-May 15:32 Turn Point Unknown Unknown 11.22 27 4-May 15:32 Turn Point Unknown Unknown 13.82 28 4-May 15:32 Turn Point Unknown Unknown 19.44 Calibrated_Gain_Setting_dB Contrast_Difference_dB Log_range RL_dB 1 125 13.2 0.6821451 111.8 2 125 13.2 0.8981765 111.8 3 125 13.2 1.1580608 111.8 4 125 13.2 1.1538149 111.8 5 125 13.2 1.2757719 111.8 6 125 22.7 1.4313638 102.3 7 125 22.7 1.4313638 102.3 8 125 22.7 1.4313638 102.3 9 125 22.7 1.4313638 102.3 10 125 17.1 1.4313638 107.9 11 125 17.1 1.4313638 107.9 12 125 0.0 1.0064660 125.0 13 125 0.0 1.0025980 125.0 14 125 0.0 1.0441476 125.0 15 125 0.0 1.0124154 125.0 16 125 0.0 1.0374265 125.0 17 135 9.7 -0.1191864 125.3 18 135 9.7 0.7846173 125.3 19 135 9.7 0.7686381 125.3 20 135 9.7 0.7965743 125.3 21 135 9.7 0.7972675 125.3 22 135 9.7 0.8267225 125.3 23 135 9.7 0.9201233 125.3 24 135 9.7 0.9518230 125.3 25 135 9.7 1.0090257 125.3 26 135 9.7 1.0499929 125.3 27 135 9.7 1.1405080 125.3 28 135 9.7 1.2886963 125.3 > attach(Calibrated_AIS) > names(Calibrated_AIS) [1] "Date" "TOD" [3] "Waypoint" "Name" [5] "Type" "Range" [7] "Calibrated_Gain_Setting_dB" "Contrast_Difference_dB" [9] "Log_range" "RL_dB" > boxplot(RL_dB) > #Linear Regression > model1<-lm(Waypoint~Range+TOD+Contrast_Difference_dB+RL_dB) Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : invalid to change the storage mode of a factor In addition: Warning message: In model.response(mf, "numeric") : using type="numeric" with a factor response will be ignored > model1<-(Range~RL_dB) > model1 Range ~ RL_dB > > model1<-lm(Range~RL_dB) > > model1 Call: lm(formula = Range ~ RL_dB) Coefficients: (Intercept) RL_dB 97.3821 -0.7088 > model2<-lm()