title: Error: $ operator is invalid for atomic vectors - ggtern
body: <p>Disclaimer: new to R.</p>
  
  <p>Hello! I'm trying to plot ternary diagrams of water chemistry samples using the <code>ggtern</code> package. Trying to run the following code gets me the title error.</p>
  
  <pre><code>require(ggtern)
  
  datos = read.csv("Li, B, Cl.csv", header = T, sep = ";", stringsAsFactors = FALSE)
  names(datos) &lt;- c("Muestra", "Li", "B", "Cl")
  
  x11()
  plot &lt;- ggtern(data = datos, mapping = aes(x = as.numeric(datos[["Li"]]), y = as.numeric(datos[["Cl"]]), z = as.numeric(datos[["B"]]))) + geom_point()
  plot
  </code></pre>
  
  <p>From my understanding, there is some low level function expecting an atomic vector, but I'm giving <code>ggtern</code>, as an input, a data.frame (checked through <code>str()</code>).</p>
  
  <p>Once executed, the script draws nothing. My data is formatted as it follows, but semicolon-separated:</p>
  
  <p><code>Muestra    Li  B   Cl
  XYA3030 2.321334755 3.017842551 94.66082269
  XEP3609 9.436334248 45.43581846 45.12784729
  XEP3606_1   10.12604478 62.68726944 27.18668578
  XEP3606_2   5.18367492  34.94305194 59.87327314
  XEP3611 5.859786577 18.8098607  75.33035272
  XEP3613 13.60173875 49.1191375  37.27912375
  XEP3612 13.11960754 27.07316925 59.80722321
  XEP3608 6.473636887 15.58523589 77.94112722
  XEP3543 16.93515603 46.59573787 36.4691061
  </code></p>
  
  <p>This is the "dput(datos)" output, as suggested in the comments.</p>
  
  <pre><code>&gt; dput(datos)
  
  structure(list(Muestra = c("XYA3030", "XEP3609", "XEP3606_1", 
  "XEP3606_2", "XEP3611", "XEP3613", "XEP3612", "XEP3608", "XEP3543"
  ), Li = c(2.321334755, 9.436334248, 10.12604478, 5.18367492, 
  5.859786577, 13.60173875, 13.11960754, 6.473636887, 16.93515603
  ), B = c(3.017842551, 45.43581846, 62.68726944, 34.94305194, 
  18.8098607, 49.1191375, 27.07316925, 15.58523589, 46.59573787
  ), Cl = c(94.66082269, 45.12784729, 27.18668578, 59.87327314, 
  75.33035272, 37.27912375, 59.80722321, 77.94112722, 36.4691061
  )), class = "data.frame", row.names = c(NA, -9L))
  </code></pre>
  
  <p><strong>Update: tried the simplest code I could come up with and still no luck. Am I missing something basic?</strong></p>
  
  <pre><code>library(ggtern)
  datos = read.csv("Li_B_Cl.csv", header = T, sep = ";", stringsAsFactors = FALSE)
  ggtern(data = datos, mapping = aes(x = Li, y = Cl, z = B)) + geom_point()
  </code></pre>
  
  <p><strong>Update 2</strong>: cleared the RStudio session and packages, reinstalled ggtern and ggplot2, then ran the simple code. No luck. Here's the traceback after the error:</p>
  
  <pre><code>&gt; datos = read.csv("Li_B_Cl.csv", header = TRUE, sep = ";", stringsAsFactors = FALSE)
  &gt; ggtern(data = datos, mapping = aes(x = Li, y = Cl, z = B)) + geom_point()
  Error: $ operator is invalid for atomic vectors
  &gt; traceback()
  17: transform_position(data, panel_params$x$rescale, panel_params$y$rescale)
  16: f(...)
  15: self$super()$super()$transform(data, scale_details)
  14: f(..., self = self)
  13: self$transform(ex, scale_details)
  12: .get.tern.extremes(self, list(x.range = self$limits$x, y.range = self$limits$y))
  11: f(..., self = self)
  10: self$coord$setup_panel_params(scale_x, scale_y, params = self$coord_params)
  9: (function (scale_x, scale_y) 
     {
         self$coord$setup_panel_params(scale_x, scale_y, params = self$coord_params)
     })(dots[[1L]][[1L]], dots[[2L]][[1L]])
  8: mapply(FUN = f, ..., SIMPLIFY = FALSE)
  7: Map(setup_panel_params, scales_x, scales_y)
  6: f(..., self = self)
  5: layout$setup_panel_params()
  4: ggplot_build.ggplot(x)
  3: ggplot_build(x)
  2: print.ggplot(x)
  1: (function (x, ...) 
     UseMethod("print"))(x)
  </code></pre>