Displaying 20 results from an estimated 10000 matches similar to: "Finding Highest value in groups"
2016 Apr 22
1
Finding Highest value in groups
Since the aggregate S3 method for class formula already has got na.action = na.omit,
## S3 method for class 'formula'
aggregate(formula, data, FUN, ...,
subset, na.action = na.omit)
I think that to deal with NA's, it is enough:
aggregate(Value~ID, dta, max)
Moreover, passing na.rm = FALSE/TRUE is "don't care":
aggregate(Value~ID, dta, max, na.rm=FALSE)
2016 Apr 22
0
Finding Highest value in groups
Assuming your dataframe is in a variable x:
> require(dplyr)
> x %>% group_by(ID) %>% summarise(maxVal = max(Value,na.rm=TRUE))
On Fri, 2016-04-22 at 13:51 +0000, Saba Sehrish via R-help wrote:
> Hi
>
>
> I have two columns in data frame. First column is based on "ID" assigned to each group of my data (similar ID depicts one group). From second column, I
2016 Apr 22
2
Finding Highest value in groups
Hi
I have two columns in data frame. First column is based on "ID" assigned to each group of my data (similar ID depicts one group). From second column, I want to identify highest value among each group and want to assign the same ID to that highest value.
Right now the data looks like:
ID Value
1 0.69
1 0.31
2 0.01
2 0.99
3 1.00
4 NA
4
2003 Apr 11
2
princomp with not non-negative definite correlation matrix
$ R --version
R 1.6.1 (2002-11-01).
So I would like to perform principal components analysis on a 16X16
correlation matrix, [princomp(cov.mat=x) where x is correlation matrix],
the problem is princomp complains that it is not non-negative definite.
I called eigen() on the correlation matrix and found that one of the
eigenvectors is close to zero & negative (-0.001832311). Is there any
way
2010 Mar 31
1
Weird R behaviour?
Dear list,
I have observed a weird behaviour from R --- apologies if I am missing
something obvious!
df3f826f28
df3f826f28
Say you type in R:
>c.preec <- 10074
>c.gd <- 2200
>p1 <- .2
>c.neo <- p1*9451 + (1-p1)*3883
>n.preec <- 3710
>n.gd <- 2650
>n.neo <- 2120
>n.pcos <- 53000
>unit.met <- 94
>cost.met <- 94*n.pcos
>effect <-
2007 Sep 18
0
[LLVMdev] 2.1 Pre-Release Available (testers needed)
Hi,
LLVM 2.1-pre1 test results:
Linux (SUSE) on x86 (P4)
Release mode, but with assertions enabled
LLVM srcdir == objdir
# of expected passes 2250
# of expected failures 5
I ran the llvm-test suite on my desktop while I was also working on that PC,
so don't put too much trust in the timing info. Especially during the "spiff"
test the machine was swapping
2008 Jan 28
0
[LLVMdev] 2.2 Prerelease available for testing
Target: FreeBSD 7.0-RC1 on amd64.
autoconf says:
configure:2122: checking build system type
configure:2140: result: x86_64-unknown-freebsd7.0
[...]
configure:2721: gcc -v >&5
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070719 [FreeBSD]
[...]
objdir != srcdir, for both llvm and gcc.
Release
2010 Apr 30
0
extracting pairs from correlation matrix and p-value matrix
Dear All,
I am working on a large matrix of dimension 20000x700 say 'mat'. I
have calculated pearson correlation for the rows of the matrix and
their p-values using rcorr function in library Hmisc. Now I wish to
filter out those pairs who's PCC value is above 0.8 cut off and
p-value is less than 0.05.
>library(Hmisc)
>mat_cor=rcorr(t(mat),type="pearson")
2013 Nov 23
0
[LLVMdev] pb05 benchmarks for llvm 3.3/3.4svn
Below are the results for the Polyhedron 2005 benchmarks compiled with the llvm/compiler-rt/dragonegg 3.3
release and 3.4svn against FSF gcc 4.8.2. The *-stock-de runs omit the -fplugin-arg-dragonegg-enable-gcc-optzns
flag and the *-de-optnz runs include it. There seems to be little improvement between llvm 3.3 and 3.4 in the
stock case which relies entirely on llvm for vectorization.
Duncan, has
2008 Feb 03
0
[LLVMdev] 2.2 Prerelease available for testing
Target: FreeBSD 6.2-STABLE on i386
autoconf says:
configure:2122: checking build system type
configure:2140: result: i386-unknown-freebsd6.2
[...]
configure:2721: gcc -v >&5
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.6 [FreeBSD] 20060305
[...]
objdir != srcdir, for both llvm and gcc.
Release build.
llvm-gcc 4.2 from source.
2015 May 10
3
Packet compression benchmark
Hello,
Darik Horn sent a pull request adding support for LZ4. LZ4 is supposed
to be a very fast compression algorithm, especially when it comes to
decompression. I did a quick benchmark with zlib, LZO and LZ4. Now,
there are many benchmarks you can find online, but most of them deal
with compressing large files. Tinc on the other hand has to compress
small packets individually. So I did the
2009 Oct 20
1
[LLVMdev] 2.6 pre-release2 ready for testing
On Oct 20, 2009, at 6:02 AM, Duncan Sands wrote:
> Hi Tanya,
>
>> 1) Compile llvm from source and untar the llvm-test in the projects
>> directory (name it llvm-test or test-suite). Choose to use a pre-
>> compiled llvm-gcc or re-compile it yourself.
>
> I compiled llvm and llvm-gcc with separate objects directories.
> Platform is x86_64-linux-gnu.
>
Ok.
2010 Jul 28
2
finding the next highest number in an array
Hi
I have a sorted array ( in ascending order) and I want to find the subscript
of a number in the array which is the the next highest number to a given
number. For example,if I have 67 as a given number and if I have a vector
x=c(23,36,45,62,79,103,109), then how do I get the subscript 5 from x (to
get 79 which is the next highest to 67) without using a for loop?
Thx
--
'Raghu'
2009 Apr 16
1
Asking help for finding the highest density region
I am using the package hdrcde to get the highest density region. I have the data from an unknown distribution. And I used the subroutine hdr from the package to get the highest density region. But I always got a error message. I do not know why. Who can help?Thanks!
The codes look like this:
j is the data set,
> hdr(j)
Error in bw.SJ(x) : no solution in the specified range of bandwidths
2008 Apr 09
1
simple intro to cluster analysis using R
I am looking for simple introduction to cluster analysis using R, that would
be understandable to a novice in statistics. Or, could someone perhaps help
me understand how to proceed in my analysis? I am very new to both statistics
and R, but am trying hard to avoid having to use SPSS as everyone around
me...
I have dataset on people presenting their opinions on different religious
2010 Feb 17
2
extract the data that match
Hi r-users,
I would like to extract the data that match. Attached is my data:
I'm interested in matchind the value in column 'intg' with value in column 'rand_no'
> cbind(z=z,intg=dd,rand_no = rr)
z intg rand_no
[1,] 0.00 0.000 0.001
[2,] 0.01 0.000 0.002
[3,] 0.02 0.000 0.002
[4,] 0.03 0.000 0.003
[5,] 0.04 0.000 0.003
[6,]
2013 May 23
1
sample(c(0, 1)...) vs. rbinom
Greetings.? My wife is teaching an introductory stat class at UC Davis.? The
class emphasizes the use of simulations, rather than mathematics, to get
insight into statistics, and R is the mandated tool.?? A student in the class
recently inquired about different approaches to sampling from a binomial
distribution.? I've appended some code that exhibits the idea, the gist of
which is that using
2009 May 28
2
Bug in base function sample ( ) (PR#13727)
Full_Name: Michael Chajewski
Version: 2.9.0
OS: Windows XP
Submission from: (NULL) (150.108.71.185)
I was programming a routine which kept reducing the array from which a random
sample was taken, resulting in a single number. I discovered that when R
attempts to sample from an object with only one number it does not
reproduce/report the number but instead chooses a random number between 1 and
2008 Sep 25
1
ggplot: adding layer using different data, groups and also controlling appearance
I have a more complicated function I am trying to write, but I run in to a problem when I want to
add something to the plot from more than one data set while simultaneously controlling the
appearance of the additional layer.
# Toy data:
foo <- data.frame ( x = 1:4, y = 4:1 , membership = c( "A", "A", "B", "B" ) )
bar <- data.frame ( x = 1:4 + 1 , y
2013 May 15
1
x and y lengths differ
I have a problem with R. I try to compute the confidence interval for my
df. When I want to create the plot I have this problem: Error in
xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ.
I try this code:
library(dplR)
df.rwi <- detrend(rwl = df, method = "Spline",nyrs=NULL)
write.table(df.rwi,file="rwi.txt",quote=FALSE,row.names=TRUE)