Thank you Bill Dunlap. So simple I never tried that approach. Tried dozens of
others though, read manuals till I was getting headaches, and of course the
answer was simple when one is competent. Learning, its a struggle, but slowly
getting there.
Thanks again
Carl Sutton CPA
On Friday
Hi,
I was able to replicate the solution as suggested by William in case of
data.frame class, not in case of data.table class.
In case of data.table, I had to do some minor changes as shown below.
library(data.table)
a <- 1:10
b <- c("a","b","c","d","e","f","g","h","i","j")
c <- seq(1.1, .2, len
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help@r-project.org> wrote:
> Good morning RGuru's
> I have a data frame of 575 columns. I wan
Good morning RGuru's
I have a data frame of 575 columns. I want to extract only those columns that
are numeric(double) or integer to do some machine learning with. I have
searched the web for a couple of days (off and on) and have not found anything
that shows how to do this. Lots of ways to
Thank you. That worked.
On 19-Jun-2014 3:24 PM, Uwe Ligges wrote:
On 19.06.2014 23:50, Chris Dolanc wrote:
Hello,
I have a data frame with > 5000 columns and I'd like to be able to make
subsets of that data frame made up of certain columns by using part of
the column names. I've had a surpri
On Thu, 19 Jun 2014 02:50:20 PM Chris Dolanc wrote:
> Hello,
>
> I have a data frame with > 5000 columns and I'd like to be able to
make
> subsets of that data frame made up of certain columns by using
part of
> the column names. I've had a surprisingly hard time finding
something
> that works
On 19.06.2014 23:50, Chris Dolanc wrote:
Hello,
I have a data frame with > 5000 columns and I'd like to be able to make
subsets of that data frame made up of certain columns by using part of
the column names. I've had a surprisingly hard time finding something
that works by searching online.
Hello,
I have a data frame with > 5000 columns and I'd like to be able to make
subsets of that data frame made up of certain columns by using part of
the column names. I've had a surprisingly hard time finding something
that works by searching online.
For example, lets say I have a data fram
Greg Snow <538...@gmail.com>
> Subject: Re: [R] Selecting columns whose names contain "mutated" except when
> they also contain "non" or "un"
> To: "Paul Miller"
> Cc: r-help@r-project.org
> Received: Thursday, April 26, 2012, 1:55 PM
> S
> David Winsemius
> on Mon, 23 Apr 2012 12:16:39 -0400 writes:
> On Apr 23, 2012, at 12:10 PM, Paul Miller wrote:
>> Hello All,
>>
>> Started out awhile ago trying to select columns in a
>> dataframe whose names contain some variation of the word
>> "mutant"
Sorry I took so long getting back to this, but the paying job needs to
take priority.
The regular expression "(? wrote:
> Hi Greg,
>
> This is quite helpful. Not so good yet with regular expressions in general or
> Perl-like regular expressions. Found the help page though, and think I was
> able
On Apr 24, 2012, at 19:15 , Rui Barradas wrote:
>
> Has anyone realized that both 'non' and 'un' end with the same letter? The
> only one we really need to check?
>
> (tmp <- c('mutation','nonmutated','unmutated','verymutated','other'))
>
> i1 <- grepl("muta", tmp)
> i2 <- grepl("nmuta", tmp)
Hello Dr. Winsemius,
There was a non-numeric column. Thanks for helping me to see the obvious.
Paul
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guid
Hello,
Greg Snow wrote
>
> Here is a method that uses negative look behind:
>
>> tmp <- c('mutation','nonmutated','unmutated','verymutated','other')
>> grep("(? [1] 1 4
>
> it looks for muta that is not immediatly preceeded by un or non (but
> it would matc
On Apr 24, 2012, at 9:40 AM, Paul Miller wrote:
Hi Greg,
This is quite helpful. Not so good yet with regular expressions in
general or Perl-like regular expressions. Found the help page
though, and think I was able to determine how the code works as well
as how I would select only instan
Hi Greg,
This is quite helpful. Not so good yet with regular expressions in general or
Perl-like regular expressions. Found the help page though, and think I was able
to determine how the code works as well as how I would select only instances
where "muta" is preceeded by either "non" or "un".
Here is a method that uses negative look behind:
> tmp <- c('mutation','nonmutated','unmutated','verymutated','other')
> grep("(? wrote:
> Hello All,
>
> Started out awhile ago trying to select columns in a dataframe whose names
> contain some variation of the word "mutant" using code like:
>
> n
Hi Bert,
Yes, code like:
x <- names(yourdataframe)
grepl("muta",x) & !grepl("nonmuta|unmuta",x)
works perfectly.
Thanks very much for your help.
Paul
--- On Mon, 4/23/12, Bert Gunter wrote:
> From: Bert Gunter
> Subject: Re: [R] Selecting columns who
,
>
> Paul
>
>
> --- On Mon, 4/23/12, David Winsemius wrote:
>
>> From: David Winsemius
>> Subject: Re: [R] Selecting columns whose names contain "mutated" except when
>> they also contain "non" or "un"
>> To: "Paul Mil
x27;t you?
--
David.
Thanks,
Paul
--- On Mon, 4/23/12, David Winsemius wrote:
From: David Winsemius
Subject: Re: [R] Selecting columns whose names contain "mutated"
except when they also contain "non" or "un"
To: "Paul Miller"
Cc: r-help@r-project.
Below.
-- Bert
On Mon, Apr 23, 2012 at 9:10 AM, Paul Miller wrote:
> Hello All,
>
> Started out awhile ago trying to select columns in a dataframe whose names
> contain some variation of the word "mutant" using code like:
>
> names(KRASyn)[grep("muta", names(KRASyn))]
>
> The idea then would be
Hello Dr. Winsemius,
Unfortunately, I also have terms like "krasmutated". So simply selecting words
that start with "muta" won't work in this case.
Thanks,
Paul
--- On Mon, 4/23/12, David Winsemius wrote:
> From: David Winsemius
> Subject: Re: [R] Select
On Apr 23, 2012, at 12:10 PM, Paul Miller wrote:
Hello All,
Started out awhile ago trying to select columns in a dataframe whose
names contain some variation of the word "mutant" using code like:
names(KRASyn)[grep("muta", names(KRASyn))]
The idea then would be to add together the various
Hello All,
Started out awhile ago trying to select columns in a dataframe whose names
contain some variation of the word "mutant" using code like:
names(KRASyn)[grep("muta", names(KRASyn))]
The idea then would be to add together the various columns using code like:
KRASyn$Mutant_comb <- rowSum
Clayton -
From your explanation, it sounds like you want to create
a new file removing the "Location" variable, and all the
variables that have the string "Ambient" or "Name" in their names.
Suppose that your data frame is called mydata, and you wish to
create a reduced csv file called "myda
I need help.
I have very big .csv files with many unnecessary columns. From the original
.csv files I would like to create a new .csv file with just the columns I
need.
For example:
The original column heading are: Date, Time, Location, Sensor Name, Sensor
Serial, Ambient Temp, IR Temp, Sensor
probably you're looking for
subset(capdist, ida %in% c("DEN","SWD","FIN") & idb %in%
c("DEN","SWD","FIN"))
I hope it helps.
Best,
Dimitris
Thomas Jensen wrote:
Dear R-list,
I am having troubles selecting rows from a very large data-set
containing distances between capitals.
The struc
Dear R-list,
I am having troubles selecting rows from a very large data-set
containing distances between capitals.
The structure of the data-set looks like this:
numaida numbidb kmdist midist
12 USA 20 CAN 731
28 matches
Mail list logo