jim holtman
> Subject: Re: [R] Need a faster function to replace missing data
> To: "Tim Clark"
> Cc: r-help@r-project.org
> Date: Friday, May 22, 2009, 4:59 PM
> Here is a modification that should
> now find the closest:
>
> >
> myvscan<-data.frame(c(1,NA,1.5
ng to use which.min to get the
> closet date but can't seem to get it to work right either.
>
> Aloha,
>
> Tim
>
>
> Tim Clark
> Department of Zoology
> University of Hawaii
>
>
> --- On Fri, 5/22/09, jim holtman wrote:
>
> > From: jim holtman
>
Aloha,
Tim
Tim Clark
Department of Zoology
University of Hawaii
--- On Fri, 5/22/09, jim holtman wrote:
> From: jim holtman
> Subject: Re: [R] Need a faster function to replace missing data
> To: "Tim Clark"
> Cc: r-help@r-project.org
> Date: Friday, May 22, 200
I think this does what you want. It uses 'findInterval' to determine where
a possible match is:
>
myvscan<-data.frame(c(1,NA,1.5),as.POSIXct(c("12:00:00","12:14:00","12:20:00"),
format="%H:%M:%S"))
> # convert to numeric
> names(myvscan)<-c("Latitude","DateTime")
> myvscan$tn <- as.numeric(myvsca
reference)
or NA
# following needed if reference is not sorted
i <- order(reference)[i]
# following needed if x is not sorted
i[order(order(x))]
}
Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com
> -Original Message-
> From: r
Tim Clark yahoo.com> writes:
>
> I need some help in coming up with a function that will take two data sets,
determine if a value is missing in
> one, find a value in the second that was taken at about the same time, and
substitute the second value in for
> where the first should have been.
T
Dear List,
I need some help in coming up with a function that will take two data sets,
determine if a value is missing in one, find a value in the second that was
taken at about the same time, and substitute the second value in for where the
first should have been. My problem is from a fish t
7 matches
Mail list logo