Displaying 11 results from an estimated 11 matches for "tripid".
2006 May 10
3
Unique?
Hello,
I have sample data set that looks like:
YEAR MONTH DAY CONTINUE SPL TIMEFISH
TIMEUNIT AREA COUNTY DEPTH DEPUNIT GEAR TRIPID
CONVUNIT
1992 1 26 1 SP0073928 8
H 7 25 4 NA 1000000
02163399054 161
1992 1 26 1 SP0073928 8
H 7 25 4 NA 1000000
02163399054 8
1992 1 26 2 SP0004228 8
H 7 25 4 NA 1000000
02163399054 161
1992 1 26 2 SP0004228 8
H 7 25 4 NA 1000000
02163399054 8
1992 1 25 NA SP0052652 8
H 7 25 4 N...
2012 Apr 03
2
Grouping and/or splitting
I have a dataframe imported from csv file below:
Houseid,Personid,Tripid,taz
1,1,1,4
1,1,2,7
2,1,1,96
2,1,2,4
2,1,3,2
2,2,1,58
There are three groups identified based on the combination of first and
second columns. How do I split this data frame?
I tried
aa <- split(inpfil, inpfil[,1:2])
but it has problems.
Output desired is
aa[1]
Houseid,Personid,Tripid,taz
1,...
2006 May 03
4
Aggregate?
Hello,
I have a data set with a grouping variable (TRIPID) and several other
variables. TRIPID is repeated in some areas and I would like to use a
function like aggregate to sum the variable UNITS according to TRIPID.
However I would also like to retain the other variables as they are in
the data set with the new summed TRIPID.
So what I have is someth...
2006 May 03
4
Aggregate?
Hello,
I have a data set with a grouping variable (TRIPID) and several other
variables. TRIPID is repeated in some areas and I would like to use a
function like aggregate to sum the variable UNITS according to TRIPID.
However I would also like to retain the other variables as they are in
the data set with the new summed TRIPID.
So what I have is someth...
2008 Oct 30
1
Trying to "expand" some data - Newbie needs help
...make it do so? t(CurrentX2Sums) doesn't seem to do the trick.
How do I avoid getting e.g. "De.Soto" when I read "De Soto" into
NewTargetData?
How do I put this back into my dataframe?
SurveyData$NewX1 = NewTargetX1Sums/CurrentX1Sums but how do I
specify (tripid_nu lineon) the indices?
If I'm only a ?LookHere or ??LookThere away I'd appreciate being pointed
in the right direction.
Thanks in advance.
All the gory details:
> sessionInfo() # List loaded packages
R version 2.8.0 (2008-10-20)
i386-pc-m...
2012 Jun 08
1
noob requesting help
...t. I could really use some
help with the following problem.
I have a huge .csv file containing thousands of measurements on 34 different
birds. Measurements include longitude, latitude, altitude, speed, time, etc.
All birds have a different number (ranging from 121 to 542). All
measurements have a tripID (1 for the first trip of every bird, 2 for the
second, etc.)
I need to create a vector containing only the first measurement of every
trip. I need this to see at what time a bird leaves the nest and eventually
make a histogram out of that.
I need to write a piece of code that would look something...
2012 Jul 13
1
R combining many vectors of predictable name into one date frame
...t in the example above, I have ib1 : ib100, but next time, I might
only have ib1 : ib2
Below is my (probably somewhat embarrassing) example script for generating
the vectors in the first place. Commented out toward the end are a few
attempts at doing the job I wanted to do.
temp <- runif(100)
tripID <- rep(1:10, 10)
uni <- rep(1:4, 25)
temp <- data.frame(temp, tripID, uni)
trips <- unique(temp$tripID)
uni <- unique(temp$uni[temp$tripID==trips[1]])
for (jj in 1:length(uni)){
a <- c()
for (ii in 1:10){
a <- c(a, IQR(temp$temp[temp$uni %in% sample(uni,jj)]))
ass...
2013 Mar 13
3
Assign the number to each group of multiple rows
Dear R users,
My data have repeating "beh" parameter : 1 or 2 - type of animal behavior
in subsequent locations. I need to assign unique number to each sequence of
locations.
My data is:
>data=data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
>attach(data)
>data
row beh
1 1 1
2 2 1
3 3 1
4 4 2
5 5 2
6 6 2
7 7 1
8
2006 May 16
3
subset
Hello everyone,
I have a large dataset (x) with some rows that have duplicate variables
that I would like to remove. I find which rows are the duplicates with
X1<-which(duplicated(x)). That gives me the rows with duplicated
variables. Now, how can I remove just those rose from the original data
frame. I think I can create a new data frame without the duplicates
using subset. I have tried:
2012 Apr 03
1
Compare by row and insert previous row value (Or non Time Series Lag)
...ant to transform as follows.
For each person in a household I want to create two new variables OrigTAZ
and DestTAZ. It should take the value in TripendTAZ and put that in
DestTAZ. For OrigTAZ it should put value of TripendTAZ from the previous
row. For the first trip of every person in a household (Tripid = 1) the
OrigTAZ = hometaz. For each person in a household, from the second trip
OrigTAZ = TripendTAZ_(n-1) (the value of TripendTAZ from the previous row)
and DestTAZ = TripEndTAZ. The sample input and output data are shown in the
links above. I tried the suggestions shown here: Basic lag in R
vec...
2013 Sep 02
1
R dataframe and looping help
HI,
You may try this:
dat1<- read.table(text="
CustID TripDate Store Bread Butter Milk Eggs
1 2-Jan-12 a 2 0 2 1
1 6-Jan-12 c 0 3 3 0
1 9-Jan-12 a 3 3 0 0
1 31-Mar-13 a 3 0 0 0
2 31-Aug-12 a 0 3 3 0
2 24-Sep-12 a 3 3 0 0
2 25-Sep-12 b 3 0 0 0
",sep="",header=TRUE,stringsAsFactors=FALSE)
dat2<- dat1[,-c(1:3)]
res<- lapply(seq_len(ncol(dat2)),function(i)