-
Access the data set Islands from the base package of R. Use suitable R command to find 3 largest masses and 3 smallest masses from the data set.
Solution:-
> x<-sort(islands); > len=length(x)
> x[1:3] Vancouver Hainan Prince of Wales 12 13 13 > x[len:(len-2)] Asia Africa North America 16988 11506 9390
Sort the data set and stored it in another variable. Find length of dataset and print first 3 and last 3 elements.
One Reply to “Access Data Set Islands and Find Largest and Smallest Masses”