Sorry NULL in V8 should be corrected as NA

On Wed, Apr 13, 2011 at 7:33 AM, Ram H. Sharma <sharma.ram.h@gmail.com>wrote:

> It looks like my question is not clear, I have not get any suggestion, yet
> let me reiterate my problem:
>
> My data looks like this to be read from a text file. As I provided earlier
> the A, B, and H in V4 column has much longer chain.
>
> V1     V2       V3        V4
> 1_1    ch1       0.0       AHAH
> 1_2    ch1       0.20     AHAAA
>
> ...........................so on
>
> I want to read this as (splitting AHB........into individual characters)
> V1     V2       V3         V4   V5        V6      V7      V8
> 1_1    ch1       0.0       A    H          A        H        NA
> 1_2    ch1       0.20     A    H          A        A        A
>
> Any trick to do this?
>
> Thanks;
>
> Ram H
>
>
> On Tue, Apr 12, 2011 at 5:19 PM, Ram H. Sharma <sharma.ram.h@gmail.com>wrote:
>
>> Dear R experts
>>
>> Sorry for posting:
>> I have text file that I need to read into R (this is out from different
>> program).   A portion of  data look like:
>>
>> ;example data
>> 1_1 ch1 0.0
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHAHHHH
>> 1_2 ch1 0.1
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHAHHHH
>> 1_3 ch1 0.1
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHAHHHH
>> 1_4 ch1 0.2
>> HAAAHHAAAHHAAAAAHHAHHAHAHH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HAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHAHHHH
>> 1_11 ch1 0.5
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHAHHHH
>> 1_12 ch1 0.6
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHHHHHH
>> 1_13 ch1 0.6
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHHHHHH
>> 1_14 ch1 0.7
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHHHHHH
>> 1_15 ch1 0.7
>> HAAAHHAAAHHAAAAAHHAHHAHAHHHAAHHAHAAAAHAAAHHAHHAAHAHHAAAAHAAAHHHAAAHHAHHHAAAHHHHAHHAAHAAAAHAHHHHHAAAHAHHAHHHHAHHHHHHHHHAAHAAHHHAHAAAAAHHHHHHAHHHHHHHHHH
>>
>>  read_data <- read.table ("my_text_file.txt",header=F,comment=";")
>> How can I read this into table where columns first five column are
>> maintained as such (e.g. 1_1  ch1  0.0 H ) where as the long single column
>> (filled with A, H, B) split into individual columns. Or alternatively first
>> read using the following command and then able to split the variable 4.
>>
>> Thank you for help;
>>
>>
>> Ram H
>>
>>
>
>
> --
>
> Ram H
>
>


-- 

Ram H

	[[alternative HTML version deleted]]

