[R] UNIX-like "cut" command in R

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Tue May 3 00:35:23 CEST 2011


Hi Mike,

try substr()

Cheers

Andrew

On Mon, May 02, 2011 at 03:53:58PM -0500, Mike Miller wrote:
> The R "cut" command is entirely different from the UNIX "cut" command. 
> The latter retains selected fields in a line of text.  I can do that kind 
> of manipulation using sub() or gsub(), but it is tedious.  I assume there 
> is an R function that will do this, but I don't know its name.  Can you 
> tell me?
> 
> I'm also guessing that there is a web page somewhere that will tell me how 
> to do a lot of common GNU/UNIX/Linux "text util" commmand-line kinds of 
> things in R.  By that I mean by using R functions, not by making system 
> calls.  Does anyone know of such a web page?
> 
> Thanks in advance.
> 
> Mike
> 
> --
> Michael B. Miller, Ph.D.
> Minnesota Center for Twin and Family Research
> Department of Psychology
> University of Minnesota
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Program Manager, ACERA 
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia               (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr              Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/

Forest Analytics with R (Springer, 2011) 
http://www.ms.unimelb.edu.au/FAwR/
Introduction to Scientific Programming and Simulation using R (CRC, 2009): 
http://www.ms.unimelb.edu.au/spuRs/



More information about the R-help mailing list