= # add variable for weeks since 100th case and 10th death cv_cases $weeks_since_case100 = cv_cases $weeks_since_death10

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

= # add variable for weeks since 100th case and 10th death cv_cases $weeks_since_case100 = cv_cases $weeks_since_death10

Post by answerhappygod »

Add Variable For Weeks Since 100th Case And 10th Death Cv Cases Weeks Since Case100 Cv Cases Weeks Since Death10 1
Add Variable For Weeks Since 100th Case And 10th Death Cv Cases Weeks Since Case100 Cv Cases Weeks Since Death10 1 (17.27 KiB) Viewed 27 times
= # add variable for weeks since 100th case and 10th death cv_cases $weeks_since_case100 = cv_cases $weeks_since_death10 = 0 for (i in 1:length(unique (cv_cases $country))) { country_name = as. character (unique(cv_cases $country country_db subset (cv_cases, country==country_name) country_db$weeks_since_case100 [country_db$cases >=100] = 0:(sum(country_db$cases >=100)-1) country_db $weeks_since_death10 [country_db$deaths>=10] = 0:(sum(country_db$deaths>=10)-1) cv_cases $weeks_since_case100 [cv_cases $country==country_name] country_db$weeks_since_case100 cv_cases $weeks_since_death10[cv_cases $country==country_name] country_db$weeks_since_death10 }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply