I was suggested to use
x = data.frame(string = c( "x1", "x2", "x3"))
x
apply(x,1,substr,1,4)
and it's worked good!
Thank you all
Wacek Kusnierczyk wrote:
>
> calpeda wrote:
>> thank you,
>> but I m importing data from a txt file and I have a matrix of n*1
>> The function str s
calpeda wrote:
> thank you,
> but I m importing data from a txt file and I have a matrix of n*1
> The function str seems to work only from 1*n
>
>
you see, it would help if you provided more details from the start. you
may still need to do it; it seems that both solutions you were given
(mine
thank you,
but I m importing data from a txt file and I have a matrix of n*1
The function str seems to work only from 1*n
Wacek Kusnierczyk wrote:
>
> calpeda wrote:
>> hi
>> I ve a list of item x = ( "x1"
>>"x2"
>>"
Dear celpeda,
Try this:
x = c( "x1", "x2", "x3")
substr(x,1,4)
[1] "" "" ""
See ?substr for more details.
HTH,
Jorge
On Wed, Apr 1, 2009 at 9:30 AM, calpeda wrote:
>
> hi
> I ve a list of item x = ( "x1"
> "x2"
>
calpeda wrote:
> hi
> I ve a list of item x = ( "x1"
>"x2"
>"x3")
>
> I need to extract a new vector y = ( "",
>"",
>
try this:
x <- c("x1", "x2", "x3")
substr(x, 1, 4)
Best,
Dimitris
calpeda wrote:
hi
I ve a list of item x = ( "x1"
"x2"
"x3")
I need to extract a new vector y = ( "",
hi
I ve a list of item x = ( "x1"
"x2"
"x3")
I need to extract a new vector y = ( "",
"",
""
)
I mean, for e
7 matches
Mail list logo