similar to: Determining which.max() within groups

Displaying 20 results from an estimated 400 matches similar to: "Determining which.max() within groups"

2017 Jun 07
0
Determining which.max() within groups
cumsum() seems to be what you need. This can probably be done more elegantly, but ... out <- aggregate(Q ~ wyr, data = Daily, which.max) tbl <- table(Daily$wyr) out$Q <- out$Q + cumsum(c(0,tbl[-length(tbl)])) out ## yields wyr Q 1 1990 4 2 1991 6 3 1992 9 4 1993 15 5 1994 18 I leave the matter of Julian dates to you or others. Cheers, Bert Bert Gunter "The trouble
2004 Jun 10
3
Package installation
Hi all, I'm very new to R. I have installed R 1.9.0 on Linux (Fedora). Now I got an self-made package comprising R functions as well as C-Code which are used in several R functions. I installed the package without any error (see install log below). Then, I checked in /usr/lib/R/library if the package izbi exists and it exists. But whenever I try to load the library on the command line I
2012 Jun 11
2
Define a variable on a non-standard year interval (Water Years)
Hello, I am trying to define a different interval for a "year". In hydrology, a "water year" is defined as the period between October 1st and September 30 of the following year. I was wondering how I might do this in R. Say I have a data.frame like the following and I want to extract a variable with the water year specs as defined above:
2017 Dec 18
2
Finding center of mass in a hydrologic time series
Eric B's response provided just the kind of quick & simple solution I was hoping for (appears as the function com below). However, I once again failed to take advantage of the power of R and have reverted back to using a for loop for the next step of the processing. The example below (which requires the library EGRET for pulling an example dataset) works, but probably can be replaced
2017 Dec 18
0
Finding center of mass in a hydrologic time series
Hi Eric, the following works for me. HTH, Eric library(EGRET) StartDate <- "1990-10-01" EndDate <- "2017-09-30" siteNumber <- "10310000" QParameterCd <- "00060" Daily <- readNWISDaily(siteNumber, QParameterCd, StartDate, EndDate) # Define 'center of mass' function com <- function(x) { match(TRUE, cumsum(x/sum(x)) > 0.5) -
2017 Dec 16
3
Finding center of mass in a hydrologic time series
The small bit of script below is an example of what I'm attempting to do - find the day on which the 'center of mass' occurs. In case that is the wrong term, I'd like to know the day that essentially cuts the area under the curve in to two equal parts: set.seed(4004) Date <- seq(as.Date('2000-09-01'), as.Date('2000-09-30'), by='day') hyd <-
2017 Dec 16
0
Finding center of mass in a hydrologic time series
Hi Eric, How about match( TRUE, cumsum(hyd/sum(hyd)) > .5 ) - 1 HTH, Eric On Sat, Dec 16, 2017 at 3:18 PM, Morway, Eric <emorway at usgs.gov> wrote: > The small bit of script below is an example of what I'm attempting to do - > find the day on which the 'center of mass' occurs. In case that is the > wrong term, I'd like to know the day that essentially cuts
2013 Feb 13
3
date and matrices
Hi Elisa, Try this: date1<-format(seq.Date(as.Date("1991.1.1",format="%Y.%m.%d"),as.Date("1996.12.31",format="%Y.%m.%d"),by="day"),"%Y.%m.%d") ?length(date1) #[1] 2192 mat1<-matrix(c(.314,.314,.273,.273,.236,.236,.236,.236,.273,.314,.403,.314),ncol=1) res1<-
2013 Feb 15
2
data formatting
Dear Eliza, Try this: Lines1<-readLines(textConnection("1911.01.01?????? 7.87 1911.01.02?????? 9.26 1911.01.03?????? 8.06 1911.01.04?????? 8.13 1911.01.05????? 12.90 1911.02.06?????? 5.45 1911.02.07?????? 3.26 1911.03.08?????? 5.70 1911.03.09?????? 9.24 1911.04.10?????? 7.60 1911.05.11????? 14.82 1911.05.12????? 14.10 1911.06.13?????? 7.87 1911.06.14?????? 9.26
2003 Mar 11
1
Port Forward UDP 1911
Dear all, =0D =0D 3 Computers are linked together with cross over cable and computer B is t= he=0D router. =0D =0D Computer A - Starlight Video Server(Solaris) =0D - 192.168.0.11 =0D =0D Computer B - Iptables(Linux) =0D - eth0 - 192.168.0.12 =0D - eth1 - 158.192.92.102 =0D =0D Computer C - Video receiver(Windows) =0D - 158.192.92.105 =0D =0D First =0D # echo "1" >
2020 Jan 16
2
[CentOS-announce] Release for CentOS Linux 8 (1911)
On 17/01/20 8:06 am, Lamar Owen wrote: > On 1/16/20 6:49 AM, Peter wrote: >> On 16/01/20 4:14 am, Brian Stinson wrote: >>> Release for CentOS Linux 8 (1911) >>> >>> We are pleased to announce the general availability of CentOS Linux 8. >> >> CentOS 8 was released in September 2019.? Don't you mean 8.1? > No, they mean CentOS 8 (1911).? This
2020 Jan 22
3
[CentOS-announce] Release for CentOS Linux 8 (1911)
On 1/16/20 5:03 PM, Gianluca Cecchi wrote: > On Thu, Jan 16, 2020 at 11:08 PM Peter <peter at pajamian.dhs.org> wrote: > >> On 17/01/20 8:06 am, Lamar Owen wrote: >>> On 1/16/20 6:49 AM, Peter wrote: >>>> On 16/01/20 4:14 am, Brian Stinson wrote: >>>>> Release for CentOS Linux 8 (1911) >>>>> >>>>> We are pleased
2020 Jan 15
2
Release for CentOS Linux 8 (1911)
Release for CentOS Linux 8 (1911) We are pleased to announce the general availability of CentOS Linux 8. Effectively immediately, this is the current release for CentOS Linux 8 and is tagged as 1911, derived from Red Hat Enterprise Linux 8.1 Source Code. As always, read through the Release Notes at : http://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.1911 - these notes contain important
2020 Jan 15
2
Release for CentOS Linux 8 (1911)
Release for CentOS Linux 8 (1911) We are pleased to announce the general availability of CentOS Linux 8. Effectively immediately, this is the current release for CentOS Linux 8 and is tagged as 1911, derived from Red Hat Enterprise Linux 8.1 Source Code. As always, read through the Release Notes at : http://wiki.centos.org/Manuals/ReleaseNotes/CentOS8.1911 - these notes contain important
2020 Jan 16
2
[CentOS-announce] Release for CentOS Linux 8 (1911)
On 16/01/20 4:14 am, Brian Stinson wrote: > Release for CentOS Linux 8 (1911) > > We are pleased to announce the general availability of CentOS Linux 8. CentOS 8 was released in September 2019. Don't you mean 8.1? Peter
2008 Nov 04
1
perform Kruskal-Wallis test without using the built-in command in R
Hi, again i am stuck in my presentation, and i have never learn R before in my life but need this to be done, so please help me out for a favour: http://www.nabble.com/file/p20333155/kew.dat kew.dat run this in R and these comes up: Month Year Rain 1 Jan 1900 74.400000 2 Feb 1900 80.500000 3 Mar 1900 23.600000 4 Apr 1900 23.600000 5 May 1900 25.100000 6
2012 Jun 06
2
package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?
Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument, I always get the error: <------ Error in na.spline.vec(x., coredata(object.), xout = xout., ...) : attempt to apply non-function ------> I couldn't find a similar error for this case in the mailing lists and zoo vignette,
2020 Jan 22
2
Can I configure CentOS 8.1 1911 as an Active Directory Domain Controller like a Windows Server?
Good evening from Singapore, Can I configure CentOS 8.1 1911 as an Active Directory Domain Controller like a Windows Server? Are there any good guides or tutorials on how to do this? Thank you very much. -----BEGIN EMAIL SIGNATURE----- The Gospel for all Targeted Individuals (TIs): [The New York Times] Microwave Weapons Are Prime Suspect in Ills of U.S. Embassy Workers Link:
2004 Nov 04
1
error in chron object library
Times series of rain and discharge in hydrologic - stations has above 95 years of daily records. In the temporal series over "serie" dataframe, using chron's object: > library(chron) # load chron library > length(serie$data) [1] 27182 > serie$data[length(serie$data)] [1] (85-12-31 00:00:00) # 1985-dez-31 00:00:00hs >
2003 Sep 09
3
rc3 net groupmap add fails
Relevant part of "net3 groupmap list" is System Operators (S-1-5-21-1617713866-2789119093-1479812082-1007) -> sys In howto there is the following example net groupmap modify ntgroup="System Operators" unixgroup=sys net groupmap modify ntgroup="Power Users" unixgroup=sys You can add System Operators but trying to add Power Users fails. If you do it in reverse