similar to: FUN argument to return a vector in aggregate function

Displaying 20 results from an estimated 900 matches similar to: "FUN argument to return a vector in aggregate function"

1998 Oct 22
1
crosstab means
I would like to obtain a crosstabulation of means(var, quantiles...) i.e. I have a data frame with Var-i, Var-j, Var-k, Var-X, var-Y I like to have the mean of Var-X for each combination of Var-i,Var-j. One solution would be: by(var-i,Var-j,mean(Var-x)) but I would like it better formatted and with mean,S.Dev,n for each cell? Does anybody have some function to do this or some ideas how to go
2009 May 04
4
Splitting a vector into equal groups
Hi All, I have vector of length 52, say, x=sample(30,52,replace=T). I want to sort x and split into five *nearly equal groups*. Note that the observations are repeated in x so in case of a tie I want both the observations to fall in same group. This seems a very common task to do, but still I couldn't find an R function to do this. Any help would be highly appreciated. Regards Utkarsh
2009 Jun 30
4
R version-2.9.1 for Linux
Hi All, I am currently using R version 2.8.1 on linux cent os 4.4 (i386) and want to upgrade to version 2.9.1. It seems to me that version-2.9.1 is it not for my OS. Am I right? Regards Utkarsh [[alternative HTML version deleted]]
2010 Dec 17
1
[Fwd: adding more columns in big.matrix object of bigmemory package]
Hi, With reference to the mail below, I have large datasets, coming from various different sources, which I can read into filebacked big.matrix using library bigmemory. I want to merge them all into one 'big.matrix' object. (Later, I want to run regression using library 'biglm'). I am unsuccessfully trying to do this from quite some time now. Can you please
2009 May 18
2
intermediate iterations of stepwise regression
Hi all, I am performing a stepwise regression by running the "step" function on an "lm" object. Now I want to save the intermediate iterations. I know the argument trace=T will print it on the console, but I rather want to assign it to some R object or may be output it in a CSV or text file. Any help will be appreciated. Regards Utkarsh
2009 Jun 02
2
bigmemory - extracting submatrix from big.matrix object
I am using the library(bigmemory) to handle large datasets, say 1 GB, and facing following problems. Any hints from anybody can be helpful. _Problem-1: _ I am using "read.big.matrix" function to create a filebacked big matrix of my data and get the following warning: > x = read.big.matrix("/home/utkarsh.s/data.csv",header=T,type="double",shared=T,backingfile
2011 May 14
2
calling "exists" function inside another function is not working
Hi all, I want to define a function such that one of its argument if passed do one thing and if not passed do the second thing. So basically, I have to check whether the argument is passed or not inside the function. I am trying to use 'exists' function to do this. > f = function(a,b){exists("b")} > f(a=3, b=4) [1] TRUE This is working as expected.
2011 May 14
2
calling "exists" function inside another function is not working
Hi all, I want to define a function such that one of its argument if passed do one thing and if not passed do the second thing. So basically, I have to check whether the argument is passed or not inside the function. I am trying to use 'exists' function to do this. > f = function(a,b){exists("b")} > f(a=3, b=4) [1] TRUE This is working as expected.
2009 May 27
3
Defining functions - an interesting problem
I define the following function: (Please don't wonder about the use of this function, this is just a simplified version of my actual function. And please don't spend your time in finding an alternate way of doing the same as the following does not exactly represent my function. I am only interested in a good explanation) > f1 =
2009 Apr 30
2
problem in as.date
I never understood that why is the value returned by as.date function in the library(survival) never matches with the description given in the help file: Following is the extract from ?as.date Description: Converts any of the following character forms to a Julian date: 8/31/56, 8-31-1956, 31 8 56, 083156, 31Aug56, or August 31 1956. Usage: as.date(x, order = "mdy", ...)
2020 May 02
1
issues with environment handling in model.frame()
Dear all, model.frame behaves in a way I don't expect when both its formula and subset argument are passed through a function call. This works as expected: model.frame(~wool, warpbreaks, breaks < 15) #> wool #> 14 A #> 23 A #> 29 B #> 50 B fun1 <- function(y) model.frame(~wool, warpbreaks, y) fun1(with(warpbreaks, breaks < 15)) #> wool #> 14
2009 Sep 14
1
setting plotting device
Hi All, I have recently *re*-installed R-2.9.1 in my Linux machine. Since then, I am unable to plot using the usual interactive device. > plot(1:10) This plots in a pdf file "Rplots.pdf" in my working directory. > sessionInfo() R version 2.9.1 (2009-06-26) i686-pc-linux-gnu locale:
2018 Jan 07
2
SpreadLevelPlot for more than one factor
Dear All, I want a transformation which will make the spread of the response at all combinations of 2 factors the same. See for example : boxplot(breaks ~ tension * wool, warpbreaks) The closest I can do is : spreadLevelPlot(breaks ~tension , warpbreaks) spreadLevelPlot(breaks ~ wool , warpbreaks) I want to do : spreadLevelPlot(breaks ~tension * wool, warpbreaks) But I get : >
2018 Jan 07
2
SpreadLevelPlot for more than one factor
Dear Ashim, Try spreadLevelPlot(breaks ~ interaction(tension, wool), data=warpbreaks) . I hope this helps, John ----------------------------- John Fox, Professor Emeritus McMaster University Hamilton, Ontario, Canada Web: socialsciences.mcmaster.ca/jfox/ > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Ashim > Kapoor > Sent:
2018 Jan 09
0
SpreadLevelPlot for more than one factor
Dear Sir, Many thanks for your reply. I have a query. I have a whole set of distributions which should be made normal / homoscedastic. Take for instance the warpbreaks data set. We have the following boxplots for the warpbreaks dataset: a. boxplot(breaks ~ wool) b. boxplot(breaks ~ tension) c. boxplot(breaks ~ interaction(wool,tension)) d. boxplot(breaks ~ wool @ each level of tension) e.
2018 Jan 14
1
SpreadLevelPlot for more than one factor
Dear Ashim, I?ll address your questions briefly but they?re really not appropriate for this list, which is for questions about using R, not general statistical questions. (1) The relevant distribution is within cells of the wool x tension cross-classification because it?s the deviations from the cell means that are supposed to be normally distributed with equal variance. In the warpbreaks data
2012 Nov 29
2
Deleting certain observations (and their imprint?)
I'm manipulating a large dataset and need to eliminate some observations based on specific identifiers. This isn't a problem in and of itself (using which.. or subset..) but an imprint of the deleted observations seem to remain, even though they have 0 observations. This is causing me problems later on. I'll use the dataset warpbreaks to illustrate, I apologize if this isn't in
2012 Oct 23
1
How Rcmdr or na.exclude blocks TukeyHSD
Dear R-Helpers, I was calling the TukeyHSD function and not getting confidence intervals or p-values. It turns out this was caused by missing data and the fact that I had previously turned on R Commander (Rcmdr). John Fox knew that Rcmdr sets na.action to na.exclude, which causes the problem. If you have this problem, you can either exit Rcmdr before calling TukeyHSD or you can set na.action to
2018 Jan 07
0
SpreadLevelPlot for more than one factor
Dear All, we need to do : library(car) for the spreadLevelPlot function I forgot to say that. Apologies, Ashim On Sun, Jan 7, 2018 at 10:37 AM, Ashim Kapoor <ashimkapoor at gmail.com> wrote: > Dear All, > > I want a transformation which will make the spread of the response at all > combinations > of 2 factors the same. > > See for example : > >
2009 Jun 16
1
Testing if all elements are equal in a vector/matrix
Hi All, There are several replies to the question below, but I think there must exist a better way of doing so. I just want to check whether all the elements of a vector are same. My vector has one million elements and it is highly likely that there are distinct elements in the first few itself. For example: > x = c(1,2,rep(1,100000)) I want the answer as FALSE, which is clear from the