Re: [R] how to remove part of the string

2012-06-06 Thread Martin Schilling
Dear Bill, If you're not bound to gsub(), you could simply take substring() as follows: string <- "LTA4H||Leukotriene A4 hydrolase" substring(string, 1,5) This one works quite well and it could also be complemented with nchar() to "cut" strings with different lengths like substring(string, 1,

[R] data conversion (possibly with reshape package)

2012-05-23 Thread Martin Schilling
Hi everyone, I have an issue with a data conversion. First, I tried it with the reshape-package, but since it's quite a while that I used it, I feel kind of rusty... I have a data.frame like this: id Sample.Name Marker Allele.1 Allele.2sample_id

Re: [R] help with melt/cast in reshape-package

2012-05-22 Thread Martin Schilling
Hi everyone, I have an issue with the reshape package. Since it's quite a while that I used it, I feel kind of rusty... I got a data.frame like this > >> id Sample.Name Marker Allele.1 >> Allele.2sample_idspecies >> 101_pr

Re: [R] help with melt/cast in reshape-package

2012-05-21 Thread Martin Schilling
t one row. Should I just merge columns Allele.1, > Allele.2 and sample_id? > I'm kind of stuck, but would appreciate any help on the columns to be merged. Thanks a lot Martin Schilling > > [[alternative HTML version deleted]] __