You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compute_coi and optimize_coi fail to run when the data is either a data frame or a tibble. They require data to be a matrix. This error is caused when our data is processed to be fed into the algorithims.
Data Frame
library(coiaf)
data_df<-data.frame(
check.names=FALSE,
row.names= c("FP0008-C","FP0009-C","FP0015-C","FP0016-C","FP0017-C"),
`Pf3D7_01_v3-93378`= c(0, 0, 0, 0, 0),
`Pf3D7_01_v3-93901`= c(0.882353, 1, 1, NA, 1),
`Pf3D7_01_v3-94422`= c(0, 0, 0.22973, 0, 0),
`Pf3D7_01_v3-94442`= c(0, 0, 0.30137, NA, 0),
`Pf3D7_01_v3-94445`= c(0, 0, 0.3375, NA, 0)
)
str(data_df)
#> 'data.frame': 5 obs. of 5 variables:#> $ Pf3D7_01_v3-93378: num 0 0 0 0 0#> $ Pf3D7_01_v3-93901: num 0.882 1 1 NA 1#> $ Pf3D7_01_v3-94422: num 0 0 0.23 0 0#> $ Pf3D7_01_v3-94442: num 0 0 0.301 NA 0#> $ Pf3D7_01_v3-94445: num 0 0 0.338 NA 0wsaf_df<-data_df[1, ]
plaf_df<- colMeans(data_df, na.rm=T)
input_df<-tibble::tibble(wsaf=wsaf_df, plaf=plaf_df) %>% tidyr::drop_na()
compute_coi(input_df, "real", coi_method="1")
#> Error: wsaf must be a non-recursive vector
Tibble
data_tb<-tibble::tibble(data_df)
str(data_tb)
#> tibble [5 × 5] (S3: tbl_df/tbl/data.frame)#> $ Pf3D7_01_v3-93378: num [1:5] 0 0 0 0 0#> $ Pf3D7_01_v3-93901: num [1:5] 0.882 1 1 NA 1#> $ Pf3D7_01_v3-94422: num [1:5] 0 0 0.23 0 0#> $ Pf3D7_01_v3-94442: num [1:5] 0 0 0.301 NA 0#> $ Pf3D7_01_v3-94445: num [1:5] 0 0 0.338 NA 0wsaf_tb<-data_tb[1, ]
plaf_tb<- colMeans(data_tb, na.rm=T)
input_tb<-tibble::tibble(wsaf=wsaf_tb, plaf=plaf_tb) %>% tidyr::drop_na()
optimize_coi(input_tb, "real", coi_method="1")
#> Error: wsaf must be a non-recursive vector
Bug Description
compute_coi
andoptimize_coi
fail to run when the data is either a data frame or a tibble. They require data to be a matrix. This error is caused when our data is processed to be fed into the algorithims.Data Frame
Tibble
Created on 2021-09-15 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: