similar to: Lattice xyplot help please.

Displaying 20 results from an estimated 300 matches similar to: "Lattice xyplot help please."

2012 Dec 28
3
Any simple way to make this happen?
Hi, The data is x <- c(4,3,5); I need to translate it to y <- c(1,2,3,4,1,2,3,1,2,3,4,5); i.e. for each number in x, we need to generate 1:x and put it in y. The program need to evaluate this type of calculation for millions of times in simulation. Is there any elegant way to make this happen without iteration? Many thanks!! Best, Haoda [[alternative HTML version deleted]]
2008 Oct 17
4
R plot
All - When I plot something like a<-rnorm(5) b<-rnorm(5) plot(a,b,col = "red") points(10,-10) The last point is missing because it is out of range of the first plot. I just try to switch from Matlab to R. In Matlab, it always can automatic adjust the xlim and ylim for such case. Is it possible auto adjust in R? Otherwise keep tracking xlim and ylim is really annoying.
2009 Jul 14
2
How do I know where is R? - VB Programming
Dear all - Is there anyone know how to let VB or C# know where I install R automatically(i.e. auto detect R directory)? Many thanks! Best, Haoda
2010 Dec 12
1
R Plots for Recurrent Events - Suggestions are needed
Hi, I am wondering if there is a simple way to plot MCF(mean cumulative function) for recurrent events in R? MCF (http://www.weibull.com/hotwire/issue57/relbasics57.htm) And do you have some other recommendation in visualize recurrent events? I did some research online. Some people use ggplot2 to plot MCF, but it requires some additional coding. http://user2010.org/slides/Shentu.pdf Your help
2008 Dec 20
1
Help in Lattice!
Hi - How can I add different notes in different panels? My data looks like ID Dose Visit Value 1 1 0 0.5 -6.5802e-02 2 1 0 1.0 2.4085e-01 3 1 0 1.5 -2.2907e-01 4 1 0 2.0 2.4074e-01 ... ... ... ... ... 270 45 30 3.0 -8.1316e-01 271 46 30 0.5 -2.0786e-01 272 46 30 1.0 -2.9336e-01 273 46 30 1.5 -5.5657e-01 274 46 30 2.0 -2.1659e-01
2009 Jul 08
1
A Lattice Question
To the Lattice expert - I am new to the lattice package and I would like to add a curve to the xyplot(). I know that I need to use panel function to add it. But it doesn't work. Is there anyone can help me out on how to transfer the data into the function? The following is my code and I would like to add lines for xx,yy xx <- seq(0,1,length = 100); yy <-
2003 Feb 13
2
Function update problem
Dear all, I am trying an automatic model selection for a multiple linear regression using function lm and update. But, I meet a problem when using update. The problem is the function update can not update when variables as a vector(for example,x is a matrix with 100 regression variables). The code is as below: > model<-lm(y~x1,singular.ok=T,na.action=na.omit) > for(i in 1:100){
2009 Jul 20
2
HELP: BRUGS/WinBUGS/RBUGS Response is a combination of random variables
Hi, Is there anyone know if BUGS language allows the combination of variables as response such as Y[i] <- a*X1[i]+b*X2[i] Y[i] ~ dnorm(c,d) It seems doesn't work in my model. The problem is between two ######. The error message is > modelCheck("BayesBioMarker.BUGS") model is syntactically correct > modelData(paste("BUGS_data.txt",sep="")) data
2005 Oct 14
2
Help with lattice, regressions and respective lines
# Dear R list, # # I'm needing help with lattice, regression and respective lines. # My data is below: bra = gl(2, 24, label = c('c', 's')) em = rep(gl(3, 8, label = c('po', 'pov', 'ce')), 2) tem = rep(c(0, 0, 30, 30, 60, 60, 90, 90), 6) tem2 = tem^2 r = rep(1:2, 24) y = c(40.58, 44.85, 32.55, 35.68, 64.86, 51.95, 42.52, 52.21,
2009 Feb 18
3
Barplot with Sorted X-Axis
Hi, I have a binned data that looks like this. (8.048,18.05] (-21.95,-11.95] (-31.95,-21.95] (18.05,28.05] (-41.95,-31.95] 81 76 18 18 12 (-132,-122] (-122,-112] (-112,-102] (-162,-152] (-102,-91.95] 6 6 6 5 5 (-91.95,-81.95] (-192,-182]
2010 Dec 07
3
understanding output of tapply/by cumsum
Dear R-users, I have a dataset with categories and numbers. I would like to compute and add cumulative numbers to the dataset. I do not understand the structure of by(...) or tapply(...) output enough to handle it. Here a small example -------------- d<-expand.grid(a=1:5,b=1:3,c=1:2) d$n = 10 * d$a + d$b +0.1* d$c Sn<-by(d$n,list(d$a,d$c),cumsum) str(Sn) --------- List of 10 $ : num
2011 Jun 19
1
Skyline plots from several trees in newick format
Dear all, I am trying to create a consensus skyline plot using the "ape" package(newbie). I have a nexus file that looks like the one from above containing many trees. (my_file.trees) #NEXUS begin trees; [Treefile generated by sim_coal.exe (Laurent Excoffier)] tree true_tree_1 = [&U] (((13.1:6, 43.1:5):12, 28.1:14):284, (((((21.1:0, (20.1:1, 4.1:0):0):1, ((37.1:0,
2009 Sep 27
2
Check value interval in a if loop
Hi R community I have a little problem, and I tried to solve it by myself but I couldn't. I building an if loop, and I want to check a value inside an interval. This would be the case: pvalue=0,2999 if(pvalue>0.05 or pvalue<0.1) as you can see I would like to check in that if loop if my pvalue is inside of that interval(from 0.05 to 0.1), and I tried these options: if(pvalue>0.05
2004 Nov 23
6
Weibull survival regression
Dear R users, Please can you help me with a relatively straightforward problem that I am struggling with? I am simply trying to plot a baseline survivor and hazard function for a simple data set of lung cancer survival where `futime' is follow up time in months and status is 1=dead and 0=alive. Using the survival package: lung.wbs <- survreg( Surv(futime, status)~ 1, data=lung,
2013 Mar 13
1
multi-comparison of means
Hi all: I have a question about multi-comparison. The data is in the attachment. My purpose: Compare the predicted means of the 3 methods(a,b,c) pairwisely. I have 3 ideas: #idea1 result_aov<-aov(y~ method + x1 + x2) TukeyHSD(result_aov) diff lwr upr p adj b-a 0.845 0.5861098 1.1038902 0.0000001 c-a 0.790 0.5311098 1.0488902 0.0000002 c-b -0.055 -0.3138902
2006 Jul 16
2
Matrices given to pt? [was: [R] for loops and counters]
Hi, people. I was a bit intrigued by the message quoted below. Indeed, if pt() is given a matrix, it returns a matrix. Should this feature be documented? ?pt speaks about "a vector of quantiles", and says nothing about the type of what it returns. The same might presumably apply to other distribution-related functions. ----- Forwarded message from Martyn Plummer <plummer at
2011 Mar 29
2
List extraction
I have created a list of tables with the same columns but different number of row. Example (actual list has ~200 elements): > temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04)) > temp2<- data.frame(ID=c("Herb","Shrub", > "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3)) > L<-list(a=temp1,b=temp2) > L $a
1999 Oct 05
2
for loops and counters
I am trying to assign values to a vector (pvalue). Similar code works in C but not in R. What am I doing wrong? r <- pvalue <- 0 for(i in (1:(k-1))){ for(j in (i+1):k){ r <- r+1 tstat <- (means[i]-means[j])/rms pvalue[r] <- 2*(1-pt(abs(tstat),df)) } } Thank you. Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del
2008 Aug 01
4
Plotting ordered nominal data
Hi I'm sure this question has been asked before but I can't find it in the archives. I have a data frame which includes interval and ordered nominal results. It looks something like "Measured" "Eyeball" 46.5 Normal 43.5 Mild 56.2 Normal 41.1 Mild 37.8 Moderate 12.6 Severe 17.3 Moderate 39.1 Normal 26.7 Mild NULL Normal 27.9 NULL 68.1
2010 Apr 27
5
get means of elements of 5 matrices in a list
I've got a list of 5 matrices that are each 5 x 6. I'd like to end up with a 5 x 6 matrix that contains the mean value of the 5 original matrices. I can do this by brute force, but there must be a better way than making each matrix into a vector and then remaking a matrix thanks very much for any help david freedman ll=list(structure(c(9.7, 17.6, 20.8, 24.1, 33.8, 14.5, 25.7, 29.8,