Skip to content

Conversation

@richelbilderbeek
Copy link

Hi @leeshawn,

Here is my fix for #11, which consists of a new .rda file, that has column names for the covariates. As I got no reply from you what the column names were (which is fine :-) ), I picked something appropriate myself.

FYI, below is the code how I changed SKAT.example.rda to have a tibble with column names.

Thanks and cheers, Richel

# Fixes https://github.com/leeshawn/SKAT/issues/11
library(SKAT)
data(SKAT.example)

# Confirm that there are no names in old 'SKAT.example.rda' version
testthat::expect_true(is.null(names(SKAT.example$X)))

# Add named
t_covariates <- tibble::as_tibble(SKAT.example$X, .name_repair = "minimal")
names(t_covariates) <- c("is_male", "relative_height")
SKAT.example$X <- t_covariates

# Confirm the Issue is fixed
testthat::expect_true(is.null(names(SKAT.example$X)))
save(SKAT.example, file = "data/SKAT.example.rda")

# Confirm that there are names in new 'SKAT.example.rda' version
# Must reload package!
data(SKAT.example)
testthat::expect_false(is.null(names(SKAT.example$X)))
testthat::expect_equal(
  names(SKAT.example$X), 
  c("is_male", "relative_height")
)

@richelbilderbeek richelbilderbeek changed the title Coviates table (i.e. SKAT.example$X) has names. Fix #11 Covariates table (i.e. SKAT.example$X) has names. Fix #11 Jun 15, 2021
@richelbilderbeek
Copy link
Author

@leeshawn and @ZhangchenZhao : what is the status in processing this Pull Request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant