-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event table update #45
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @guangguangzai, thank you for moving this forward! A lot of work has been done. Please take a look at the following 19 comments before our meeting and get the east ones fixed. Then we could focus on the more challenging comments when we meet this week.
@@ -0,0 +1,64 @@ | |||
#' generate event table in common control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the file name to the function name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to generate_event_table_cc
@@ -0,0 +1,64 @@ | |||
#' generate event table in common control | |||
#' | |||
#' @param input_data input data in common control situation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be more specific of input_data
and hypothesis
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
#' @param input_data input data in common control situation | ||
#' @param hypothesis comparison group | ||
#' | ||
#' @return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
#' @examples | ||
#' input_data <- data.frame( | ||
#' Population = c("Experimental 1", "Experimental 2", "Experimental 3", "Control"), | ||
#' IA = c(70, 75, 80, 85), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining what the physical meaning of 70, 75, 80, and 85.
#' ) | ||
#' | ||
#' result_table <- generate_event_table_cc(input_data, hypothesis) | ||
#' sorted_data <- result_table[order(result_table$analysis), ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the output of generate_event_table_cc
is sorted. Could you please check if there is a specific reason why the sorted_data
is required in the example?
#' # Generate event table using the updated function | ||
#' result_table <- generate_event_table(input_data, hypothesis, type = "common_control") | ||
#' | ||
#' # Sort the result table by analysis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echo with my previous comment: could you please check if the sort required?
#' # ------------------------ Example of overall population | ||
#' input_data <- data.frame( | ||
#' Population = c("Population 1", "Population 2", "Population 1 Intersection 2", "Overall population"), | ||
#' IA = c(100, 110, 80, 225), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining the physical meaning of 100, 110, 80, 225.
#' # Generate event table using the updated function | ||
#' result_table <- generate_event_table(input_data, hypothesis, type = "overlap_population") | ||
#' | ||
#' # Sort the result table by analysis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echo with my previous comment: could you please check if the sort required?
} else if (type == "overlap_population") { | ||
result_df <- generate_event_table_ol(input_data, hypothesis) # see generate_event_ol_addhypo.R | ||
} | ||
result_df <- result_df[!duplicated(result_df), ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the output is already sorted in generate_event_table_cc
and generate_event_table_ol
. Is the line 71-73 may duplicated?
Added 3 functions of generate event tables; added 2 tests.