similar to: Aggregate and select mode

Displaying 20 results from an estimated 3000 matches similar to: "Aggregate and select mode"

2011 Oct 11
1
Background Colors
Hi R-Help - If I make a plot: numYears = 500 plot(x = c(1,numYears), y = c(200,300), xlab = "Time", ylab = "Vegetation Class", xlim = c(100,600), ylim = c(200,300), type="n") Is there a way to make different parts of the background for the plot different colors? For example, I'd like to have the background color col = (250,250,0,50) for y = c(200,204), and col
2011 Aug 10
1
Plotting Ellipses and Points of Matching Colors in an Ordination
Hello, R-Help - I am trying to plot the results of an ordination from package vegan. The tricky part for me right now is getting the colors of the ellipses denoting the 95% confidence intervals of the group centroids to match the colors of the points for those same groups. >From and earlier post, I saw the code to make a plot of the ordination using different colors for my different groups.
2012 Mar 08
2
Boxplot Fill Pattern
Hello R Help! I would like to make a legible boxplot of tree growth rates for each of seven tree species at each of seven different sites. It's a lot of data to put on one figure, I know. I made a beautiful, interpretable figure using color, but my target journal can't deal with color figures. I can use seven shades of grey to fill the boxes, but the figure then becomes uninterpretable -
2010 Jun 27
2
Ways to work with R and Postgres
Hi, I post this message to the general r-help list hoping anyone within a wider range have suggestions: There are three ways to integration R and postgres, especially on 64bit Microsoft windows Platform, 1. via RODBC package, which has 32 bit and 64 bit version for windows 2. via RPostgres interface, which only has 32bit version currently 3. via plr for Greenplum, which only supports a
2011 Nov 08
2
multi-line query
Hello, I'm using package RpgSQL. Is there a better way to create a multi-line query/character string? I'm looking for less to type and readability. This is not very readable for large queries: s <- 'create table r.BOD("id" int primary key,"name" varchar(12))' I write a lot of code, so I'm looking to type less than this, but it is more readable from
2010 May 17
3
Create counter variable for subsets without a loop
Hi all, I am looking to create a rank variable based on a continuous variable for subsets of the data. For example, for an R integrated data set about US states this is how a loop could create what I want: ### Example with loop data <- cbind(state.region,as.data.frame(state.x77))[,1:2] # choosing a subset of the data data <- data[order(data$state.region, 1/data$Population),] #
2006 Oct 21
2
problem with mode of marginal distriubtion of rdirichlet{gtools}
Hi all, I have a problem using rdirichlet{gtools}. For Dir( a1, a2, ..., a_n), its mode can be found at $( a_i -1)/ ( \sum_{i}a_i - n)$; The means are $a_i / (\sum_{i} a_i ) $; I tried to study the above properties using rdirichlet from gtools. The code are: ############## library(gtools) alpha = c(1,3,9) #totoal=13 mean.expect = c(1/13, 3/13, 9/13) mode.expect = c(0, 2/10, 8/10) #
2010 Sep 06
3
Failure to aggregate
I have a (very big - 1.5 rows) dataframe with a (POSIXt" "POSIXlt") column h (hour). Surprisingly, I cannot calculate a simple aggregate over the dataframe. > n.h1 = sqldf("select distinct h, count(*) from x group by h") Error in sqliteExecStatement(con, statement, bind.data) : RS-DBI driver: (error in statement: no such table: x) In addition: Warning message: In
2009 Nov 16
1
How to use SQL code in R
Dear All, How to use SQL code in R? Thanks! [[alternative HTML version deleted]]
2013 Sep 17
1
ayuda con aggregate
Hola, ¿qué tal? Creo que la forma más limpia es usar la función ddply de plyr aproximadamente así: ddply(mis.datos, .(B, C), summarise, mean.X2 = mean(X2), medianX4 = median(X4), etc. ) La sección "Using ddply" de http://www.cookbook-r.com/Manipulating_data/Summarizing_data/ lo expica bastante bien. Un saludo, Carlos J. Gil Bellosta
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 03
2
uint decode error on visual studio...
Is this a common warning? The decoder doesn't return an error on it, but I see it a lot in my test application on windows. It is non existent on my linux box. I haven't tried mingw yet. please note that I'm using visual studio 2008 w/the vcproj that Bjoern Rasmussen made for 0.5.2 (w/some file references removed) at the moment and it is giving a lot of C4554 warnings
2010 Jul 16
2
aggregate(...) with multiple functions
hi all - i'm just wondering what sort of code people write to essentially performa an aggregate call, but with different functions being applied to the various columns. for example, if i have a data frame x and would like to marginalize by a factor f for the rows, but apply mean() to col1 and median() to col2. if i wanted to apply mean() to both columns, i would call: aggregate(x, list(f),
2010 Jan 04
4
function in aggregate applied to specific columns only
I want to use aggregate with the mean function on specific columns gender <- factor(c("m", "m", "f", "f", "m")) student <- c(0001, 0002, 0003, 0003, 0001) score <- c(50, 60, 70, 65, 60) basicSub <- data.frame(student, gender, score) basicSubMean <- aggregate(basicSub, by=list(basicSub$student), FUN=mean, na.rm=TRUE) This
2008 Jan 26
3
Comparison of aggregate in R and group by in mysql
Hi, netters, First of all, thanks a lot for all the prompt replies to my earlier question about "merging" data frames in R. Actually that's an equivalence to the "join" clause in mysql. Now I have another question. Suppose I have a data frame X with lots of columns/variables: Name, Age,Group, Type, Salary. I wanna do a subtotal of salaries: aggregate(X$Salary,
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',
2009 Oct 20
1
RPgSQL installation problem
Hi everybody I am trying to install RPsSQL and get the following error message: When I do ./configure form the untarred source directory I get loading cache ./config.cache checking for crypt in -lcrypt... no No crypt function found When I use the Package installer in R I get install.packages("/Users/christiaanpauw/tmp/RPgSQL/", , NULL, type = "source") Warning in
2003 Feb 11
4
postgres
Is anyone using R with postgres? I'd like to do so, but cannot seem to find any reasonable explanation of how to do so. Joshua Gramlich Chicago, IL
2010 Mar 22
1
SQL-select using native R methods ?
Hi I have a problem in R that I have been trying to solve but without success. I am trying to join two tables on two variables : an ID and a date (optional) that will be common between the two tables In SQL (and SAS PROC SQL) I am a frequent user of the "select" command and I am used to the following nomenclature : select a.*, b.c, b.y, b.z from table1 a, table2 b where
2003 Feb 11
1
RPgSQL W2K
Hi, i found tis message in the archive and have got the same problems ? John, perhaps you have found now a way install RPgSQL for windows2000, or anybody other ? many thanks for advance christian [SNIP] I wonder whether anyone has succeeded in building either the RPgSQL or the Rdbi.PGSQL and Rdbi packages for Windows. If so, would you be willing to share either the binary package(s) or