My apologies, I have misread your question. That's what I get for doing
stuff with one foot already out of the office. The following code should
give you a vector you asked for.

temp <- strsplit(as.character(code.key$Realiserat), "_", fixed = TRUE)
code.key <- do.call("rbind", temp)[, 2]


Cheers,
Roman



On Fri, Dec 17, 2010 at 3:13 PM, gianni lavaredo
<gianni.lavaredo@gmail.com>wrote:

> thanks but look this code doesn't work :(
>
> On Fri, Dec 17, 2010 at 3:04 PM, Roman Luštrik <roman.lustrik@gmail.com>wrote:
>
>> code.key[grep("_090529_", code.key$Realiserat), ]
>>
>> If you want a more dynamic process, it requires a bit more coding and it
>> depends on what you actually want.
>>
>> Cheers,
>> Roman
>>
>>
>>
>> On Fri, Dec 17, 2010 at 2:57 PM, gianni lavaredo <
>> gianni.lavaredo@gmail.com> wrote:
>>
>>> dear Researchers,
>>>
>>> I need to halp to understand I can select only a part of information
>>> insiede
>>> a column of data.frame.
>>>
>>> I have a data.frame as:
>>>
>>> code.key <- data.frame(Realiserat=c(
>>>
>>> "09P001001_090529_172815","09P001002_090529_153925","09P001003_090531_084446","09P001004_090529_161720",
>>>
>>> "09P001005_090531_090203","09P001006_090530_121611"),
>>> SourceID=c(5,1,22,2,23,18))
>>>
>>> > code.key
>>>               Realiserat SourceID
>>> 1 09P001001_090529_172815        5
>>> 2 09P001002_090529_153925        1
>>> 3 09P001003_090531_084446       22
>>> 4 09P001004_090529_161720        2
>>> 5 09P001005_090531_090203       23
>>> 6 09P001006_090530_121611       18
>>>
>>> and I wish to select only this part _090529_, etc etc to have a new
>>> vector
>>> or data.frame
>>>
>>> >  NEWcode.key
>>> Realiserat
>>> 1 090529
>>> 2 090529
>>> 3 090531
>>> 4 090529
>>> 5 090531
>>> 6 090530
>>>
>>> thanks
>>>
>>> Gianni
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>>
>> --
>> In God we trust, all others bring data.
>>
>
>


-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

