similar to: passing arguments to functions within functions

Displaying 13 results from an estimated 13 matches similar to: "passing arguments to functions within functions"

2010 Jul 27
1
xYplot error
Hi, I'm trying to plot a graph with error bars using xYplot in the Hmisc package. My data looks like this. mort stand site type 0.042512776 0.017854525 Plot A ST 0.010459803 0.005573305 PF ST 0.005188321 0.006842107 MSF ST 0.004276068 0.011592129 YSF ST 0.044586495 0.035225266 Plot A LD 0.038810662 0.037355408 PF
2004 Apr 28
1
simple repeated measures model: dumb user baffled!
I am in the process of transferring from an old version of S+ to using R having used a variety of other packages in the past. I'm hugely impressed with R but it has an excellent but depressing habit of exposing that I'm not a professional statistician and has done so again. Someone has run a nice little repeated measures design on my advice, students randomised to four orders of a
2011 Jul 07
2
kripp.alph error message
Hi! I fairly new to R, have only done pretty basic things so far, so this may be a very basic question..... But I did search the forums and didn't see a solution.... I'm trying to get going with kripp.alpha(). I'm loading data from a file, like this: > library(irr) Loading required package: lpSolve > x <- read.table("foo", comment.char="#", header=TRUE,
2006 Aug 10
1
How to fit bivaraite longitudinal mixed model ?
Hi Is there any way to fit a bivaraite longitudinal mixed model using R. I have a data set with col names resp1 (Y_ij1), resp2 (Y_ij2), timepts (t_ij), unit(i) j=1,2,..,m and i=1,2,..n. I want to fit the following two models Model 1 Y_ij1, Y_ij2 | U_i = u_i ~ N(alpha + u_i + beta1*t_ij, Sigma) U_i ~ iid N(0, sigu^2) Sigma = bivariate AR structure alpha and beta are vectors of order 2.
2009 May 12
1
ROCR: auc and logarithm plot
Hi, I am quite new to R and I have two questions regarding ROCR. 1. I have tried to understand how to extract area-under-curve value by looking at the ROCR document and googling. Still I am not sure if I am doing the right thing. Here is my code, is "auc1" the auc value? " pred1 <- prediction(resp1,label1) perf1 <- performance(pred1,"tpr","fpr") plot(
2009 Nov 04
2
PCA with tow response variables
Hi all, I'm new to PCA in R, so this might be a basical thing, but I cannot find anything on the net about it. I need to make a PCA plot with two response variables (df$resp1 and df$resp2) against eight metabolites (df$met1, df$met2, ...) and I don't have a clue how to do... and I've only used the simplest PCAs before, like this: pcaObj=prcomp(t(df[idx, c(40:47)]))
2000 Apr 28
1
Using 'by()' in a function
I have a list of dataframes, and want to apply a function to subsets of the rows of each dataframe. It seemed natural to write a function that takes a dataframe as an argument, and uses 'by() within it to apply the function to the dataframe subsets. However, I cannot get it to work. The problem seems to be passing the data argument of by() as a function argument. Is this bug, or am I
2009 Feb 02
0
Using Information from the Stats4 package in base envir
Hi. Thank you very much in advance for your help. I have generated data from two simple linear models and used k-means clustering (stats4) to identify two clusters in the generated data. Next, I would like to do simple linear regression for each separate cluster. I can do this if I first use the cluster labels to define two separate data frames with the subset function. However, I would
2012 Nov 21
0
Two way manova
Hello everyone, I would like to perform a 2-way manova test, but I'm having some issues. I implemented like this Y<-cbind(Resp1,Resp2,Resp3,....,Respn) model<-manova(Y "tilda" FactorA*FactorB) summary.aov(model) 1. I don't know at what level I have to do the Type I error correction. Is it on p-values returned by "summary.aov(model)? Or is it when I compare each
2011 Feb 17
0
Multi-response MCMCglmm (gaussian and zapoisson)
Dear MCMCglmm users, I am currently struggling with the specification of a proper prior and model formula for a multi-response MCMCglmm with two of the three response variables being Gaussian and the third being za-poisson. The model includes several fixed effects and three nested random effects. In general, I would prefer to fit a model with a fixed effect of trait and suppressed intercept for
2007 Jun 14
4
question about formula for lm
Dear all; Is there any way to make this to work?: .x<-rnorm(50,10,3) .y<-.x+rnorm(50,0,1) X<-data.frame(.x,.y) colnames(X)<-c("Xvar","Yvar") Ytext<-"Yvar" lm(Ytext~Xvar,data=X) # doesn't run lm(Yvar~Xvar,data=X) # does run The main idea is to use Ytext as input in a function, so you just type "Yvar" and the model should fit....
2005 Feb 03
1
Efficient selection and alteration of dataframe records
Hi All, I am writing a simulation that examines the effects of species extinctions on ecological communties by sequentially removing individuals of a given species (sometimes using weighted probabilities) and replacing the lost individuals with species identities randomly sampled from the remaining individuals. Thus I use two dataframes. One contains all the individuals and their species
2011 Apr 15
1
how to add two data.frame with the same column but different row numbers
Hi all, Suppose I have 2 data.frame , a and b, how can I add them together to get c? Thanks > a A a 1 b 2 c 3 > b A a 6 c 1 > c A a 7 b 2 c 4 -- Best, Zhenjiang [[alternative HTML version deleted]]