What does this Rcode do in detail: LICtemplatev2 <- LICtemplate %>%…
- User
What does this Rcode do in detail: LIC_template_v2 <- LIC_template %>% left_join(FC_adjustment,by=c(“GIC” = “GROUP_NAME”)) %>% group_by(GIC) %>% mutate( year_sum_inv = sum(Investment Component), year_sum_non_inv = sum(Non-InvC part of Claims), year_split_inv = Investment Component/year_sum_inv, year_split_non_inv = Non-InvC part of Claims/year_sum_non_inv, Investment Component = Investment Component + year_split_inv * Inv_comp_inkl_est, Non-InvC part of Claims = Non-InvC part of Claims + year_split_non_inv * non_Inv_comp_inkl_est ) %>% select(-Inv_comp,-Inv_comp_inkl_est,-non_Inv_comp,-non_Inv_comp_inkl_est,-year_sum_inv,-year_sum_non_inv,-year_split_inv,-year_split_non_inv)
- Assistant
- User
I want to compare the sum of the row Investment component from the original file (LIC_template) with the sum of that row in the new file (LIC_template_v2) how do i do that
- Assistant
To compare the sum of the "Investment Component" column from the original
LIC_templatedata frame with the sum in the updatedLIC_template_v2data frame, you can calculate the sums from both data frames and then compare them. Here's how you can do it step-by-step in R:-
Calculate the Sum for the Original Data Frame:
original_sum_inv_component <- sum(LIC_template$`Investment Component`, na.rm = TRUE)
-