csv - How to replace a string with another string in a column in R? -


i have csv file like

data.csv

id,name,city 23,radu,los angeles 34,tree,chicago rtet,great,miami rtet,francis,paris 

where

  record <- read.csv("data.csv",header=true);   identity <- record$id 

i used

  gsub("rtet","67",identity) 

but not work.

how replace "rtet" in csv file "67" in r? new r.any appreciated.

record$id<-gsub("rtet","67",record$id) 

works me...


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -