Re: [R] GSUB function and regex problem

2014-08-18 Thread Rui Barradas
Hello, Try reading your data with option stringsAsFactors = FALSE. It seems that your strings are being read as factors, which are coded as integers. DataGoogle1 <- read.csv(file = "DataGoogle2.csv", header = T, stringsAsFactors = FALSE) Hope this helps, Rui Barradas Em 18-08-2014 10:13,

Re: [R] GSUB function and regex problem

2014-08-18 Thread William Dunlap
gsub will work on a column of a data.frame, not an entire data.frame. > gsub(pattern = "facebook-Ads1", "FBAds", DataGoogle1$Campaña) [1] "FBAds" "faceBOOK-Ads1" "fcebook-ads12" "Email1" "mail1" [6] "referral1" Bill Dunlap TIBCO Software wdunlap tibco.com On Mon, Aug 18, 2014 at 2:13 AM,

[R] GSUB function and regex problem

2014-08-18 Thread Omar André Gonzáles Díaz
Hi all, i have this data.frame with 3 columns: "campaña", "visitas", "compras". This is the actual data.frame: Campaña Visitas Compras 1 facebook-Ads1 524 2 2 faceBOOK-Ads1 487 24 3 fcebook-ads12258 4 4