tpemartin / 110-1-r4ds-main

MIT License
3 stars 73 forks source link

Exercise 4.9 Run exercise 1 from Exercise section to create johnDoe. #41

Open tpemartin opened 2 years ago

tpemartin commented 2 years ago

Exercise 4.9 Run exercise 1 from Exercise section to create johnDoe. How many dead bodies were discovered after year 2012 (exclude 2012)?

raychiu135 commented 2 years ago

How should I do to solve this problem?

Error: Client error: (403) PERMISSION_DENIED Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client doesn't have permission, or the API has not been enabled for the client project. Request had insufficient authentication scopes. Run rlang::last_error() to see where the error occurred.

tpemartin commented 2 years ago

How should I do to solve this problem?

Error: Client error: (403) PERMISSION_DENIED Client does not have sufficient permission. This can happen because the OAuth token does not have the right scopes, the client doesn't have permission, or the API has not been enabled for the client project. Request had insufficient authentication scopes. Run rlang::last_error() to see where the error occurred.

@raychiu135 I updated the textbook. Please try again. If there is still problem, follow https://github.com/tpemartin/110-1-r4ds-main/issues/48 to fix the error.

raychiu135 commented 2 years ago

Thanks a lot!

raychiu135 commented 2 years ago

https://github.com/raychiu135/110-1-r4ds-main/blob/314ccf3565b59a4c44848610427731d349ffef65/exercise_4.9.rmd#L2

linttttt commented 2 years ago

https://github.com/linttttt/110-1-r4ds-main/blob/63b866865f5c68596af5a38200bd4acdb4369b3d/studyCH4(EX).Rmd#L62

32119811 commented 2 years ago

https://github.com/32119811/110-1-r4ds-main/blob/d140f3d568b677af691b43ec608731c8f2e58469/Exercise%204.9#L2

tpemartin commented 2 years ago

@linttttt, Please check:

The question excludes 101, >= should be >

yearPick <- johnDoe$data[["發現年"]] >= 101

@32119811 check

johnDoe_discovery <- johnDoe[["data"]][["發現年"]] > ("2002")
# the same as
johnDoe$data$發現年 |> as.character() > "2002"

When comparing characters, your computer system's collateral setup (collating sequence) determines the outcome.

"42" > "232"
c("74", "99" , "100", "102", "104") > "101"
johnDoe$data$發現年 |> range()
johnDoe$data$發現年 |> range(na.rm=T)
johnDoe$data$發現年 %in% 73:99 |> sum()
AmyChen20021003 commented 2 years ago

https://github.com/AmyChen20021003/110-1-r4ds-main/blob/1ed15acbf583e52352b7d7fb7ed93a585f488683/4-9.Rmd#L13

Vincent23412 commented 2 years ago

https://github.com/Vincent23412/110-1-r4ds-main/blob/22fd3b28e9ff751adbf7f00a6e7b3f37c60d14d0/20211212.Rmd#L10