Skip to content

Commit

Permalink
corrections: E02
Browse files Browse the repository at this point in the history
  • Loading branch information
kkh451 committed Nov 27, 2024
1 parent cb42f97 commit 7e0c600
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions episodes/02-data-structures-and-subsetting.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,15 @@ _____(weather)
# The correct data type is: ____________.
# 4. Correct the 4th temperature data point with the mean of the two given values
weather$temp[4] <- -3.45
weather$temperature[4] <- -3.45
# print the data again to see the effect
weather
# 5. Convert the temperature to the right data type
weather$temp <- ______________(weather$temp)
weather$temperature <- ______________(weather$temperature)
# Calculate the mean to test yourself
mean(weather$temp)
mean(weather$temperature)
# If you see the correct mean value (and not NA), you did the exercise
# correctly!
Expand Down Expand Up @@ -729,8 +729,8 @@ auto-complete function: Type "`as.`" and then press the TAB key.
There are two functions that are synonymous for historic reasons:

```
weather$temp <- as.double(weather$temp)
weather$temp <- as.numeric(weather$temp)
weather$temperature <- as.double(weather$temperature)
weather$temperature <- as.numeric(weather$temperature)
```
:::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down

0 comments on commit 7e0c600

Please sign in to comment.