Re: [R] Replace Text but not from within a word

2017-02-28 Thread Marc Schwartz
> On Feb 28, 2017, at 8:36 AM, Jeff Newmiller wrote: > > For tasks like this, you will probably want to make sure to import the data > as character data rather than as a factor. E.g. > > dat <- read.csv( "myfile.csv", header=FALSE, as.is=TRUE ) > > You can check what you have with the str()

Re: [R] Replace Text but not from within a word

2017-02-28 Thread Jeff Newmiller
For tasks like this, you will probably want to make sure to import the data as character data rather than as a factor. E.g. dat <- read.csv( "myfile.csv", header=FALSE, as.is=TRUE ) You can check what you have with the str() function. -- Sent from my phone. Please excuse my brevity. On Februa

Re: [R] Replace Text but not from within a word

2017-02-28 Thread Marc Schwartz
> On Feb 28, 2017, at 3:38 AM, Harshal Athawale > wrote: > > I am new in R. > > I have a file. This file contains name of the companies. > 'data.frame': 494 obs. of 1 variable: > $ V1: Factor w/ 470 levels "3-d engineering corp",..: 293 134 339 359 143 > 399 122 447 398 384 ... > > Problem:

[R] Replace Text but not from within a word

2017-02-28 Thread Harshal Athawale
I am new in R. I have a file. This file contains name of the companies. 'data.frame': 494 obs. of 1 variable: $ V1: Factor w/ 470 levels "3-d engineering corp",..: 293 134 339 359 143 399 122 447 398 384 ... Problem: I would like to remove "CO" (As it is the most frequent word). I would like "C