I am aware that my question is similar to a previous thread. However, I believe that my case is different. I am experiencing Object not found
error while knitting my markdown. However, I believe that the dataset is loaded correctly in the R Markdown environment.
Below is the code chunk I wrote in my R Markdown:
library(meta)
library(metafor)
library(readxl)
data.binary <- read_xlsx(path="data/metabin.xlsx")
View(data.binary)
ma.binary <- metabin(
event.e = ee,
n.e = ne,
event.c = ec,
n.c = nc,
studlab = paste(Author),
data = data.binary,
comb.fixed = TRUE,
comb.random = TRUE,
method.tau = "DL",
hakn = FALSE,
prediction = TRUE,
sm = "RR"
)
forest(ma.binary)
funnel(ma.binary, xlab = "Risk Ratio")
The above chunk returns this error:
Error in funnel(ma.binary, xlab = "Risk Ratio") : object 'ma.binary' not found Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> funnel
I have tried clearing my environment with rm(list = ls())
but the problem persists. Furthermore, when I delete the funnel(ma.binary, xlab = "Risk Ratio")
part, the chunk runs perfectly fine, hence I believe that the dataset is loaded correctly in the R Markdown.
Is something wrong with my code chunk?
Thank you very much for the help
Best,
question from:
https://stackoverflow.com/questions/65844482/r-markdown-object-not-found-while-doing-funnel-in-the-meta-package 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…