similar to: Writing R documentation

Displaying 20 results from an estimated 1100 matches similar to: "Writing R documentation"

2011 Aug 02
2
Help with aggregate syntax for a multi-column function please.
Dear R-experts: I am using a function called AUC whose arguments are data, time, id, and dv. data is the name of the dataframe, time is the independent variable column name, id is the subject id and dv is the dependent variable. The function computes area under the curve by trapezoidal rule, for each subject id. I would like to embed this in aggregate to further subset by each
2004 Dec 17
1
reading the seed from a simulation
Greetings, I have a simulation of a nonlinear model that is failing. But it does not fail til way into the simulation. I would like to look at the run that is failing and maybe I could if I could capture the seed for the failing run. The help file on set.seed says you can do it but when I tried rs<-.Random.seed print(paste("rs",rs,sep=" ")) I got 626 of them so I
2004 Nov 10
2
cubic spline/smoother with nlme
Greetings, I would like to use a cubic spline or smoother to model the fixed effects within nlme. So far the only smoother I have been able to get to run successfully in nlme is smooth(). I tried smooth.spline: fixed=list(lKa~1,lCL~smooth.spline(BSA, df=3)) the error I got was the following. Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : invalid
2003 Jul 24
3
trellis plot question
Greetings, Does anyone know how to get an id number in the little header above each individual plot within a trellis plot? The default seems to be to print the word id and add a line indicating on a linear scale where the current id sits. Thanks in advance for any help you can send, Suzette ================================= Suzette Blanchard, Ph.D. Research Scientist Frontier Science
2006 Dec 20
2
\Sexpr in MikTex
Greetings, \Sexpr{} has worked on MikTex with earlier versions of R, I can not seem to get it to work with R-2.4.0. I run Sweave with MikTex using the following statement in Run under Accessories. latex -include-directory="C:\Program Files\R\R-2.4.0\share\texmf" "C:\Documents and Settings\Suzette\Desktop\MyFile\MyProgram.tex" Any advice would be much appreciated, Suzette
2004 Oct 25
4
CRAN packages
I am not able to download packages ("xtable") from CRAN not even just a .zip file, I get that the page can not be found. Please could you help? Suzette ================================= Suzette Blanchard, Ph.D. Research Scientist Frontier Science
2008 Apr 08
2
Error: expected the collection operator c error pos 98 (error on line 1)
Greetings, I implemented BRugs to run the EWOC model with a cohort size N=1. I output the simulation data using bugsdata(data), where data is the following list. > data $Dose [1] 140 $Y [1] 0 bugsdata(data) puts out the file data.txt as follows. list(Dose=1.40000E+02, Y=0.00000E+00) after I type the following line modelData("data.txt")
2008 Jun 12
1
adding horizontal lines to a trellis plot
I would like to add two horizontal lines representing acceptible drug levels to a trellis plot. I tried using abline and I get an error that "plot.new has not been called." See below. xyplot(FK~WEEK|Event1/MRN, data=FKdat.o1) abline(h=5) abline(h=10) Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new has not been called yet Any help that can be provided
2008 Nov 26
1
Request for Assistance in R with NonMem
Hi I am having some problems running a covariate analysis with my colleage using R with the NonMem program we are using for a graduate school project. R and NonMem run fine without adding in the covariates, but the program is giving us a problem when the covariate analysis is added. We think the problem is with the R code to run the covariate data analysis. We have the control stream, R code
2008 Jun 08
0
AUC steady state calculations
Hi, a collegue has send me an excel sheet with some plasma values, and now he wants to know the AUC steady state. I took a look at the CRAN taskviews, and came up with PK, PKtools, ... The AUC calculation, no problem with that, but how do I calculate the steady state? One way of thinking was with the aid of multiple t-test, to find where we couldn't find difference between the different
2004 Nov 12
0
geese
I am working with geese from geepack, does anyone know how to get the predicted values from this program. I tried the predict function and got the error Error in predict(results.e, newdat = prog) : no applicable method for "predict" Thank you for any help you can send, Suzette ================================= Suzette Blanchard, Ph.D. UCSD-PPRU
2008 Feb 15
1
question about calling winbugs in R
Dear All: Do you have any experience on calling winbugs in R enviorment? I uploaded R2winbgus, pktools, BRugs, ect. in order to call winbugs. In the end, I try to use bugs(). The error message still displays that bugs() can not find. Do you have any similar issue? If so, could you give your advice? Many Thanks! Xin [[alternative HTML version deleted]]
2010 Apr 26
1
finite difference scheme for 2D differential equations
Hello everyone, I am trying to solve 2D differential equations using finite difference scheme in R. I have been able to work with the equations with only one spatial dimensions but I want to extend it to the two dimensional problem. For example i can simulate one dimensional diffusion using a code like the following. But I want to write a similar code for,say, a two dimensional diffusion
2005 Oct 13
1
problems with loop and plot function
Hi all R users, I have problems with my second loop for drawing the three curves in the same graphic. I need help please Thank you in advance ######################################################################### simulation <- function(k, n){ conc <- seq(0,100,by=0.5) #choixg <- seq(1, length(conc)) choixg <- rep(0,length(conc)) for (i in 1:length(conc)){ choixg[i] <- (k
2006 Dec 21
1
: newbie estimating survival curve w/ survfit for coxph
I am wondering how to estimate the survival curve for a particular case(s) given a coxph model using this example code: #fit a cox proportional hazards model and plot the #predicted survival curve fit <- coxph( Surv(futime,fustat)~resid.ds+strata(rx)+ecog.ps+age,data=ovarian[1:23,]) z <- survfit(fit,newdata=ovarian[24:26,],individual=F) zs <- z$surv zt <-
2008 Nov 11
2
strsplit (regex)
#how do I break these up into first two letters (RM), number, and then the last part #is there an easily accessible regex tutorial on the internet? v = (structure(1:122, .Label = c("RM215Temp", "RM215SpCond", "RM215DO.Conc", "RM215Depth", "RM215pH", "RM215ORP", "RM215Turbidity.", "RM215Battery", "RM215DO.",
2005 Oct 11
2
Problems with plot function
Hello all R users, My simulation function works correctly, but I have problems with plot function. You will find the following code using it. Thank you for your help ##################################################" simulation <- function(k, n){ conc <- seq(0,10,by=0.5) #choixg <- seq(1, length(conc)) choixg <- rep(0,length(conc)) for (i in 1:length(conc)){ choixg[i]
2023 Oct 24
1
How to Calculate the Mean by Multiple Groups in R
Also, > aggregate(cbind(OD, ODnorm) ~ Time + Target + Conc, data = df, FUN = "mean") Time Target Conc OD ODnorm 1 1 BACT 1 765.3333 108.33333 2 1 BACT 2 745.3333 88.33333 3 1 BACT 3 675.0000 18.00000 (You might wish for "cbind(OD,ODnorm) ~ . - Well", but aggregate.formula is not smart enough for that.) -pd > On 24 Oct 2023, at
2012 Aug 07
2
Passing arguments to a function within a function ...
Hallo Everybody How do you specify arguments for a function used within another function? Here is my problem: I am reconstructing a calculator for the burden of disease due to air pollution from publications and tools published by the WHO. The calculations make use of published dose-response relationships for particular health end-points. This is then applied to populations with known or
2023 Oct 24
2
How to Calculate the Mean by Multiple Groups in R
Hi, I think you're misunderstanding which set of variables go on either side of the formula. Is this what you're looking for? > aggregate(OD ~ Time + Target + Conc, data = df, FUN = "mean") Time Target Conc OD 1 1 BACT 1 765.3333 2 1 BACT 2 745.3333 3 1 BACT 3 675.0000 > aggregate(ODnorm ~ Time + Target + Conc, data = df, FUN =