course-fish274-2019 / Emily-rockfish

0 stars 1 forks source link

How do I combine a ton of columns? #1

Open emilykschwabe opened 4 years ago

emilykschwabe commented 4 years ago

Hey everybody. My data has been downloaded to my data file in my project if anyone wants to take a look at it. I am struggling with how to manipulate my data to make graphs more easily. Columns X-BK contain information about relative fish abundance from many different species. The other columns contain information about environmental factors. I want to test how different environmental factors may change fish abundance, but I have no idea if I can combine all the columns or how to go about that. It's a lot of data and I'm not sure if it would even work to try to combine the columns in the way that I want. If anyone has suggestions send them my way. Thanks.

sr320 commented 4 years ago

I presume X-BK is "Excel language"?

For instance you might want to see how salinity impacts the abundance of all the fish taxa listed?

Here are your column names

[1] "year"                  "line"                 
 [3] "station"               "longitude"            
 [5] "latitude"              "standard.haul.factor" 
 [7] "volume.water.strained" "station.depth"        
 [9] "temp_surf"             "sal_surf"             
[11] "oxygen_surf"           "steta_surf.x"         
[13] "chla_surf"             "temp_100m"            
[15] "sal_100m"              "oxygen_100m"          
[17] "steta_surf.y"          "chla_100m"            
[19] "hard_outcrop.pavement" "mixed"                
[21] "soft_sediment"         "cca"                  
[23] "pair_no"               "auriculatus"          
[25] "aurora"                "caurinus"             
[27] "chlorostictus"         "constellatus"         
[29] "crameri"               "crocotulus"           
[31] "dalli"                 "did.not.work"         
[33] "diploproa"             "elongatus"            
[35] "ensifer"               "entomelas"            
[37] "flavidus"              "gilli"                
[39] "goodei"                "helvomaculatus"       
[41] "hopkinsi"              "jordani"              
[43] "levis"                 "macdonaldi"           
[45] "melanostomus"          "miniatus"             
[47] "moseri"                "mystinus"             
[49] "ovalis"                "paucispinis"          
[51] "phillipsi"             "rastrelliger"         
[53] "rosaceus"              "rosenblatti"          
[55] "ruberrimus"            "rubrivinctus"         
[57] "rufinanus"             "rufus"                
[59] "saxicola"              "semicinctus"          
[61] "serranoides"           "simulator"            
[63] "wilsoni"               "prop_dnw"             
sr320 commented 4 years ago

Very cool dataset! Here are some different ways to start exploring using simple plots http://htmlpreview.github.io/?https://github.com/course-fish274-2019/Emily-rockfish/blob/master/scripts/03-exploring-data.html

play around looking at relationships, do not worry about combining everything to begin with, recall you can plot all taxa on one plot... eg

ggplot(rockfish_larval_data) +
  geom_point(aes(x = oxygen_100m, y = jordani), color = "gray") +
  geom_point(aes(x = oxygen_100m, y = elongatus), color = "green", alpha = 0.5) +
  geom_point(aes(x = oxygen_100m, y = ensifer), color = "blue", alpha = 0.5) +
   geom_point(aes(x = oxygen_100m, y = flavidus), color = "pink", alpha = 0.5) +
  scale_y_log10() +
  facet_wrap(~station)

you could use mutate to create a new column where you combine abundance of all species .

sr320 commented 4 years ago

@emilykschwabe are you sure the numbers are abundance with each taxa. They are not whole numbers. for example 14.32

emilykschwabe commented 4 years ago

That helps so much thank you! You might be right, I'm not totally certain if the numbers under the taxa are abundance. I'll figure that out! Thanks!