-
Notifications
You must be signed in to change notification settings - Fork 176
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
[BUG]: format_data() Error: j(在 [...] 中的第二个参数)是单一符号,但未找到列名 'i' #493
Comments
Surely when I want to user format_dat, I check my data for manys time, but the error repeatly occurs. Finally I read the source codes, It seems that the variant "i" is not state properly. Please fix it if you have time, thanks! |
Have you resolved the issue? I have met the same problem, it would be appreciated if there is any suggestion! |
Editing the function TwoSampleMR::data.table(), instead "dat <- dat[, i]" with "dat <- dat[, ..i]",which can solve this problem. |
|
I also had this issue when updating the TwoSampleMR package. An old script that worked 6 months ago (likely with v5.7) no longer works now (with v5.11). I assume something broke with one of the recent version updates. |
The opengwas API has been updated. So you need to update your version of the ieugwasr package and obtain a new token. The package can be updated with the following code. For Windows and Mac users install.packages("ieugwasr", repos = c("https://mrcieu.r-universe.dev", "https://cran.r-project.org")) For Ubuntu Jammy Jellyfish users # Installation code for Ubuntu Jammy Jellyfish users running R in the Terminal
options(HTTPUserAgent = sprintf(
"R/%s R (%s)",
getRversion(),
paste(getRversion(),
R.version["platform"],
R.version["arch"],
R.version["os"])
))
install.packages(
'ieugwasr',
repos = c(
'https://mrcieu.r-universe.dev/bin/linux/jammy/4.3/',
'https://packagemanager.posit.co/cran/__linux__/jammy/latest',
'https://cloud.r-project.org'
)
) Or install.packages('remotes')
remotes::install_github('MRCIEU/ieugwasr') |
Please see MRCIEU/ieugwasr#65 (comment) for the instructions about the token. |
Describe the bug (required)
When using the function format_data(), an error alert emerged.
Describe the current behaviour you observe (required)
错误: j(在 [...] 中的第二个参数)是单一符号,但未找到列名 'i'。如果你打算在调用环境中使用变量选择列,请尝试 DT[, ..i]。.. 前缀表示上一级,类似于文件系统路径。
Describe the behaviour you expect (required)
R code to reproduce the issue (required)
BMI_OUT<-TwoSampleMR::format_data(dat = BMI, type = "outcome", snps = CAD$SNP, header = TRUE, snp_col = "variant_id", beta_col = "beta", se_col = "standard_error", effect_allele_col = "effect_allele", other_allele_col = "other_allele", pval_col = "p_value")
Contribute a solution (optional)
Please submit a pull request and/or briefly describe your proposed solution
System information
Please provide details of your operating system and R version
Additional context
Add any other context about the problem here
The text was updated successfully, but these errors were encountered: