... heh, heh and even simpler (but maybe not much faster)
x[substring(x,1,2) != "rs"]
(DUHHH!)
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On
Rui, et. al.:
**IF** the data set can be read into R (3e6 lines x ?bytes/line ??) ,
then I think for a completely specified regular pattern such as that
described by the OP, grep would be a bit inefficient. If x is a vector
of strings, and you wish to remove all those that don't begin with
"rs"
Hello,
Try to study the following example.
A <- c("rs1056", "rs1076", "ab1234567")
x <- 1:3
dat <- data.frame(A, x)
inx <- grepl("^rs", dat$A)
dat[!inx, ]
Hope this helps,
Rui Barradas
Em 30-01-2017 14:23, greg holly escreveu:
Hi all;
I have a file which has about 3.000.000
then my solution should work.
Bob
On 1/30/2017 9:44 AM, greg holly wrote:
> Hi Robert;
>
> I do appreciate your advice. Only the first column of the data is
> text. The rest columns are numeric.
>
> Regards,
>
> Greg
>
> On Mon, Jan 30, 2017 at 9:36 AM, Robert Sherry
Hi Robert;
I do appreciate your advice. Only the first column of the data is text. The
rest columns are numeric.
Regards,
Greg
On Mon, Jan 30, 2017 at 9:36 AM, Robert Sherry wrote:
> Greg,
>
> I am assuming that your data is in a text file. R is a good tool but not
>
Greg,
I am assuming that your data is in a text file. R is a good tool but not
the tool I would use for this job. The tool I would
use is grep. The following command should get you want you want:
grep -v "^rs"
Bob
On 1/30/2017 9:23 AM, greg holly wrote:
Hi all;
I have a file
Hi all;
I have a file which has about 3.000.000 lines. Most of the lines at first
column start with "rs", for example, rs1056, rs1076 and so on. I
would like to get the lines which do not start with "rs" . Your helps
highly appreciated.
Regards,
Greg
[[alternative HTML version
7 matches
Mail list logo