Displaying 3 results from an estimated 3 matches for "usubjid".
Did you mean:
subjid
2008 Dec 07
1
Reading txt file in R
...umber of data points
n.params <- dim(anal.data)[2] - 2 # number of parameters to estimate
n.sites <- length(unique(SITEID))
data.bugs <- list("NAUSEA"=NAUSEA,"SITEID"=SITEID,"BMI"=BMI, "USUBJID"=USUBJID,"n.samples"=n.samples,"n.sites"=n.sites,"n.params"=n.params)
bugsData(data.bugs, fileName = "nauseadata.txt")
inits.bugs <- list("b"=rep(0,n.params),"alpha"=rep(0,n.sites), "tau"=1)
bugsInits(list(inits.bugs), fi...
2010 Feb 09
1
Aggregate dataframe variables, return more than 2 vars
...WAL 2005-08-29
I can get the max date and the id 2 different ways:
> do.call("rbind", lapply(split(dat, dat$id), function(x) data.frame(id =
x$id[1], max_date = max(x$date))))
id end
1 1 2005-08-29
2 2 2005-08-29
3 3 2005-08-29
OR
> aggregate(dat$date, list(USUBJID=dat$id),FUN="max")
USUBJID x
1 1 13024
2 2 13024
3 3 13024
(which oddly returns some number of days after 1-1-1970 iso of the max as a
date value)
I’d like to do this without looping or filtering for date and usubjid if
possible. If there is a way to re...
2009 Aug 20
1
Read and merge a number of .xls files into one dataframe
Hi everybody
I have a large number of Excel speadsheets that I want to merge into one R
dataframe to process. I can read them one by one with read.xls but I really
need a function to read a whole directory at once and merge the columns with
the same name into a single dataframe.
here is what I have thus far (on Mac OS X 10.5.2. for R 2.8.0):
# Define the directory where the data is