0

I'm trying to run svd on some data and I'm getting an error. I saw another post suggesting that this might happen when one or more of the columns are all 0, but this is not the case here. Can someone please explain what is going on and how to fix this? Note, that this is a subset of a much larger data-set. Thank you.

year <- c(2015, 2015, 2015, 2015, 2015, 2015)
week <- c(1, 1, 1, 1, 1, 1)
flight_type_name <- c("Commercial", "Filler", "Label", "Commercial", "Filler", "Filler")
userdata_country <- c("NO", "SG", "NI", "None", "CA", "GT")
platform <- c("iphone", "linux", "iphone", "linux", "web", "ipad")
num_users <- c("26726, 2, 161, 1, 4316, 577")
impressions <- c(135019, 0, 312, 0, 37014, 11492)
clicks <- c(407, 2, 2, 2, 59, 25)

ctr <- data.frame(year, week, flight_type_name, userdata_country, platform, num_users, impressions, clicks)

svd(ctr)
Community
  • 1
  • 1
oneself
  • 38,641
  • 34
  • 96
  • 120
  • 1
    Can you provide the actual `svd` call? A lot of your data isn't even numeric... – joran Jan 28 '15 at 20:04
  • Oops, finished cutting to early. I've added it in. – oneself Jan 28 '15 at 21:19
  • So, yeah. You can't do a singular value decomposition on non-numeric data, which is what you're trying to do here. – joran Jan 28 '15 at 21:20
  • Do I need to remove the non-numeric data or can I assign numeric values in some way? – oneself Jan 28 '15 at 22:01
  • You _can_ do anything you like, the question is whether it will result in anything meaningful. I'm not sure how to help more because I don't know exactly what your ultimate goal is in computing the svd. – joran Jan 28 '15 at 22:37

0 Answers0