0

I'm using spread() function for the data frame with fields:

Company | FoundYear | AmountTotal |Industry

when I run the spread command against that data frame, it says an error for the column, which does not even exist in my data frame.

spread(mydata, key = FoundYear, value = AmountTotal)

Error in grouped_df_impl(data, unname(vars), drop) : 
  Column `Startup` is unknown

Any help about the idea why this anomaly might be happening is appreciated.

wibeasley
  • 5,000
  • 3
  • 34
  • 62
Tedo G.
  • 1,556
  • 3
  • 17
  • 29
  • 2
    Can you please provide a reproducible example? Part of your data.frame so we can produce the same error. Check this post https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – shiny Nov 11 '17 at 04:16
  • `mydata <- as.data.frame(mydata)` solved, but still confused why the error throw the fieldname which is not in the data frame. – Tedo G. Nov 13 '17 at 13:18

0 Answers0