similar to: Using split and sapply to return entire lines

Displaying 20 results from an estimated 2000 matches similar to: "Using split and sapply to return entire lines"

2007 Oct 04
4
Matrix bar plot
Hello, Does R have any facility to create a plot that looks similar to this: http://www.augustcouncil.com/~tgibson/barmatrix.jpg Thank you, -TAG Todd A. Gibson
2006 Sep 18
1
Legend frame error (PR#9236)
Hello, The frame drawn around the legend appears to miscalculate when the x-axis decreases rather than increases. Pasted below is a simple testcase. When the x-axis decreases, the width of the legend frame appears to be calculated based on the length of the first item, rather than the maximum length of all items. Thanks, -TAG Todd A. Gibson line1=dpois(seq(0,50), 10) par(mfcol=c(2,1))
2001 Aug 23
3
Reading SAS version 8 data into R
Hi, SAS transport files created with the xport engine in SAS can be read using read.xport. However, the xport engine only works with SAS version 6, and consequently long variable names are not allowed... Can anyone tell me how to get SAS data (ver 8) into R (easily)? Thanks in advance S?ren H?jsgaard sorenh at agrsci.dk http://www.jbs.agrsci.dk/~sorenh
2004 May 04
2
Seeing the definition of a function
Dear all, I was trying to see how the function 'confint' is defined. Doing > confint function (object, parm, level = 0.95, ...) UseMethod("confint") <environment: namespace:stats> does not really enlighten me. How can I get to see the implementation (I guess it should be possible according to the general philosophy of the R project)? Thanks in advance S??ren
2005 Sep 30
4
by() processing on a dataframe
I want to calculate a statistic on a number of subgroups of a dataframe, then put the results into a dataframe. (What SAS PROC MEANS does, I think, though it's been years since I used it.) This is possible using by(), but it seems cumbersome and fragile. Is there a more straightforward way than this? Here's a simple example showing my current strategy: > dataset <-
2002 Dec 09
2
R as a COM client - is it possible?
Dear all, In S+, there are functions like create.ole.object call.ole.method release.ole.object for communicating with other programs which work as a COM server (on Windows). Is it possible to do something similar in R (I've studied the 'connections' facilities, but they do not seem to work). ========================================== S?ren H?jsgaard, PhD, Senior Scientist
2006 Jan 03
1
Summary functions to dataframe
I have written a few different summary functions. I want to calculate the statistics by groups and I am having trouble getting the output as a dataframe. I have attached one example with a small dataset that calculates summary stats and percentiles, I have others that calculate upper confidence limits etc. I would like the output to be converted to a dataframe with one of the columns as the
2005 Jul 12
4
Calculation of group summaries
I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples which come close to what I want but are proving difficult for me to modify for my use. Calculating simple group means is fairly straight forward: data(PlantGrowth) attach(PlantGrowth) stack(mean(unstack(PlantGrowth)))
2010 Mar 17
2
Using nrow with summaryBy
Hello Everyone- I'm calculating summary statistics on a dataset (~4000 records, observations are not uniformly distributed) using summaryBy and trying to add a column with the number of observations to the output as well. What occurs to me is to use nrow(), but this doesn't appear to be working I'm able to replicate the same results with an example from the summaryBy docs:
2014 Jan 02
2
Installing RCurl -
Dear all, I am trying to install RCurl (because I want to install devtools) and to do so I've been informed that I must install one of the packages libcurl4-openssl-dev libcurl4-nss-dev No matter which one I install I get the following error from R: * installing *source* package ‘RCurl’ ... ** package ‘RCurl’ successfully unpacked and MD5 sums checked checking for curl-config...
2011 Jan 17
2
Using summaryBy with weighted data
Dear Soren and R users: I am trying to use the summaryBy function with weights. Is this possible? An example that illustrates what I am trying to do follows: library(doBy) ## make up some data response = rnorm(100) group = c(rep(1,20), rep(2,20), rep(3,20), rep(4,20), rep(5,20)) weights = runif(100, 0, 1) mydata = data.frame(response,group,weights) ## run summaryBy without weights:
2004 May 27
1
Crossed random effects in lme
Dear all, In the SASmixed package there is an example of an analysis of a split-plot experiment. The model is fm1Semi <- lme( resistance ~ ET * position, data = Semiconductor, random = ~ 1 | Grp) where Grp in the Semiconductor dataset is defined as ET*Wafer. Is it possible to specify the grouping directly some way, e.g. like fm1Semi <- lme( resistance ~ ET * position, data =
2006 Oct 08
1
Windows/MAC difference (console)
Hello, a colleague of mine uses R on his Mac and he has quite a nice feature: When he starts writing a part of the function like "plot(" the programming is showing him at the bottom the kind of arguments you can input to the function. He told me that he has not installed any further stuff than the base R program. Is this a feature you only have in the MAC version? I really like it. I
2012 Apr 02
2
summaryBy: transformed variable on RHS of formula?
Hi Folks, I'm trying to cut my data inside the summaryBy function. Perhaps formulas don't work that way? I'd like to avoid adding another column if possible, but if I have to, I have to. Any ideas? Thanks, Allie require(doBy) df = dataframe(a <- rnorm(100), b <-rnorm(100)) summaryBy(a ~ cut(b,c(-100,-1,1,100)), data=df) # preferred solution, but it throws an
2013 Jan 17
3
how to use "..."
Dear users, I'm trying to learn how to use the "...". I have written a function (simplified here) that uses doBy::summaryBy(): # 'dat' is a data.frame from which the aggregation is computed # 'vec_cat' is a integer vector defining which columns of the data.frame should be use on the right side of the formula # 'stat_fun' is the function that will be run to
2006 Dec 05
1
summaryBy(): Is it the best option?
Hi, since I have quite large tables and the processing takes quite a while I am curious if I can improve the performance of this aggregation somehow: At the moment I am using summaryBy from the doBy package under R 2.4.0, Win2K. summaryBy(soc_s6aq5 + soc_s6aq7 + soc_s6aq9 + soc_s6aq11 ~ hh + comgroup,soc6a,postfix=c("","","",""),FUN=sum, na.rm=T) The
2010 May 07
4
Any way to apply TWO functions with tapply()?
I need to compute the mean and the standard deviation of a data set and would like to have the results in one table/data frame. I call tapply() two times and do then merge the resulting tables to have them all in one table. Is there any way to tell tapply() to use the functions mean and sd within one function call? Something like tapply(data$response, list(data$targets, data$conditions), c(mean,
2007 Feb 15
1
Problem in summaryBy
The R script below gives values of 1 for all minimum values when I use a custom function in summaryBy. I get the correct values when I use FUN=min directly. Any help is much appreciated. The continuous information provided in this forum is fabulous as are the different R packages available. Rene # Simulated simplified data Subj <- rep(1:4, each=6) Analyte <-
2006 Feb 14
2
How to handle large dataframes?
Dear all I imported a Stata .dta file with the read.dta-function from the foreign-package. The dataframe's dimensions are > dim(d.apc) [1] 15806 1300 Importing needs up to 15 min and calculations with these data are rather slow (although I subset the data before starting analyses). My questions are: 1. Has someone experiences importing Stata files (alternatives to read.dta) ? 2.
2006 Jul 10
1
Counting observations split by a factor when there are NAs in the data
I am a very novice R user, a social scientist (linguist) who is trying to learn to use R after being very familiar with SPSS. Please be kind! My concern: I cannot figure out a way to get an accurate count of observations of one column of data split by a factor when there are NAs in the data. I know how to use commands like tapply and summaryBy to obtain other summary statistics I am interested