1. Load datasets package. It contains several publicly available datasets. Today you will use CO2 dataset, that contain Carbon Dioxide Uptake in Grass Plants. For more information about the dataset content explore https://www.rdocumentation.org/packages/datasets/versions/3.6.2/topics/CO2.

Notice: today I will not give you advices to make understandable and nice plots, so be aware that each label and text has to be clear and completely readable (no overlaps, no partial text)!!!!

##   Plant   Type  Treatment conc uptake
## 1   Qn1 Quebec nonchilled   95   16.0
## 2   Qn1 Quebec nonchilled  175   30.4
## 3   Qn1 Quebec nonchilled  250   34.8
## 4   Qn1 Quebec nonchilled  350   37.2
## 5   Qn1 Quebec nonchilled  500   35.3
## 6   Qn1 Quebec nonchilled  675   39.2
  1. Create a barplot with errorbars representing the mean and the standard deviation of Quebec plants (Type) uptake at a concentration equal to 1000 (conc) for “chilled” and “nonchilled” groups. Visit https://r-graph-gallery.com/4-barplot-with-error-bar.html if you need guidelines to add errorbars. Choose a color for the bars that you will use in all plots regarding Quebec and color bars. Add a test to evaluate differences between chilled and nonchilled values.
##    condition     mean       sd
## 1 nonchilled 43.16667 3.061590
## 2    chilled 40.83333 1.913984

  1. Do the same as 2. but considering Missisippi plants. Again, choose a color that will represent Missisippi from here on.
##    condition     mean       sd
## 1 nonchilled 43.16667 3.061590
## 2    chilled 40.83333 1.913984

  1. Combine the two plots in a line and put labels “Quebec” and “Mississippi”

  1. Do the same as 2. but considering all values of concentration (Hint. you can use facet_wrap() or facet_grid() functions to divide concentration values in the final plot)
##     condition concentration     mean       sd
## 1  nonchilled            95 15.26667 1.446836
## 2  nonchilled           175 30.03333 2.569695
## 3  nonchilled           250 37.40000 2.762245
## 4  nonchilled           350 40.36667 2.746513
## 5  nonchilled           500 39.60000 3.897435
## 6  nonchilled           675 41.50000 2.351595
## 7  nonchilled          1000 43.16667 3.061590
## 8     chilled            95 12.86667 3.121431
## 9     chilled           175 24.13333 3.150132
## 10    chilled           250 34.46667 3.927255
## 11    chilled           350 35.80000 2.615339
## 12    chilled           500 36.66667 3.611556
## 13    chilled           675 37.50000 2.100000
## 14    chilled          1000 40.83333 1.913984

  1. Do the same as 3. but considering all values of concentration (Hint. you can use facet_wrap() or facet_grid() functions to divide concentration values in the final plot)
##     condition concentration     mean       sd
## 1  nonchilled            95 15.26667 1.446836
## 2  nonchilled           175 30.03333 2.569695
## 3  nonchilled           250 37.40000 2.762245
## 4  nonchilled           350 40.36667 2.746513
## 5  nonchilled           500 39.60000 3.897435
## 6  nonchilled           675 41.50000 2.351595
## 7  nonchilled          1000 43.16667 3.061590
## 8     chilled            95 12.86667 3.121431
## 9     chilled           175 24.13333 3.150132
## 10    chilled           250 34.46667 3.927255
## 11    chilled           350 35.80000 2.615339
## 12    chilled           500 36.66667 3.611556
## 13    chilled           675 37.50000 2.100000
## 14    chilled          1000 40.83333 1.913984

  1. Make a boxplot to compare Quebec and Missisipi uptake values. Create a grid according to concentration and Treatment. Add a t.test for each comparison and make sure the comparison is paired (check the options available in stat_compare_means()) and fill boxes according to the colors you chose for Quebec and Mississippi.

  1. Redo t.test but using t.test() function from R. Do a paired and two sides test and keep only the p value. If you need hints check https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/t.test . Are there any significant (p value < 0.05) comparisons? If yes, how many?
##     Treatment conc     t.test
## 1  nonchilled   95 0.07967374
## 2  nonchilled  175 0.05163323
## 3  nonchilled  250 0.05416344
## 4  nonchilled  350 0.03575677
## 5  nonchilled  500 0.09080086
## 6  nonchilled  675 0.05258894
## 7  nonchilled 1000 0.09932695
## 8     chilled   95 0.06347577
## 9     chilled  175 0.12838357
## 10    chilled  250 0.02846345
## 11    chilled  350 0.02832648
## 12    chilled  500 0.03435965
## 13    chilled  675 0.02573668
## 14    chilled 1000 0.02091229
## 
## FALSE  TRUE 
##     8     6
  1. Consider only the subset of the dataframe that refer to treatment “nonchilled”. Create three spider plots (see https://r-graph-gallery.com/spider-or-radar-chart.html) depicting uptake values respectively for plants Qn1 and Mn1, Qn2 and Mn2 and Qn3 and Mn3 at each concentration. In short, each plot will contain data for a couple of plants that belong to different locations and axis values will be concentration values. For each plant choose a different shade of the color associated to the location. Create a legend for each plot.

  1. Do the same as 9. but considering only chilled treatment and couples Qc1 and Mc1, Qc2 and Mc2 and Qc3 and Mc3.

  1. Make a GGally parallel coordinate plot on nonchilled (Treatment) subset of data. See https://r-charts.com/ranking/parallel-coordinates-ggplot2/?utm_content=cmp-true and https://ggobi.github.io/ggally/reference/ggparcoord.html. Each line will represent a plant, on x axis you will have concentration values and on y axis you will have uptake values. Color lines according to the location (Quebec and Mississippi) and choose the correct scale parameter value to avoid normalization.

  1. Make a GGally correlation plot (https://r-graph-gallery.com/199-correlation-matrix-with-ggally.html) on “chilled” (Treatment) subset of data. The final goal is to evaluate correlations between uptake values of each couple of plants. Try both ggpairs() and ggcorr() functions.