── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.5.2 ✔ tibble 3.3.0
✔ lubridate 1.9.4 ✔ tidyr 1.3.1
✔ purrr 1.0.4
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(reshape2)
Attaching package: 'reshape2'
The following object is masked from 'package:tidyr':
smiths
library(data.table)
Attaching package: 'data.table'
The following objects are masked from 'package:reshape2':
dcast, melt
The following objects are masked from 'package:lubridate':
hour, isoweek, mday, minute, month, quarter, second, wday, week,
yday, year
The following objects are masked from 'package:dplyr':
between, first, last
The following object is masked from 'package:purrr':
transpose
library(metafor)
Loading required package: Matrix
Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':
expand, pack, unpack
Loading required package: metadat
Loading required package: numDeriv
Loading the 'metafor' package (version 4.8-0). For an
introduction to the package please type: help(metafor)
library(metagear)
Warning: no DISPLAY variable so Tk is not available
** metagear 0.7, for installing/troubleshooting help see:
** http://lajeunesse.myweb.usf.edu/metagear/metagear_basic_vignette.html
***** External dependencies check:
***** setup supports GUIs [ FALSE ]
***** NOTE: Your configuration may still support GUIs,
***** use the fixes below only after you try
***** running metagear's abstract_screener().
**
** Fix for Windows users:
** Update R (tcltk is now part of all new R builds).
** Fix for Mac users:
** Install xQuartz (X11) from https://www.xquartz.org/
***** setup supports data extraction from plots/figures [ FALSE ]
***** NOTE: EBImage package (Bioconductor) will be installed only
***** when a figure_* function is used.
library(GGally)
Registered S3 method overwritten by 'GGally':
method from
+.gg ggplot2
# read datad1 <- readxl::read_xlsx('Source Data.xlsx',sheet ="FigureS3")d1 <-as.data.table(d1)d2<-d1CV_nuet_bar<-mean(d2$nuet_sd[is.na(d2$nuet_sd)==FALSE]/d2$nuet_mean[is.na(d2$nuet_sd)==FALSE])d2$nuet_sd[is.na(d2$nuet_sd)==TRUE]<-d2$nuet_mean[is.na(d2$nuet_sd)==TRUE]*1.25*CV_nuet_barCV_nuec_bar<-mean(d2$nuec_sd[is.na(d2$nuec_sd)==FALSE]/d2$nuec_mean[is.na(d2$nuec_sd)==FALSE])d2$nuec_sd[is.na(d2$nuec_sd)==TRUE]<-d2$nuec_mean[is.na(d2$nuec_sd)==TRUE]*1.25*CV_nuec_bar# clean up column namesd2 <-as.data.table(d2)setnames(d2,gsub('\\/','_',gsub(' |\\(|\\)','',colnames(d2))))setnames(d2,tolower(colnames(d2)))#Supplement and update the missing values for n_dose and p_dose d2[is.na(n_dose), n_dose :=median(d2$n_dose,na.rm=TRUE)]# update the database (g_crop_type)d2[g_crop_type=='maize', g_crop_type :=1]d2[g_crop_type=='wheat', g_crop_type :=2]d2[g_crop_type=='rice', g_crop_type :=3]#Conversion of factored data to numeric datad2$g_crop_type <-as.numeric(d2$g_crop_type)str(d2)