Plotting in R

Part 1

-For the first part of this assignment, we used data from iris.csv file. - First we plot Petal Length (x) vs Petal Width (y):

plot(iris$Petal.Width ~ iris$Petal.Length, xlab = 'Petal Length', ylab = 'Petal Width')

- Next we plot the same as above for the species ‘setosa’.

iris.sub <- subset(iris, iris$Species == 'setosa')
plot(iris.sub$Petal.Width, iris.sub$Petal.Length, xlab = 'Petal Length', ylab = 'Petal Width')

- We then plot petal lenght and width with different symbols for each different species.

iris$Species2 = as.numeric(factor(iris$Species))
iris$Species2
##   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
##  [38] 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
##  [75] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
## [112] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
## [149] 3 3
plot(iris$Petal.Length, iris$Petal.Width, xlab = 'Petal Length',
     ylab = 'Petal Width', pch = iris$Species2, xlim = c(0,7), ylim = c(0.0,3.5))

- We then do the same as above but label the speices in different colors.

plot(iris$Petal.Length, iris$Petal.Width, xlab = 'Petal Length',
     ylab = 'Petal Width', pch = iris$Species2, xlim = c(0,7), ylim = c(0.0,5),
     col = c("darkgreen", "Azure", "darkorange"))

- We then plot length and width with sumbols scaled by the value of sepal width and colored by speices.

plot(iris$Petal.Length, iris$Petal.Width, xlab = 'Petal Length',
     ylab = 'Petal Width', pch = iris$Species2, xlim = c(0,7), ylim = c(0.0,5),
     col = iris$Species, cex = iris$Sepal.Width/4)

- We then plot length and width with a smoothing line.

plot(iris$Petal.Length, iris$Petal.Width, xlab = 'Petal Length',
     ylab = 'Petal Width', pch = iris$Species2, xlim = c(0,7), ylim = c(0.0,5),
     col = iris$Species, cex = iris$Sepal.Width/4)

scatter.smooth(iris$Petal.Length, iris$Petal.Width, xlab = 'Petal Length',
               ylab = 'Petal Width', pch = iris$Species2, col = iris$Species)

# Part 2 - In part of the assignment we switch data soucers over to the squid.csv dataset. -First we read in the data.

squid <- read.csv("squid.csv")

-Now we create a histogram of the GSI values.

hist(squid$GSI)

- Now we create two separate histograms of GSI values for male and female squid.

## male squid
squidM = subset(squid, Sex == "1")
hist(squidM$GSI, xlab = "GSI", main = "GSI values for Male Squid", col = "Azure")

## female squid
squidF = subset(squid, Sex == "2")
hist(squidF$GSI, xlab = "GSI", main = "GSI vlaues for Female Squid", col = "Pink")

- Now we create a boxplot showing the relationship of GSI to the sex of the squid.

logSquid <- log(squidF$GSI)
logSquid2 <- log(squidM$GSI)
logSquid
##    [1]  2.3459510489  2.2857542456  2.2757892702  2.2311642764  2.1964020169
##    [6]  2.1714166208  2.1111339884  2.0020879235  1.9762453489  1.9223782911
##   [11]  1.8544525386  1.8511598125  1.8405178869  1.8037868494  1.7646451767
##   [16]  1.7590640864  1.7539537545  1.7536594612  1.7313723192  1.7252812904
##   [21]  1.7230701231  1.7139780917  1.6697801414  1.6535122125  1.6422341868
##   [26]  1.6371503510  1.6349497016  1.6249568681  1.6216036093  1.6113760331
##   [31]  1.6043248630  1.5927392628  1.5900715899  1.5894188617  1.5847967985
##   [36]  1.5669061237  1.5657367772  1.5619479027  1.5390798237  1.5292685301
##   [41]  1.5284013777  1.5219391440  1.5157424283  1.5017858844  1.4945432015
##   [46]  1.4683120403  1.4510516083  1.4362267299  1.4346320420  1.4111333045
##   [51]  1.4025121391  1.3665762303  1.3660151203  1.3645854180  1.2781243470
##   [56]  1.1799157397  1.1410330046  1.0152669110  0.8984932928  0.8751770281
##   [61]  0.7698767134  0.5686038455  0.4633565865  0.4239596907  0.4166028525
##   [66]  0.3987761200  0.3752807769  0.3722529739  0.3625576071  0.2928188566
##   [71]  0.1200027924  0.0965820978  0.0549615581  0.0411419433  0.0392207132
##   [76]  0.0368139731  0.0281986544  0.0009995003 -0.0128826258 -0.0395727751
##   [81] -0.0651787260 -0.1353616379 -0.1745915107 -0.3061176346 -0.3073407101
##   [86] -0.3980923538 -0.4495737477 -0.4671277685 -0.4692039491 -0.4761021877
##   [91] -0.5519949008 -0.5794614162 -0.6045870036 -0.9602426194 -0.9773685814
##   [96] -0.9784321284 -1.0053952070 -1.0381759199 -1.0811653751 -1.0811653751
##  [101] -1.0930279104 -1.1187129604 -1.1657140922 -1.2086503939 -1.2454894845
##  [106] -1.2630153450 -1.2779782176 -1.2790556105 -1.2826553264 -1.3310488869
##  [111] -1.3314274597 -1.3325640387 -1.3333224764 -1.3470736480 -1.4321288975
##  [116] -1.4605869657 -1.4627435333 -1.4722880743 -1.4872202797 -1.5055284490
##  [121] -1.5141277326 -1.5145823814 -1.5182270324 -1.5241780685 -1.5278579254
##  [126] -1.5324768713 -1.5343304399 -1.5399118498 -1.5644645468 -1.5818227454
##  [131] -1.5866984255 -1.5925807954 -1.6199934264 -1.6409285795 -1.6890223918
##  [136] -1.6917331552 -1.7064996253 -1.7192527784 -1.7248487639 -1.7287846701
##  [141] -1.7637552728 -1.7831962386 -1.7933607506 -1.8078888512 -1.8201589437
##  [146] -1.8213942744 -1.8521466192 -1.8865098058 -1.8944568675 -1.8951219822
##  [151] -1.8991219876 -1.9038089730 -1.9152839555 -1.9159630727 -1.9200474895
##  [156] -1.9207298505 -1.9407236224 -1.9428149441 -1.9554555619 -1.9575779539
##  [161] -1.9625477902 -1.9668273973 -1.9675424492 -1.9718435311 -1.9812264942
##  [166] -1.9877743532 -2.0010001154 -2.0054478618 -2.0121567949 -2.0129050179
##  [171] -2.0249533564 -2.0257112193 -2.0264696569 -2.0348506584 -2.0417604747
##  [176] -2.0635681925 -2.1053749237 -2.1053749237 -2.1161055261 -2.1194305499
##  [181] -2.1277918026 -2.1396162647 -2.1464364105 -2.2072749132 -2.2358614610
##  [186] -2.2377341207 -2.2386717673 -2.2557015071 -2.2778924804 -2.2966030213
##  [191] -2.3371765378 -2.3633972324 -2.3708639337 -2.3837951484 -2.3848803357
##  [196] -2.3903240073 -2.4046178186 -2.4090573375 -2.4281483160 -2.4384048161
##  [201] -2.4829086471 -2.5108400318 -2.5108400318 -2.5219856580 -2.5269794262
##  [206] -2.5459313516 -2.5574773426 -2.5704645381 -2.5796569863 -2.6145598580
##  [211] -2.6241687171 -2.6241687171 -2.6269311498 -2.6507251345 -2.6521425692
##  [216] -2.6549834802 -2.7045563118 -2.7075503261 -2.7196168375 -2.7582914175
##  [221] -2.7630345094 -2.7870934084 -2.7919754360 -2.8100829267 -2.8234610526
##  [226] -2.8268337371 -2.8421531856 -2.8949823705 -2.9262062109 -2.9488486877
##  [231] -2.9897502019 -2.9957322736 -2.9957322736 -3.0200249661 -3.0407296395
##  [236] -3.0449225177 -3.0878475625 -3.1629681929 -3.1724694521 -3.1917471575
##  [241] -3.1941832123 -3.1990731976 -3.2754461764 -3.3186961602 -3.4451492692
##  [246] -3.6573807871 -3.7338768200  2.6810215287  2.5883202715  2.4181434336
##  [251]  2.4133032309  2.3729783169  2.3662451034  2.3639153481  2.3599101596
##  [256]  2.3444561371  2.3227601999  2.3222700663  2.3221523985  2.3203169503
##  [261]  2.3155704176  2.3141776390  2.3119213740  2.3115943872  2.3052016668
##  [266]  2.2997811657  2.2955604781  2.2939882458  2.2802167771  2.2754913500
##  [271]  2.2739386744  2.2724866452  2.2678590636  2.2441293674  2.2305948768
##  [276]  2.2275058801  2.2238989648  2.2117080722  2.2079336961  2.2078897242
##  [281]  2.2072739132  2.2007959701  2.1981019701  2.1924241850  2.1921338638
##  [286]  2.1920780232  2.1893492034  2.1872191339  2.1867476634  2.1845332712
##  [291]  2.1836889381  2.1803157589  2.1783248756  2.1753538129  2.1752970273
##  [296]  2.1748994378  2.1710288913  2.1696135436  2.1695335852  2.1675325440
##  [301]  2.1644373471  2.1591765097  2.1542590835  2.1517622033  2.1474272395
##  [306]  2.1418528018  2.1416413928  2.1398896773  2.1372150441  2.1313933692
##  [311]  2.1304791784  2.1302891117  2.1165566743  2.1159060562  2.1147724880
##  [316]  2.1092915636  2.1090124798  2.0943794140  2.0879675914  2.0830350772
##  [321]  2.0822500940  2.0803910907  2.0725428000  2.0718125145  2.0678369683
##  [326]  2.0672930466  2.0615575726  2.0598381445  2.0553665508  2.0518904726
##  [331]  2.0487761274  2.0435682198  2.0383590966  2.0303300759  2.0286744246
##  [336]  2.0230563582  2.0194128360  2.0188817615  2.0182972536  2.0164618050
##  [341]  2.0149563525  2.0129277376  2.0095420093  2.0089922530  2.0054047208
##  [346]  2.0048392166  2.0045024550  2.0033026625  2.0016961931  1.9996946236
##  [351]  1.9905966667  1.9877784531  1.9850484412  1.9838800803  1.9802839701
##  [356]  1.9733446438  1.9682585527  1.9604609142  1.9574433849  1.9498025638
##  [361]  1.9496887156  1.9489626284  1.9456101040  1.9334904862  1.9334760218
##  [366]  1.9331143451  1.9317532688  1.9306804784  1.9204018467  1.9158485061
##  [371]  1.9053708527  1.9037479712  1.9030473831  1.9014356590  1.8959392881
##  [376]  1.8945416639  1.8841259266  1.8821941467  1.8784110593  1.8713559235
##  [381]  1.8674697285  1.8632891204  1.8547499177  1.8536382063  1.8418345219
##  [386]  1.8417869628  1.8347550997  1.8333012047  1.8261125856  1.8229027760
##  [391]  1.8170372764  1.8167772322  1.8146618624  1.8130642357  1.8113333122
##  [396]  1.8074359486  1.7964816356  1.7958842838  1.7956684857  1.7941399669
##  [401]  1.7932250614  1.7798724308  1.7760195778  1.7688831229  1.7638057115
##  [406]  1.7593912242  1.7502601621  1.7475985734  1.7437764792  1.7435141566
##  [411]  1.7391846523  1.7342362830  1.7250140703  1.7184178700  1.7172693728
##  [416]  1.7155801225  1.7126080309  1.7047480922  1.7020170937  1.7018529964
##  [421]  1.6961475772  1.6951751447  1.6947712156  1.6924730614  1.6893759993
##  [426]  1.6876019334  1.6742513958  1.6735763536  1.6729947018  1.6714733034
##  [431]  1.6645698299  1.6643048139  1.6577517727  1.6567412575  1.6465410004
##  [436]  1.6334668902  1.6278474129  1.6236957842  1.6193090322  1.6167709598
##  [441]  1.6148432771  1.6082772391  1.5962513506  1.5913146742  1.5892352051
##  [446]  1.5819228204  1.5811001644  1.5764600719  1.5543902106  1.5527405688
##  [451]  1.5519782768  1.5463064010  1.5413303632  1.5378130088  1.5180898730
##  [456]  1.5133454267  1.4899784724  1.4880383450  1.4826948554  1.4810589376
##  [461]  1.4694859520  1.4604041190  1.4512390498  1.4439262740  1.4359650899
##  [466]  1.4177930282  1.4098643926  1.3971353843  1.3690973363  1.3598990498
##  [471]  1.3500711510  1.3311251440  1.3140730696  1.2777342879  1.2769258241
##  [476]  1.2659612017  1.2620624511  1.2474632354  1.2471184970  1.2464286634
##  [481]  1.2350934930  1.1378650526  1.1196559756  1.0859659936  1.0793615091
##  [486]  1.0622940260  1.0209750189  0.9354264702  0.9246556482  0.9042586357
##  [491]  0.8881792817  0.8537342452  0.8404027148  0.8379831846  0.8182367914
##  [496]  0.8111968473  0.8053591712  0.8017324910  0.7720969835  0.7540541155
##  [501]  0.7473985954  0.6506571289  0.6103089023  0.6074803538  0.5782973389
##  [506]  0.4967672665  0.3924474110  0.3627663536  0.3558546076  0.2852541274
##  [511]  0.2141431691  0.1071489155  0.0493614295  0.0289761082  0.0087615057
##  [516] -0.0080321717 -0.0085363310 -0.1097032651 -0.1920083224 -0.2954454631
##  [521] -0.3481400415 -0.4337102735 -0.4465996515 -0.5198663684 -0.5767873794
##  [526] -0.5835755441 -0.8099057412 -0.8381729526 -0.8969784208 -0.9220573268
##  [531] -0.9565920286 -0.9683738117 -1.0097775750 -1.0100521117 -1.0103267238
##  [536] -1.0139035607 -1.0353558390 -1.0738221199 -1.1047309697 -1.1773308734
##  [541] -1.1946827574 -1.2173958247 -1.2201021863 -1.2214581187 -1.2251964408
##  [546] -1.2686891190 -1.2772606001 -1.2819343458 -1.2833768271 -1.3126722212
##  [551] -1.3175148457 -1.3602368268 -1.3621872858 -1.3637503967 -1.3899008567
##  [556] -1.3983669424 -1.4085399701 -1.4196443408 -1.4317102247 -1.4396951378
##  [561] -1.4554301000 -1.4614490347 -1.4784096500 -1.4841277215 -1.5010320386
##  [566] -1.5050778971 -1.5100451686 -1.5343304399 -1.5352585143 -1.5366522427
##  [571] -1.5422466629 -1.5506974174 -1.5663784230 -1.5803646649 -1.5891452092
##  [576] -1.5930725583 -1.6004781711 -1.6174700841 -1.6429946960 -1.6617843928
##  [581] -1.6750436695 -1.6766466621 -1.6771815645 -1.6884811198 -1.6922761907
##  [586] -1.7087059141 -1.7120245012 -1.7170231231 -1.7248487639 -1.7401162361
##  [591] -1.7515776796 -1.7602608022 -1.7672619976 -1.7826015314 -1.7843867149
##  [596] -1.7969730363 -1.8084987932 -1.8140050782 -1.8152328254 -1.8275939222
##  [601] -1.8369660621 -1.8559780416 -1.8572584515 -1.8643301621 -1.9004588862
##  [606] -1.9004588862 -1.9044803393 -1.9044803393 -1.9661128564 -1.9689740887
##  [611] -1.9783300403 -1.9899665353 -1.9914306644 -1.9980459035 -2.0017400340
##  [616] -2.0032215158 -2.0604235358 -2.0955709236 -2.1202635362 -2.1286317859
##  [621] -2.1387670078 -2.1671804560 -2.1715568306 -2.1741918782 -2.1759524421
##  [626] -2.1883639489 -2.2009314393 -2.2018351899 -2.2293346313 -2.2433732334
##  [631] -2.2480969077 -2.2547477636 -2.2672179492 -2.2691503169 -2.2778924804
##  [636] -2.2788685664 -2.2876964805 -2.2876964805 -2.2916451530 -2.2936253516
##  [641] -2.2966030213 -2.3025850930 -2.3045870957 -2.3065931144 -2.3340757601
##  [646] -2.3371765378 -2.3517753372 -2.3591554445 -2.3665904230 -2.3730075573
##  [651] -2.3783868064 -2.4112845099 -2.4157537911 -2.4304184645 -2.5182566295
##  [656] -2.5207411028 -2.5232317641 -2.5332569107 -2.5395740511 -2.6535620158
##  [661] -2.6693103728 -2.6882475738 -2.7105533313 -2.7349076553 -2.7379940775
##  [666] -2.7919754360 -2.8001654900 -2.8018115809 -2.8100829267 -2.8184232586
##  [671] -2.8268337371 -2.8285243546 -2.8387285247 -2.8612013806 -2.8629511623
##  [676] -2.8770607438 -2.8895720777 -2.9132310520 -2.9957322736 -3.0747754809
##  [681] -3.0834711879 -3.0856569811 -3.1629681929 -3.1653350579 -3.2314546071
##  [686] -3.2339894627 -3.2675409968 -3.2914465177 -3.3131865043 -3.4021978820
##  [691] -3.4388992488 -3.4609473861 -3.4769990951 -3.5166082332 -3.7593019184
##  [696] -3.7986943201 -3.8076629901 -3.8728022923 -3.9954046144  2.4736350297
##  [701]  2.3798794119  2.3532496898  2.3489341849  2.3437846162  2.3418442669
##  [706]  2.2940185043  2.2896315570  2.2736916693  2.2683455532  2.2649039940
##  [711]  2.2518390173  2.2388888837  2.2331921415  2.2089664817  2.2076148554
##  [716]  2.2071419043  2.1933392615  2.1846345433  2.1842293934  2.1833510051
##  [721]  2.1631965809  2.1376043121  2.1283269394  2.1215786710  2.1075429718
##  [726]  2.1073363389  2.1055477888  2.0982755628  2.0960036300  2.0959544501
##  [731]  2.0949826506  2.0944656130  2.0892185902  2.0874965131  2.0856720914
##  [736]  2.0794415417  2.0773268072  2.0722029059  2.0679887076  2.0613412146
##  [741]  2.0597234108  2.0551616564  2.0541237337  2.0458589047  2.0401548263
##  [746]  2.0214548437  2.0210176215  2.0209513591  2.0129143778  2.0085092908
##  [751]  1.9938019506  1.9933797137  1.9872988401  1.9847599143  1.9804081895
##  [756]  1.9799250276  1.9773672870  1.9770626876  1.9703379182  1.9629498594
##  [761]  1.9593903106  1.9593480264  1.9572597833  1.9569066086  1.9546574935
##  [766]  1.9514945273  1.9498025638  1.9433210860  1.9402225769  1.9384394556
##  [771]  1.9382091437  1.9341267105  1.9290255459  1.9265088698  1.9248907818
##  [776]  1.9192434464  1.9137410859  1.9074217391  1.9071841706  1.9049542170
##  [781]  1.9001503886  1.8826508094  1.8782276432  1.8777842486  1.8734316179
##  [786]  1.8683191953  1.8553600506  1.8550472085  1.8550159189  1.8522115271
##  [791]  1.8514267702  1.8512226325  1.8476198187  1.8475410097  1.8404385161
##  [796]  1.8369399517  1.8358401485  1.8267082501  1.8211402621  1.8159316212
##  [801]  1.8155899216  1.8145967031  1.8104503677  1.8091736255  1.8085838096
##  [806]  1.8002400737  1.7899411504  1.7819784574  1.7713696696  1.7639942243
##  [811]  1.7534343549  1.7507117548  1.7497909844  1.7494085287  1.7482950978
##  [816]  1.7474243665  1.7392022185  1.7291568508  1.7221592705  1.7196187915
##  [821]  1.7174489125  1.7114889578  1.7051480123  1.6960191969  1.6957073476
##  [826]  1.6956706530  1.6861026134  1.6710032681  1.6701566475  1.6679897994
##  [831]  1.6558060984  1.6516157873  1.6496389142  1.6483316491  1.6451138889
##  [836]  1.6402386616  1.6357487272  1.6357292464  1.6356513193  1.6353395500
##  [841]  1.6277885056  1.6265506507  1.6264720050  1.6246220478  1.6237352171
##  [846]  1.5984982924  1.5700523857  1.5443659157  1.5331182656  1.5156984983
##  [851]  1.5070064363  1.4927018285  1.4906994205  1.4871572777  1.4409009106
##  [856]  1.4200917407  1.3748288830  1.3607970498  1.3589488577  1.3314685188
##  [861]  1.2643244477  1.2634767985  1.2507609658  1.1176629994  1.0635031116
##  [866]  1.0451060211  1.0395697480  1.0025051247  0.8748018484  0.8521574619
##  [871]  0.8239122504  0.7171078180  0.7083313159  0.6972387985  0.6472602978
##  [876]  0.6428008061  0.5798104952  0.5468489229  0.5293921933  0.4333396449
##  [881]  0.3873011375  0.2410620518  0.1991786739  0.1725237143  0.1177830357
##  [886]  0.0524026788 -0.0114654781 -0.0244976316 -0.0463581240 -0.0665672443
##  [891] -0.0753703070 -0.1060274046 -0.1314763628 -0.1563029944 -0.2113385059
##  [896] -0.3311464439 -0.3389753668 -0.3499830986 -0.4519279825 -0.5514740222
##  [901] -0.5878866699 -0.6009326966 -0.6670896462 -0.7352199570 -0.7582191773
##  [906] -0.7584326473 -0.7627116439 -0.7837285588 -0.7940730991 -0.7985076962
##  [911] -0.8002870561 -0.8065398679 -0.8317198304 -0.8324092479 -0.8437375392
##  [916] -0.9095634111 -0.9316582090 -0.9725965681 -0.9813627286 -0.9883239348
##  [921] -0.9966876689 -1.0208182612 -1.0213735083 -1.0526833568 -1.1080567475
##  [926] -1.1110898102 -1.1159619270 -1.1168780975 -1.1171836743 -1.1199380754
##  [931] -1.1202445888 -1.1307223426 -1.1479075804 -1.1523295712 -1.1551826402
##  [936] -1.1599559189 -1.1615520884 -1.1721511920 -1.1783050576 -1.1805818515
##  [941] -1.1887558385 -1.1989852628 -1.2113331587 -1.2150337517 -1.2194249089
##  [946] -1.2344320118 -1.2430601930 -1.2500167428 -1.2633690143 -1.2679781343
##  [951] -1.2844600552 -1.2993829891 -1.3019532127 -1.3126722212 -1.3212559649
##  [956] -1.3265171571 -1.3302921710 -1.3348410795 -1.3405564694 -1.3413209955
##  [961] -1.3486132942 -1.3513133922 -1.3692406066 -1.3747611253 -1.4003932855
##  [966] -1.4192308614 -1.4250351894 -1.4434998349 -1.4464690842 -1.4473190630
##  [971] -1.4481697648 -1.4507262213 -1.4605869657 -1.4679383502 -1.4683724722
##  [976] -1.4858937263 -1.4934342367 -1.4970024831 -1.5064301624 -1.5100451686
##  [981] -1.5549497272 -1.5793937911 -1.5906161582 -1.5950420322 -1.5950420322
##  [986] -1.6034558408 -1.6240440648 -1.6281111777 -1.6398971199 -1.6435118928
##  [991] -1.6830844526 -1.6993626200 -1.7159101569 -1.7203694731 -1.7655070981
##  [996] -1.7655070981 -1.7760829898 -1.7903604483 -1.8195418502 -1.8275939222
## [1001] -1.8300845835 -1.8313322443 -1.8319566590 -1.8319566590 -1.8363385126
## [1006] -1.8451602460 -1.8483298207 -1.8502363990 -1.8534221296 -1.8546992690
## [1011] -1.8617528410 -1.8688565196 -1.8708026766 -1.8766639763 -1.8845328694
## [1016] -1.8918008234 -1.9031380572 -1.9568699893 -1.9604148353 -1.9625477902
## [1021] -1.9661128564 -1.9668273973 -1.9754419517 -1.9885045467 -1.9951003932
## [1026] -2.0017400340 -2.0181583133 -2.0226832079 -2.0234393516 -2.0241960675
## [1031] -2.0249533564 -2.0706800360 -2.0826466726 -2.0947582458 -2.1111386284
## [1036] -2.1654352548 -2.1794828959 -2.1839135633 -2.2321266293 -2.2386717673
## [1041] -2.2985930717 -2.3187144749 -2.3268777856 -2.3708639337 -2.4001979219
## [1046] -2.4247527270 -2.4686396773 -2.5108400318 -2.5294856932 -2.5757070141
## [1051] -2.6172958378 -2.7015712350 -2.7105533313 -2.7441956477 -2.7520020886
## [1056] -2.7838519145 -2.8752861205 -2.9022419305 -2.9838037027 -3.0856569811
## [1061] -3.1033174842 -3.1212954965 -3.2114038100 -3.2213789551 -3.2339894627
## [1066] -3.3552684498 -3.3813947544 -3.7050088360 -3.7172789286  2.3624376521
## [1071]  2.3423056812  2.3301029790  2.3031249472  2.3004227568  2.2789479232
## [1076]  2.2767543330  2.2644885477  2.2591137587  2.2566353909  2.2476853030
## [1081]  2.2395174895  2.2242991746  2.2090653095  2.2002422418  2.1993223754
## [1086]  2.1938187842  2.1913294574  2.1726586234  2.1653898538  2.1551749778
## [1091]  2.1447375883  2.1198634562  2.1109280963  2.0943301542  2.0894042487
## [1096]  2.0733480138  2.0684564256  2.0601695236  2.0557250151  2.0404408043
## [1101]  2.0351369274  2.0124867704  2.0090056653  1.9989768700  1.9876551460
## [1106]  1.9847324312  1.9846087479  1.9751776467  1.9749833965  1.9584032133
## [1111]  1.9567229085  1.9543600621  1.9507697506  1.9464385808  1.9431348730
## [1116]  1.9425330244  1.9385833737  1.9276297911  1.9135640373  1.9070059572
## [1121]  1.9042395803  1.8976498445  1.8855988710  1.8760240216  1.8729399909
## [1126]  1.8660007658  1.8610367447  1.8536852050  1.8402956329  1.8272713902
## [1131]  1.8262414080  1.8184014002  1.8113333122  1.8051856007  1.7959174794
## [1136]  1.7911092579  1.7650903212  1.7648164096  1.7639770882  1.7559422908
## [1141]  1.7501906681  1.7479120694  1.7405363478  1.7345186991  1.7323455725
## [1146]  1.7269186802  1.7256730841  1.7232129267  1.7056022728  1.7000644136
## [1151]  1.6874169538  1.6818329898  1.6725253813  1.6598838479  1.6465602717
## [1156]  1.6424664164  1.6420406210  1.6366638987  1.6201997951  1.6117751789
## [1161]  1.6072755763  1.5993471717  1.5749499820  1.5675528531  1.5647124761
## [1166]  1.5117809812  1.4334164682  1.3958980973  1.3878431611  1.3709522708
## [1171]  1.3703428089  1.3436477864  1.2066292728  1.1889403815  1.1336576304
## [1176]  1.0324368730  0.6799099538  0.1071489155 -0.1362780183 -0.1862091035
## [1181] -0.2910209737 -0.5821426225 -0.5909516682 -0.7017843740 -0.7287743582
## [1186] -0.9023878267 -0.9098117658 -1.0032112039 -1.0161110672 -1.1211646931
## [1191] -1.1494846190 -1.2143598972 -1.2563192847 -1.2772606001 -1.4308734045
## [1196] -1.4422299935 -1.4858937263 -1.5041774018 -1.5478725568 -1.5592201963
## [1201] -1.5847452998 -1.7114706380 -1.7316055464 -1.7684336439 -1.7737231067
## [1206] -1.8636852088 -1.9186841628 -1.9268921432 -1.9386366651 -1.9689740887
## [1211] -1.9704077807 -1.9951003932 -2.0054478618 -2.0272286702 -2.0549440701
## [1216] -2.0557250151 -2.0683037973 -2.0874737134 -2.1037342342 -2.1362235558
## [1221] -2.2191634849 -2.2643263809 -2.2769173462 -2.3719351711 -2.4202431365
## [1226] -2.4829086471 -2.5232317641 -2.5395740511 -2.6310891600 -2.6794627443
## [1231] -2.7211354407 -2.7678002055 -2.8577109757 -2.9224818118 -3.0118616555
## [1236] -3.0704558197 -3.0747754809 -3.3552684498 -3.4802405890 -3.5335865697
## [1241] -3.6612642871 -3.9580669439
boxplot(logSquid,logSquid2)

- Important to note that 1 is male and 2 is female. - Finally we create a boxplot showing the relationship of GSI to the locations where the squid were caught.

boxplot(squid$GSI ~ squid$Location)