Skip to content
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

Closed
Carnivalera opened this issue Mar 25, 2024 · 7 comments
Labels

Comments

@Carnivalera
Copy link

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

@Carnivalera Carnivalera changed the title format_data() Error[BUG]: [BUG]: format_data() Error: j(在 [...] 中的第二个参数)是单一符号,但未找到列名 'i' Mar 25, 2024
@Diekunstderfug
Copy link

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!

@filmchen
Copy link

filmchen commented Apr 8, 2024

Have you resolved the issue? I have met the same problem, it would be appreciated if there is any suggestion!

@filmchen
Copy link

filmchen commented Apr 9, 2024

Editing the function TwoSampleMR::data.table(), instead "dat <- dat[, i]" with "dat <- dat[, ..i]",which can solve this problem.

@JPRAH-MORMONT
Copy link

编辑函数 TwoSampleMR::d ata.table(),改为“dat <- dat[, i]”和“dat <- dat[, ..i]“,可以解决这个问题。
I have met the same problem
Thanks for your answer, however I can't understand the meaning.
It would be appreciated if there is more detailed answer or the code

@nadineparker
Copy link

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.

@remlapmot
Copy link
Contributor

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')

@remlapmot
Copy link
Contributor

Please see MRCIEU/ieugwasr#65 (comment) for the instructions about the token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants