privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
183 stars 43 forks source link

Error in xtfrm.data.frame(x) : cannot xtfrm data frames #475

Closed garyzhubc closed 4 months ago

garyzhubc commented 4 months ago

How to fix this problem?

> gwas <- big_univLogReg(ukb_x1$genotypes, 1-df[var_name], df$id, range)
Error in xtfrm.data.frame(x) : cannot xtfrm data frames
22.
stop("cannot xtfrm data frames")
21.
xtfrm.data.frame(x)
20.
xtfrm(x)
19.
as.vector(xtfrm(x))
18.
FUN(X[[i]], ...)
17.
lapply(z, function(x) if (is.object(x)) as.vector(xtfrm(x)) else x)
16.
order(x, na.last = na.last, decreasing = decreasing)
15.
`[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing))
14.
x[order(x, na.last = na.last, decreasing = decreasing)]
13.
sort.default(unique(x), na.last = TRUE)
12.
sort(unique(x), na.last = TRUE)
11.
all.equal(sort(unique(x), na.last = TRUE), 0:1)
10.
isTRUE(all.equal(sort(unique(x), na.last = TRUE), 0:1))
9.
assert_01(y01.train) at <text>#1
8.
eval(parse(text = check[i]))
7.
eval(parse(text = check[i]))
6.
eval(substitute(expr), data, enclos = parent.frame())
5.
eval(substitute(expr), data, enclos = parent.frame())
4.
with.default(args, eval(parse(text = check[i])))
3.
with(args, eval(parse(text = check[i])))
2.
check_args()
1.
big_univLogReg(ukb_x1$genotypes, 1 - df[var_name], df$id,
range)
privefl commented 4 months ago

I don't think this is an issue with my package, so it's a probably out of scope here.

I would guess that you need [[ to access one vector variable from df.