Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ldavies99 committed Jan 8, 2024
2 parents efb0f90 + 1e6691b commit 64d3db8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
7 changes: 4 additions & 3 deletions R/frequency-tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ summarise_coding_tools <- function(data, type = list("knowledge", "access"), pro

questions <- questions[grepl(paste0(type, "_"), questions)]

frequencies <- calculate_freqs(data, questions, levels, labels, prop = prop)
frequencies <- calculate_freqs(data, questions, levels, labels, prop = prop) %>%
dplyr::arrange(match(name, c("Python", "R", "SQL", "Matlab", "SAS", "SPSS", "Stata", "VBA")))

return(frequencies)
}
Expand Down Expand Up @@ -428,7 +429,7 @@ summarise_rap_comp <- function(data) {
"Team open source code",
"Version control",
"Peer review",
"Development QA",
"Proportionate QA",
"Documentation",
"Functions",
"Unit testing",
Expand All @@ -442,7 +443,7 @@ summarise_rap_comp <- function(data) {
"open_code_score",
"version_control_score",
"peer_review_score",
"development_QA_score",
"proportionate_QA_score",
"doc_score",
"function_score",
"unit_test_score",
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/test-summarise_coding_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ test_that("summarise_coding_tools knowledge output is as expected", {

got_knowledge <- summarise_coding_tools(dummy_data, "knowledge")

expected_knowledge <- data.frame(name = rep(c("Matlab",
"Python",
expected_knowledge <- data.frame(name = rep(c("Python",
"R",
"SQL",
"Matlab",
"SAS",
"SPSS",
"SQL",
"Stata",
"VBA"), each=3),
value = factor(rep(c("Yes", "No", "Not required for my work"), 8),
levels = c("Yes", "No", "Not required for my work")),
n = c(1/3, 2/3, 0, rep(1/3, times=21))
n = c(rep(1/3, times=9), 1/3, 2/3, 0, rep(1/3, times=12))
)

expect_equal(got_knowledge, expected_knowledge)
Expand All @@ -54,17 +54,17 @@ test_that("summarise_coding_tools access output is as expected", {

got_access <- summarise_coding_tools(dummy_data, "access")

expected_access <- data.frame(name = rep(c("Matlab",
"Python",
expected_access <- data.frame(name = rep(c("Python",
"R",
"SQL",
"Matlab",
"SAS",
"SPSS",
"SQL",
"Stata",
"VBA"), each=3),
value = factor(rep(c("Yes", "No", "Don't know"), 8),
levels = c("Yes", "No", "Don't know")),
n = c(1/3, 2/3, 0, rep(1/3, times=21))
n = c(rep(1/3, times=9), 1/3, 2/3, 0, rep(1/3, times=12))
)

expect_equal(got_access, expected_access)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-summarise_languages_by_prof.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ knowledge_response <- rep(c(
NA,
"Yes",
"No",
"Don't know"),
"Not required for my work"),
each = 3, times = 6)

prof_response <- rep(c(
Expand Down Expand Up @@ -61,12 +61,12 @@ test_that("summarise_languages_by_prof output is as expected", {
expected <- data.frame(

lang = rep(c(
"Matlab",
"Python",
"R",
"SQL",
"Matlab",
"SAS",
"SPSS",
"SQL",
"Stata",
"VBA"),
times = 9),
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-summarise_os_vs_prop.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ test_that("summarise_os_vs_prop output is as expected", {

got <- summarise_os_vs_prop(dummy_data)

expected <- data.frame(lang_type = factor(rep(c("open source", "proprietary"), each=3),
levels = c("open source", "proprietary")),
expected <- data.frame(lang_type = factor(rep(c("Open Source", "Proprietary"), each=3),
levels = c("Open Source", "Proprietary")),
year = rep(c("2020", "2021", "2022"), times=2),
Freq = rep(c(24, 28), each=3),
n = rep(32, times=6)) %>%
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-summarise_rap_comp.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dummy_data <- data.frame(
open_code_score = rep(c(NA, 1, 0), times = 5),
version_control_score = rep(c(NA, 1, 0), times = 5),
peer_review_score = rep(c(NA, 1, 0), times = 5),
development_QA_score = rep(c(NA, 1, 0), times = 5),
proportionate_QA_score = rep(c(NA, 1, 0), times = 5),
doc_score = rep(c(NA, 1, 0), times = 5),
basic_rap_score = rep(c(NA, 1, 0), times = 5),
function_score = rep(c(NA, 1, 0), times = 5),
Expand Down Expand Up @@ -48,7 +48,7 @@ test_that("summarise_rap_comp output is as expected", {
"Team open source code",
"Version control",
"Peer review",
"Development QA",
"Proportionate QA",
"Documentation",
"Functions",
"Unit testing",
Expand All @@ -62,7 +62,7 @@ test_that("summarise_rap_comp output is as expected", {
"Team open source code",
"Version control",
"Peer review",
"Development QA",
"Proportionate QA",
"Documentation",
"Functions",
"Unit testing",
Expand Down

0 comments on commit 64d3db8

Please sign in to comment.