similar to: Grouping by factors in R

Displaying 20 results from an estimated 100 matches similar to: "Grouping by factors in R"

2012 Aug 07
5
summing and combining rows
Hello, I have a data set that needs to be combined so that rows are summed by a group based on a certain variable. I'm pretty sure rowsum() or rowsums() can do this but it's difficult for me to figure out how it will work for my data based on the examples I've read. My data are structured like this: Plot SizeClass Stems 12 Class3 1 12 Class4
2012 Apr 05
2
count() function
I keep expecting R to have something analogous to the =count function in Excel, but I can't find anything. I simply want to count the data for a given category. I've been using the ddply() function in the plyr package to summarize means and st dev of my data, with this code: ddply(NZ_Conifers,.(ElevCat, DataSource, SizeClass), summarise, avgDensity=mean(Density),
2011 Feb 25
4
means, SD's and tapply
I'm trying to use tapply to output means and SD or SE for my data but seem to be limited by how many times I can subset it. Here's a snippet of my data > stems353[1:10,] Time DataSource Plot Elevation Aspect Slope Type Species SizeClass Stems 1 Modern Cameron 70F221 1730 ESE 20 Conifer ABCO Class1 3 2 Modern Cameron 70F221 1730
2012 Oct 11
2
extracting groups from hclust() for a very large matrix
Hello, I'm having trouble figuring out how to see resulting groups (clusters) from my hclust() output. I have a very large matrix of 4371 plots and 29 species, so simply looking at the graph is impossible. There must be a way to 'print' the results to a table that shows which plots were in what group, correct? I've attached the matrix I'm working with (the whole thing
2006 Jan 19
1
nls profiling with algorithm="port" may violate bounds (PR#8508)
[posted to R-devel, no discussion: resubmitting it as a bug, just so it gets logged appropriately] Sorry to report further difficulties with nls and profiling and constraints ... the problem this time (which I didn't check for in my last round of testing) is that the nls profiler doesn't seem to respect constraints that have been set when using the port algorithm. See test code
2008 Jun 18
1
Maximum Likelihood Estimation
Using R, I would like to calculate algorithms to estimate coefficients á and â within the gamma function: f(costij)=((costij)^á)*exp(â*costij).  I have its logarithmic diminishing line data (Logarithmic Diminishing Line Data Table) and have installed R¢s Maximum Likelihood Estimation package; however, I am unsure which method to apply in order to calculate the algorisms (i.e., Newton-Raphson
2005 Nov 28
1
using minor tickmarks with xYplot
Hi all, I'm trying to make a plot with the function xYplot from package Hmisc in R. I would like to have minor tick-marks on the axis. This should be a common simple feature to have but I don't seem to find any discussion on the topic. Following is one of the things I tried and the error returned: xYplot(y~x,data.frame(x=seq(1,10),y=runif(10)),minor.ticks=c(3.5,5.5)) Error in
2012 Mar 25
2
avoiding for loops
I have data that looks like this: > df1 group id 1 red A 2 red B 3 red C 4 blue D 5 blue E 6 blue F I want a list of the groups containing vectors with the ids. I am avoiding subset(), as it is only recommended for interactive use. Here's what I have so far: df1 <- data.frame(group=c("red", "red", "red", "blue",
2019 Nov 22
1
[PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
On Fri, Nov 22, 2019 at 12:30:20PM +0100, Rafael J. Wysocki wrote: > On Fri, Nov 22, 2019 at 11:36 AM Mika Westerberg > <mika.westerberg at intel.com> wrote: > > > > On Thu, Nov 21, 2019 at 11:39:23PM +0100, Rafael J. Wysocki wrote: > > > On Thu, Nov 21, 2019 at 8:49 PM Mika Westerberg > > > <mika.westerberg at intel.com> wrote: > > > >
2006 Jan 17
0
nls profile with port/constraints
Sorry to report further difficulties with nls and profiling and constraints ... the problem this time (which I didn't check for in my last round of testing) is that the nls profiler doesn't seem to respect constraints that have been set when using the port algorithm. See test code below ... If I can I will try to hack the code, but I will probably start by redefining my function with
2019 Nov 20
1
[PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
Hi Karol, On Tue, Nov 19, 2019 at 11:26:45PM +0100, Karol Herbst wrote: > On Tue, Nov 19, 2019 at 10:50 PM Bjorn Helgaas <helgaas at kernel.org> wrote: > > > > [+cc Dave] > > > > On Thu, Oct 17, 2019 at 02:19:01PM +0200, Karol Herbst wrote: > > > Fixes state transitions of Nvidia Pascal GPUs from D3cold into higher device > > > states. > >
2019 Nov 22
0
[PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
On Fri, Nov 22, 2019 at 12:52 PM Mika Westerberg <mika.westerberg at intel.com> wrote: > [cut] [I'm really running out of time for today, unfortunately.] > > > > The current design is mostly based on the PCI PM Spec 1.2, so it would > > > > be consequent to follow system-wide suspend in PM-runtime and avoid > > > > putting PCIe ports holding
2012 Jun 05
0
Improper coding for an offset in vglm()?
Hello R-help. I believe I may be coding the offset incorrectly in my formula. I am testing significance between different group pairings using the VGAM package. My data are zero-truncated and poisson-distributed and overdispersed, so I'm using the posnegbinomial function in vglm (code below). I've spent a very long time working out this model and am pretty sure it's the best for
2013 Feb 06
3
how to "multiply" list of matrices by list of vectors
Hi everyone, I'd like to be able to apply lda to each 2D matrix slice of a 3D array, and then use the scalings to obtain the corresponding lda scores. I can use 'apply' to get a list of the lda output for each 2D slice, and can create a list of the resulting scalings, but I'm not sure how to multiply them in a vectorized way. Here's how I made a list of 2D matrices
2005 Jan 21
6
how to use do.call("rbind", get(list(mlist)))
I have around 200 data frames I want to rbind in a vectorized way. The object names are: m302 m303 ... m500 So I tried: mlist <- paste("m",302:500,sep="") dat <- do.call("rbind", get(list(mlist))) and I get "Error in get(x, envir, mode, inherits) : invalid first argument" I know "rbind" is valid because dat <- rbind(m302, m303,
2019 Nov 22
3
[PATCH v4] pci: prevent putting nvidia GPUs into lower device states on certain intel bridges
On Thu, Nov 21, 2019 at 11:39:23PM +0100, Rafael J. Wysocki wrote: > On Thu, Nov 21, 2019 at 8:49 PM Mika Westerberg > <mika.westerberg at intel.com> wrote: > > > > On Thu, Nov 21, 2019 at 04:43:24PM +0100, Rafael J. Wysocki wrote: > > > On Thu, Nov 21, 2019 at 1:52 PM Mika Westerberg > > > <mika.westerberg at intel.com> wrote: > > > >
2011 Nov 26
2
simplify source code
Hi I would like to shorten mod1 <- nls(ColName2 ~ ColName1, data = table, ...) mod2 <- nls(ColName3 ~ ColName1, data = table, ...) mod3 <- nls(ColName4 ~ ColName1, data = table, ...) ... is there something like cols = c(ColName2,ColName3,ColName4,...) for i in ... mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...) I am looking forward to help Christof
2005 Sep 01
1
More block diagonal matrix construction code
Folks: In answer to a query, Andy Liaw recently submitted some code to construct a block diagonal matrix. For what seemed a fairly straightforward task, the code seemed a little "overweight" to me (that's an American stock analyst's term, btw), so I came up with a slightly cleaner version (with help from Andy): bdiag<-function(...){ mlist<-list(...) ## handle case in
2008 Aug 11
3
Exporting a list of lists
I have a list List(Sku=" ", Shape=1, Scale=3, DayOfYear=daylist) Note: picture daylist as c(2,3,4,3) it is a list with variable length. Then I have a list of lists al <- c(al, List(List(Sku=" ", Shape=1, Scale=3, DayOfYear=daylist)) Note: same comment on daylist as above. So far this creates a list of lists just how I want it. If I do al[1] I get each member and the
2010 Aug 05
18
dot-containing foldernames \HasNoChildren bug ?
Hello, we experience problems with dovecot configuration using the listescape plugin to allow dots in foldernames. In some mail clients, dot-containing folders won't show any subfolders. This seems to be related to the fact that the \HasNoChildren flag is set on such folders even if subfolders do exits. Here is an example from telnet session: * LIST (\HasNoChildren) "/"