In this example, I fixed the issue of the data frame, so you have an example that will also work when you read the data from your text file.
######The code below just replicate your data #######################################
r <- c(-0.3173759, 0.2253440, -0.3209169, -0.7070982, -0.4100372, -0.5502341)
N <- rep (16, 6)
x <- as.data.frame(cbind (r, N))
x$Study <- paste0("Experiment", 1:6)
x## r N Study
## 1 -0.3173759 16 Experiment1
## 2 0.2253440 16 Experiment2
## 3 -0.3209169 16 Experiment3
## 4 -0.7070982 16 Experiment4
## 5 -0.4100372 16 Experiment5
## 6 -0.5502341 16 Experiment6#install.packages("meta") #Run once for each computer, or when you want to update the package.
library(meta) #load the package for use, each time you start R, or after detaching it. ## Loading 'meta' package (version 4.8-1).
## Type 'help("meta-package")' for a brief overview.metacor(r, N, Study, data = x) #Run function metacor from "meta" to meta analyze correlations.## COR 95%-CI %W(fixed) %W(random)
## Experiment1 -0.3174 [-0.7026; 0.2116] 16.7 16.7
## Experiment2 0.2253 [-0.3044; 0.6486] 16.7 16.7
## Experiment3 -0.3209 [-0.7045; 0.2079] 16.7 16.7
## Experiment4 -0.7071 [-0.8906; -0.3255] 16.7 16.7
## Experiment5 -0.4100 [-0.7527; 0.1075] 16.7 16.7
## Experiment6 -0.5502 [-0.8218; -0.0750] 16.7 16.7
##
## Number of studies combined: k = 6
##
## COR 95%-CI z p-value
## Fixed effect model -0.3754 [-0.5487; -0.1710] -3.49 0.0005
## Random effects model -0.3754 [-0.5987; -0.0979] -2.61 0.0091
##
## Quantifying heterogeneity:
## tau^2 = 0.0603; H = 1.34 [1.00; 2.12]; I^2 = 44.0% [0.0%; 77.8%]
##
## Test of heterogeneity:
## Q d.f. p-value
## 8.92 5 0.1122
##
## Details on meta-analytical method:
## - Inverse variance method
## - DerSimonian-Laird estimator for tau^2
## - Fisher's z transformation of correlationsfit <- metacor(r, N, Study, data = x) #Run function metacor from "meta" to meta analyze correlations and
#insert output into an object named "fit".
forest(fit)funnel(fit)