Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试创建林打印时获取R代码错误_R - Fatal编程技术网

尝试创建林打印时获取R代码错误

尝试创建林打印时获取R代码错误,r,R,我在R中使用以下代码来构建森林地块: library(forestplot) cochrane_from_rmeta <- structure(list( mean = c(NA, NA, 1.62, 1.48, 1.43, 1.55, 1.60, 1.63, 1.48, 1.43, 1.43, 1.41, NA), lower = c(NA, NA, 1.23, 0.95, 1.04, 1.15, 1.01, 1.83, 1.15, 1.04, 1.07,

我在R中使用以下代码来构建森林地块:

library(forestplot)

    cochrane_from_rmeta <-
  structure(list(
    mean  = c(NA, NA, 1.62, 1.48, 1.43, 1.55, 1.60, 1.63, 1.48, 1.43, 1.43, 1.41, NA),
    lower = c(NA, NA, 1.23, 0.95, 1.04, 1.15, 1.01, 1.83, 1.15, 1.04, 1.07, 0.79, NA),
    upper = c(NA, NA, 2.14, 2.31, 1.95, 2.09, 2.53, 5.68, 1.91, 1.95, 1.92, 2.54, NA)),
    .Names = c("mean", "lower", "upper"),
    row.names = c(NA, -13L),
    class = "data.frame")

    tabletext<-cbind(
  c("", "Subgroup", "RRMS", "<40 years-old",
    "≥ 40 years-old", "Female", "Male", "First-Line",
    "Non First-Line", "Baseline GdE Lesions","No Baseline GdE Lesions",
    "Direct Switch from NTZ", NA),
  c("Discontinuation", "(DMF)", "244", "93",
    "233", "238", "88", "27",
    "299", "63", "240","41", NA),
  c("Discontinuation", "(FTY)", "148", "62",
    "124", "137", "49", "7",
    "179", "32","138","57", NA),
  c("", "OR", "1.62", "1.48",
    "1.43", "1.55", "1.60", "1.63",
    "1.48", "1.43", "1.43", "1.41", NA))

    forestplot(tabletext,
           cochrane_from_rmeta,new_page = TRUE,
           is.summary=c(TRUE,TRUE,rep(FALSE,10),TRUE),
           clip=c(0.1,2.5),
           xlog=TRUE,
           col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))
有没有关于如何调整我的代码以修复错误的想法

提前感谢,,
Carrie

您需要指定平均值、下限和上限参数

    forestplot(tabletext,
                   cochrane_from_rmeta$mean,
                   cochrane_from_rmeta$lower,
                   cochrane_from_rmeta$upper,
                   new_page = TRUE,
                   is.summary=c(TRUE,TRUE,rep(FALSE,10),TRUE),
                   clip=c(0.1,2.5),
                   xlog=TRUE,
                   col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))

    forestplot(tabletext,
                   cochrane_from_rmeta$mean,
                   cochrane_from_rmeta$lower,
                   cochrane_from_rmeta$upper,
                   new_page = TRUE,
                   is.summary=c(TRUE,TRUE,rep(FALSE,10),TRUE),
                   clip=c(0.1,2.5),
                   xlog=TRUE,
                   col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))