On Mon, 2 May 2011, P Ehlers wrote:
Use str_sub() in the stringr package:
require(stringr) # install first if necessary
s - abcdefghijklmnopqrstuvwxyz
str_sub(s, c(1,12,17), c(3,15,-1))
#[1] abclmno qrstuvwxyz
Thanks. That's very close to what I'm looking for, but it seems
On Mon, 2 May 2011, P Ehlers wrote:
Use str_sub() in the stringr package:
require(stringr) # install first if necessary
s - abcdefghijklmnopqrstuvwxyz
str_sub(s, c(1,12,17), c(3,15,-1))
#[1] abclmno qrstuvwxyz
Thanks. That's very close to what I'm looking for, but it
On Tue, 3 May 2011, Christian Schulz wrote:
On Mon, 2 May 2011, P Ehlers wrote:
Use str_sub() in the stringr package:
require(stringr) # install first if necessary
s - abcdefghijklmnopqrstuvwxyz
str_sub(s, c(1,12,17), c(3,15,-1))
#[1] abclmno qrstuvwxyz
Thanks. That's
On Tue, May 03, 2011 at 01:39:49AM -0500, Mike Miller wrote:
On Tue, 3 May 2011, Christian Schulz wrote:
[...]
x - this is a string
unlist(strsplit(x, ))[c(1,4)]
Thanks. I did figure that one out a couple of messages back, but to get
it do behave like cut -d' ' -f1,4, I had to add a
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
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
On Tue, 3 May 2011, Andrew Robinson wrote:
try substr()
OK. Apparently, it allows things like this...
substr(abcdef,2,4)
[1] bcd
...which is like this:
echo abcdef | cut -c2-4
But that doesn't use a delimiter, it only does character-based cutting,
and it is very limited. With cut -c
On Mon, May 2, 2011 at 10:32 PM, Mike Miller mbmille...@gmail.com wrote:
On Tue, 3 May 2011, Andrew Robinson wrote:
try substr()
OK. Apparently, it allows things like this...
substr(abcdef,2,4)
[1] bcd
...which is like this:
echo abcdef | cut -c2-4
But that doesn't use a delimiter,
On Mon, 2 May 2011, Gabor Grothendieck wrote:
On Mon, May 2, 2011 at 10:32 PM, Mike Miller mbmille...@gmail.com wrote:
On Tue, 3 May 2011, Andrew Robinson wrote:
try substr()
OK. Apparently, it allows things like this...
substr(abcdef,2,4)
[1] bcd
...which is like this:
echo abcdef
Mike Miller wrote:
On Mon, 2 May 2011, Gabor Grothendieck wrote:
On Mon, May 2, 2011 at 10:32 PM, Mike Miller mbmille...@gmail.com wrote:
On Tue, 3 May 2011, Andrew Robinson wrote:
try substr()
OK. Apparently, it allows things like this...
substr(abcdef,2,4)
[1] bcd
...which is like
10 matches
Mail list logo