0

I am trying to create an orchard). This is the code I am using

orchaRd::orchard_plot(res, mod = "1", group = "site_id", data = Over,
             xlab = "Standardised mean difference", transfm = "none")

However, I am receiving the next error message:

Error in model.frame.default(formula, data = data, ...) :
'data' must be a data.frame, environment, or list**

res mode:  

res <<- rma.mv(S_statistic, old.variance, random = ~ Long+Lat | const, struct="SPGAU",  
         data= Over, control=list(maxiter=1000))  
res

I saw this error in similar question (e.g. enter link description here), but the response there (i.e. use <<- ) is not working in my case. I also checked the class of the data

class(Over)

And the result is: "tbl_df" "tbl" "data.frame"

This is how looks the structure of my data:

structure(list(site_id = c(114000002, 114000003, 114000004, 114000005, 
114000011, 114000022, 114000025, 114000028, 114000032, 114000033, 
114000034, 114000035, 114000040, 114000041, 114000043, 114000044, 
114000045, 114000046, 114000051, 114000052, 114000054, 114000055, 
114000056, 114000058, 114000059, 114000061, 114000062, 114000069, 
114000071, 114000074, 114000077, 114000078, 114000080, 114000084, 
114000091, 114000092, 114000093), old.variance = c(26.3333333333333, 
267.666666666667, 212.666666666667, 266.666666666667, 165, 212.666666666667, 
65.3333333333333, 124, 27.3333333333333, 212.666666666667, 65.3333333333333, 
211.666666666667, 15.6666666666667, 88.3333333333333, 125, 209, 
42.3333333333333, 165, 165, 165, 212.666666666667, 27.3333333333333, 
43.3333333333333, 165, 158.333333333333, 124, 44.3333333333333, 
165, 124, 125, 123, 65.3333333333333, 268.666666666667, 65.3333333333333, 
125, 125, 124), S_statistic = c(-11, -13, -6, 38, 25, -10, 8, 
26, -4, 34, 6, 5, -5, -7, -23, -17, -11, -13, 17, 21, -26, 6, 
-10, -15, -13, 16, -9, 1, 22, -15, -23, 14, 18, 8, 19, 9, -4), 
    country = c("Hungary", "Hungary", "Hungary", "Hungary", "Hungary", 
    "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", 
    "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", 
    "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", 
    "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", 
    "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", "Hungary", 
    "Hungary", "Hungary"), Long = c(17.65100879, 17.24820995, 
    17.48157436, 17.75956317, 17.62008508, 20.10484453, 18.92972127, 
    18.20036077, 22.17214537, 21.54953566, 20.04842185, 20.20275863, 
    21.37276356, 21.31721339, 21.33331019, 21.42990426, 21.65588989, 
    21.07809604, 20.70191391, 20.20891276, 20.10484453, 17.44252702, 
    22.27869356, 20.49846058, 18.1207973, 17.40105792, 17.37861383, 
    21.84024432, 20.21669006, 20.84428942, 21.88455302, 18.71402118, 
    21.680406, 20.960894, 21.078608, 22.103883, 20.091853), Lat = c(47.79191747, 
    48.00412779, 47.79846003, 47.73507445, 47.67653192, 46.18551547, 
    46.80999815, 45.78350725, 48.41372591, 48.17687304, 46.86754579, 
    46.25444969, 47.63432655, 47.1046694, 46.62948998, 46.69378058, 
    47.02048061, 46.85390027, 46.16107454, 46.76067081, 46.18551547, 
    45.95052839, 48.22099999, 46.89058142, 47.75108544, 47.5127723, 
    47.70696377, 47.25267844, 46.24190846, 46.94494663, 47.29872238, 
    45.98285035, 48.349178, 48.107939, 47.908486, 48.3452, 47.292403
    ), const = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
    1, 1, 1)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, 
-37L))
TylerH
  • 20,799
  • 66
  • 75
  • 101
  • I assume that data should be assigned to Over, `Over <- ...`. In the orchard_plot, you have a variable 'res' that is not defined in your question. – Brian Syzdek Feb 07 '23 at 05:38
  • Thanks so much for your reply and sorry for the lack of details in the question, now I added the res mode (using rma.mv function) and yes the data was assigned to the name "Over". – Isma Soto Almena Feb 07 '23 at 07:55

0 Answers0