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,
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] "abc""lmno" "qrstuvwxyz"
Thanks. Th
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] "abc""lmno" "qrstuvwxyz"
Thanks. That's very close to what I'm looking for, but
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] "abc""lmno" "qrstuvwxyz"
Thanks. That's very close to what I'm looking for, but i
Mike Miller wrote:
On Mon, 2 May 2011, Gabor Grothendieck wrote:
On Mon, May 2, 2011 at 10:32 PM, Mike Miller 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 "abcde
On Mon, 2 May 2011, Gabor Grothendieck wrote:
On Mon, May 2, 2011 at 10:32 PM, Mike Miller 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
Bu
On Mon, May 2, 2011 at 10:32 PM, Mike Miller 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 delimite
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 "c
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
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
10 matches
Mail list logo