Open tpemartin opened 2 years ago
@raychiu135, @AmyChen20021003 Please check:
@raychiu135
@linttttt
for(.x in seq_along(pickDate)){
drug$data$date[[.x+1]] <- pickDate[[.x]]
}
is the same as
# since length(pickDate) == 14823
drug$data$date[2:14824] <- pickDate[1:14823]
# Or
drug$data$date[seq_along(pickDate)+1] <- pickDate[seq_along(pickDate)]
@AmyChen20021003
stringr::str_detect
.
Exercise 5.2 Regarding the drug data from Exercise 4.8.
For each kind of drug (毒品品項), what was the average amount of drug (the mean of 數量(淨重)_克) found?
Add a column date to the data frame which is a date class created from the column 發生日期
For the following question, we only consider those 毒品品項 that contains the words “安非他命”.