Displaying 20 results from an estimated 80 matches similar to: "finding max value in a row and reporting colum name"
2006 Jan 22
0
Get colum types in auto form
Hi all,
I''m trying to build a routine that generates table rows with the appropriate
field types (text_area and text_field for now), and filters out the
''created_at'' and ''deleted_at''.
<% for column in Project.content_columns %>
<tr class="ListLine<%= cycle("0","1") %>">
<td><%=
2017 Aug 01
0
How to replace match words whith colum name of data frame?Hi--
Hi--
concept_df$NewCol <- "";
kw <- "acid|ph";
bb <- grepl(kw,concept_df$concept)
concept_df[dd,2] <- "chemical"
The is a bit late but it accomplish the same with base R.
Good luck--EK
PS.. my email doesn't accept reply
[[alternative HTML version deleted]]
2017 Jul 01
0
How to replace match words whith colum name of data frame?
I have two data frame. I want to use "chemical_df" to match "concept_df "
concept_df <- data.frame(concept=c("butan acid ", "nano diamond particl", "slurri
composit", "composit ph polis", " inorgan particl ", "grind liquid", "liquid formul", "nanoparticl", "size abras particl",
2017 Jul 30
0
How to replace match words whith colum name of data frame?
Try the stringr package.
This should work
chemical=c("basic", "alkalin", "alkali", "acid", " ph ", "hss")
chemical_match <- str_c(chemical, collapse = "|")
chemical_match
concept_df$match[str_detect(concept_df$concept, chemical_match)] <-
"chemical"
concept_df
> concept_df
concept match
2011 Mar 30
1
CDR Mysql adaptive Colum
Hello folks, i installed asterisk 1.8 from repo:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Packages
And Looked at this article about CDR in mysl.
http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql
I installed asterisk-mysql pacakge from debian repo.
The cdr in mysql is working, but i can not get cdr adaptive colums are not,
i use this in my extension.conf
exten =>
2009 Dec 04
1
Converting a Matrix in a colum vector
Hi all,
Imagine I have a matrix G
with N rows
and M columns
So L=NxM is the number of different cells in my matrix.
I want to create a column vector F whose size will be F(L,1)
So the fisrt row in F is G(1,1)
Second row in F is G(1,2)
When we arrive to a point M
the element M+1 will be G(2, 1)
Element M+2 will be G(2,2) and so on.
I´m trying but allways error....
Easy Example:
G=
2 3 4
2011 Apr 23
1
How to delete an entire row, if a specific colum has the value of "#VALUE!"
I am importing CSV data with thousands of rows, if any row contains an error
from excel, the whole program crashes, so i need to delete all rows with the
value of #VALUE!, all other values are non-numeric...
I've tried a bunch of strategies, but nothing seems to work.
Thanks ahead of time guys,
Best,
Cody
--
View this message in context:
2009 Feb 22
1
Filtering a data frame using a string for colum header
Hi all,
I was just radomly playing with R and got the following error when
trying to filter a data frame using a string:
> Angel <- c(7,8,6,9,10)
> Buffy <- c(8,9,4,9,10)
> Firefly <- c(9,9,10,10,10)
> DrHorrible <- c(10,9,9,10,10)
> my.df <- data.frame(Angel, Buffy, Firefly, DrHorrible)
> my.df["DrHorrible"]
DrHorrible
1 10
2 9
3
2017 Jul 01
0
How to replace match words whith colum name of data frame?
Dear ?,
I'm sure that there are many ways to do what you want; here's one:
> cbind(concept_df, category=
+ ifelse(apply(
+ sapply(chemical_df$chemical,
+ function(x) grepl(x, concept_df$concept)),
+ 1, any),
+ "chemical", ""))
concept category
1 butan
2008 Jul 18
1
only "T" becomes logical colum with read.table
Hello,
I am a biologist and I am dealing with files composed of columns with T or A
or C or G (example below)
Sometimes a column is composed of only "T"
and in that case, the columns becomes a logical column TRUE (example below)
I know that the argument "as.is" controls the turns off turning a column
into a factor, instead becoming a character
Is there something similar for
2008 Mar 22
2
counting values on one colum only
Hi all:
Can someone help me count the
number of rows with values in
colum "a" only. assume the name
of my dataframe is "weekly"
I was trying
i<- nrows(weekly$a)
i
but returns 7 when it should
be 4. Thanks
a b c d
27.000
27.000
1.569 0.013 160.000 27.000
1.632 0.013 146.000 27.000
1.830 0.015 70.000 27.000
2.475 0.019
2006 Nov 29
2
db:migrate to add colum bombs...
Hi
I get the following when I try and run "rake db:migrate" (I"m running un
Ubuntu linux)
********** code **********
(in /<home hidden>)
== AddRpts: migrating
=========================================================
-- add_column("rpts", :integer, {:limit=>3})
rake aborted!
You have a nil object when you didn''t expect it!
You might have expected an
2007 May 29
2
summing up colum values for unique IDs when multiple ID's exist in data frame
I have data.frame's with IDs and multiple columns. B/c some of IDs showed up
more than once, I need sum up colum values to creat a new dataframe with
unique ids.
I hope there are some cheaper ways of doing it... Because the dataframe is
huge, it takes almost an hour to do the task. Thanks so much in advance!
Young
# ------------------------- examples are here and sum.dup.r is at the
2009 Dec 18
1
The RSQLite version of dbGetQuery drops colums
Hi all,
I just noticed (the hard way of course) that when a query returns 0
rows, the columns in the resulting data.frame get dropped as well. See
the following example code (where conn is an active connection to an
SQLite db):
> dbGetQuery(conn, "select 1 as hey, 2 as ho where 1")
hey ho
1 1 2
> dbGetQuery(conn, "select 1 as hey, 2 as ho where 0")
data frame
2009 Jan 05
1
How to extract range of colums in a data frame
Dear all,
I have the following data frame:
> dat
V1 V2 V3 V4 V5 V6 V7 V8 V9
1 1 AAAACACCCACCCCCCCCCCCCCCCCCCCCCCCC 9.0 18 12.00 18.0 15.0 12.0 6.0
2 1 ACGATACGGCGACCACCGAGATCTACACTCTTCC 18.0 8 12.00 18.0 15.0 12.0 18.0
3 1 ACTACTGCTCCCCCCCCACTCCCCCCCCCCCCCC 15.0 8 12.00 12.0 18.0 12.0 12.0
4 1 ACTTATACGGCGACCACCGAGATCTACACTCTTT 15.0
2011 Feb 24
1
Removing -Inf values from all the colums in a dataframe
Hi there,
b is my dataframe.
I have a dataframe. I am trying to get rid of the -INF values but didnt have
much luck
b[which(is.finite(b))]
I can get rid of it for a single column
b[,1][which(is.finite(b[,2]))] but not for all dataframe I used it inside of
a sapply but still no dice
my guess is it might have some differing row numbers and just ignoring the
columns itself.
Thanks
Ramya
2011 Jun 27
1
show colums x till end
Hey again,
I didn't wat questions to get mangled up, so here's my second email.
In matlab, there is the simple possibility to access colums x till last of a matrix using
mydata(1:3, 5:end).
In R, I so far use
mydata[1:3, 5:ncol(mydata)]
Is there a faster way? (in terms of typing)
Thanks ahead,
Berry
-------------------------------------
Berry Boessenkool
University of Potsdam,
2012 Jun 27
1
how to convert list of matrix (raster:extract o/p) to data table with additional colums (polygon Id, class)
Hi List,
I have a raster and a polygon with attribute ID and Class.
I want to have the fraction of each class present in each pixel of raster. I
have use the raster::extract to get the value and weights as below.
ex<-extract(raster,polygon,weighted=TRUE)
this gives me
[[1]]
value weight
13943 0.24
13958 0.02
13959 0.84
13960 0.19
13987 0.03
13988 0.31
13990 0.30
[[2]]
2012 Apr 25
1
Create new Vector based on two colums
Hello,
I am trying to get a new vector 'x1' based on the not NA-values in
column 'a' and 'b'. I found a way but I am sure this is not the best
solution. So any ideas on how to "optimize" this would be great!
m <- factor(c("a1", "a1", "a2", "b1", "b2", "b3", "d1", "d1"), ordered
2008 Apr 02
1
How to best read in this data / Switching rows and colums
Hi,
I have to read in data which looks like this:
SeriesA, 5, 5, 5, 5
SeriesB, 8, 5, 8, 8, 7, 10, 2, 7, 3
SeriesC, 5, 5, 8, 4, 7, 7, 4, 5
SeriesD, 5, 9, 5, 4, 2, 3, 10, 1
SeriesE, 7, 10, 9, 5, 8, 6, 10, 9, 5, 10, 4, 3, 2, 10, 8, 8, 10, 10, 10
SeriesF, 1, 2, 1, 5, 1, 7, 5, 7, 7, 3
There are actually much more data points in the data, each line contains
between 300 and 500 values.
If I use