Exercise_5
Calculating Correlation Between Flipper Length and Body Mass
Objective: We will calculate correlations between Flipper Length and Body Mass using Pearson, Kendall, and Spearman methods in R.
Tasks:
Load the dataset.
Calculate the correlation between Flipper Length (
flipper_length_mm
) and Body Mass (body_mass_g
) using Pearson, Kendall, and Spearman methods.Print and display the correlation coefficients for each method.
Hints:
Use
cor()
function in R with themethod
argument set to"pearson"
,"kendall"
, and"spearman"
for calculating correlations.Subset or filter the dataset to include relevant columns (
flipper_length_mm
andbody_mass_g
).