similar to: transform key value pair to column

Displaying 20 results from an estimated 10000 matches similar to: "transform key value pair to column"

2010 Oct 07
3
aggregate text column by a few rows
Hi, R function aggregate can only take summary stats functions, can I aggregate text columns? For example, for the dataframe below, > a <- rbind(data.frame(id=1, name='Tom', hobby='fishing'),data.frame(id=1, name='Tom', hobby='reading'),data.frame(id=2, name='Mary', hobby='reading'),data.frame(id=3, name='John',
2010 Sep 16
3
get top n rows group by a column from a dataframe
Hi, is there an R function like sql's TOP key word? I have a dataframe that has 3 columns: company, person, salary How do I get top 5 highest paid person for each company, and if I have fewer than 5 people for a company, just return all of them? Thanks, Richard [[alternative HTML version deleted]]
2010 Nov 22
2
aggregate a Date column does not work?
Hi, I am trying to aggregate max a Date type column but have weird result, how do I fix this? > a <- rbind( + data.frame(name='Tom', payday=as.Date('1999-01-01')), + data.frame(name='Tom', payday=as.Date('2000-01-01')), + data.frame(name='Pete', payday=as.Date('1998-01-01')), + data.frame(name='Pete',
2010 Mar 09
5
data frame select max group by like function
Hi, I have a data frame with 3 columns: ID, year and score. How can I select for each unique ID, the year that has the max score? For example, for data frame ID, year, score tom, 1995, 88 rick, 1994, 90 mary, 2000, 97 tom, 1998, 60 mary, 1998,100 I shall have ID, year, score tom, 1995, 88 rick, 1994, 90 mary, 1998,100 Thanks, Richard [[alternative HTML version deleted]]
2009 Apr 13
3
toupper does not work in sub + regex
Hi, I don't know what I am doing wrong to the toupper does not seem working in sub + regex. The following returns 's' not the upper class 'S' as I expect: sub("q_([a-z])[a-zA-Z]*",toupper('\\1'),"q_sviRaw") Can someone tell me where I did wrong? Thanks, Richard [[alternative HTML version deleted]]
2009 Jul 19
1
transform(_data,...) using strptime gives an error
I have timstamped data like this: > sd[1:10,] Tstamp Density Mesh50 Mesh70 Mesh100 Mesh150 Mesh200 2 2009/02/27 07:00 30.5 0.7 10.7 21.4 32.8 41.6 3 2009/02/27 08:00 32.2 1.6 12.4 23.3 34.5 43.0 4 2009/02/27 09:00 32.7 4.8 13.0 24.0 35.1 43.5 5 2009/02/27 10:00 26.7 0.3 6.5 17.6 28.1 36.9 6 2009/02/27 11:00
2010 Jun 02
2
Faster union of polygons?
Dear R-helpers, thanks for yesterday's speeding-up tip. Here is my next query: I have lots of polygons (not necessarily convex ones, and they never have holes) given by x,y coordinates. I want to get the polygon that is the union of these polygons. This is my current method, but I am hoping there is a faster method (up to thousands of polygons, each with ca. 40 xy points). Example:
2010 Dec 17
0
[PATCH 1/4] Connector: Add an index to support key/value pair (KVP) functionality
Added a connector index to support key value/pair (KVP) functionality for Linux guests hosted on a HyperV platform. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> --- include/linux/connector.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/linux/connector.h b/include/linux/connector.h index 7e8ca75..2e9759c 100644 ---
2010 Dec 17
0
[PATCH 1/4] Connector: Add an index to support key/value pair (KVP) functionality
Added a connector index to support key value/pair (KVP) functionality for Linux guests hosted on a HyperV platform. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> --- include/linux/connector.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/linux/connector.h b/include/linux/connector.h index 7e8ca75..2e9759c 100644 ---
2011 Jan 27
3
how to divide each element of a matrix by a specific value per column
Hi, I'd like to divide each element of a matrix by a specific value per column. These specific values are stored in a list. For example: > x <- c(1,2,3,4,5) > y <- matrix(c(1:30), nrow = 6) Now I want to divide each element in y[,1] by x[1], y[,2] by x[2] etc. I have tried this > my_function <- function(data, ind) data/ind > apply(y, 2, my_function, x) [,1] [,2]
2005 Feb 22
0
[LLVMdev] Area for improvement
When I increased COLS to the point where the loop could no longer be unrolled, the selection dag code generator generated effectively the same code as the default X86 code generator. Lots of redundant imul/movl/addl sequences. It can't clean it up either. Only unrolling all nested loops permits it to be optimized away, regardless of code generator. Jeff Cohen wrote: > I noticed
2018 Jul 23
2
oddity in transform
Note the inconsistency in the names in these two examples. X.Time in the first case and Time.1 in the second case. > transform(BOD, X = BOD[1:2] * seq(6)) Time demand X.Time X.demand 1 1 8.3 1 8.3 2 2 10.3 4 20.6 3 3 19.0 9 57.0 4 4 16.0 16 64.0 5 5 15.6 25 78.0 6 7 19.8 42 118.8 >
2011 Mar 22
1
how to convert a data.frame to a list of dist objects for individual differences MDS?
I have a 45 x 16 data frame consisting of dissimilarities among 10 colors, giving in each column the 45 = 10*9/2 pairwise judgments for one of 16 subjects. The rownames identify each pair of colors, e.g, "AC" = ("A","C"), and the pairs are ordered by columns in the lower triangle of each distance matrix. > helm.raw <-
2011 Oct 12
2
Nonlinear regression aborting due to error
Colleagues, I am fitting an Emax model using nls. The code is: START <- list(EMAX=INITEMAX, EFFECT=INITEFFECT, C50=INITC50) CONTROL <- list(maxiter=1000, warnOnly=T) #FORMULA <- as.formula(YVAR ~ EMAX - EFFECT * XVAR^GAMMA / (XVAR^GAMMA + C50^GAMMA)) ## alternate version of formula FORMULA <- as.formula(YVAR ~ EMAX - EFFECT / (1 + (C50/XVAR)^GAMMA)) FIT <-
2010 Dec 17
0
[PATCH 4/4] Staging: hv: Add a user-space daemon to support key/value pair (KVP)
All guest specific data gathering is implemented in a user-mode daemon. The kernel component of KVP passes the "key" to this daemon and the daemon is responsible for passing back the corresponding value. This daemon communicates with the kernel component via a netlink channel. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> --- drivers/staging/hv/tools/hv_kvp_daemon.c
2010 Dec 17
0
[PATCH 4/4] Staging: hv: Add a user-space daemon to support key/value pair (KVP)
All guest specific data gathering is implemented in a user-mode daemon. The kernel component of KVP passes the "key" to this daemon and the daemon is responsible for passing back the corresponding value. This daemon communicates with the kernel component via a netlink channel. Signed-off-by: K. Y. Srinivasan <ksrinivasan at novell.com> --- drivers/staging/hv/tools/hv_kvp_daemon.c
2006 Sep 17
0
inserting utf8 value in unique column generates unexpected duplicate key error
I''m inserting the french word for "Hotel" (with a circumflex over the ''o'') into a column that is a unique key on a table. Apparently the insert statement is truncating the string to "H". Additionally, when rails tries to select the french word for "Hotel", the string is not truncated and the inserted record is not returned. Presumably, I
2008 Dec 03
1
how to handle irregularly spaced data as timeseries
I have a set of modeled climate data recorded at irregular intervals. The format of the data is such that there are monthly measurements for the years 2000, 2020, 2050, 2080, etc. Therefore I have 12 regular records, a skip of some number of years, then 12 more monthly records, another skip, and so on.... I created a dataframe from .txt with the read.table() command. For starters I need
2018 Jul 24
2
oddity in transform
The idea is that one wants to write the line of code below in a general way which works the same whether you specify ix as one column or multiple columns but the naming entirely changes when you do this and BOD[, 1] and transform(BOD, X=..., Y=...) or other hard coding solutions still require writing multiple cases. ix <- 1:2 transform(BOD, X = BOD[ix] * seq(6)) On Tue, Jul 24, 2018 at
2010 Oct 29
1
Tukey post hoc comparison (glht?) after 3factorial mixed model (lmer)
Hello, dear R-community. This is a question about TukeyHSD between factor combinations of a Three-Way ANOVA, which is - since it is a multi measure ANOVA - not a simple ANOVA but a Generalised Linear Mixed Model (GLMM), calculated with "lmer". > growth <- groupedData(length~meas|box_id,outer=~spec*comp*water,data=all.spec) > model <-