Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, September 5, 2019

Codecademy Median in R 2/4


#Sample Solution
---
title: "Median in R"
output: html_notebook
---
```{r message=FALSE, warning=FALSE}
# load libraries
library(readr)
library(dplyr)

# Array of the first five author ages
five_author_ages <- c(29, 49, 42, 43, 32)

# Fill in the empty array with the values sorted
sorted_author_ages <- c(29, 32, 42, 43, 49)

# Save the median value to median_value
median_value <- 42

# Print the sorted array and median value
cat("The sorted array is:", sorted_author_ages)
cat(paste("The median of the array is: ", median_value))
```

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts