similar to: lattice chart: different definitions for series

Displaying 20 results from an estimated 5000 matches similar to: "lattice chart: different definitions for series"

2005 Oct 28
3
splitting a character field in R
Dear R users, I have a dataframe with one character field, and I would like to create two new fields (columns) in my dataset, by spliting the existing character field into two using an existing substring. ... something that in SAS I could solve e.g. combining substr(which I am aware exist in R) and "index" for determining the position of the pattern within the string. e.g. if my
2005 Aug 15
3
How to repeat code snippet for several variables in a data frame?
Dear all, I have a data frame containing the results of an experiment. Like this: a<-seq(1,4,by=1) b<-seq(1,2,by=1) test<-expand.grid(b,a,a) colnames(test)<-c("replicates","bins", "groups") test$abc <- rnorm(32) test$def <- rnorm(32) test$ghi <- rnorm(32) test The following code snippet aggregates the data for one variable and then draws a
2006 May 26
1
query: sample size calculation
Dear all, I am doing something wrong. I am trying to apply a formula for sample size calculation as in the book "Design and Analysis of Clinical Trials", from Chow et all. There a suggested sample size strategy uses the formula 0.30/0.45=F(0.80,2n,2n)/F(0.025,2n,2n) which gives n=96, as in the book. (here F(alfa,k,n) is the upper (alfa)th quantile of an F distribution with k,n
2011 Jul 18
1
Multiple comparison test on selected contrasts
Dear Help-list, How can I do a multiple comparison test (mct) on selected contrasts from a linear model while using packages lme4 and multcomp? I am running R 2.13.0 under Windows 7. The following linear model and mct produces a global mct of 15 paired contrasts of the combined (Site, Position) factor SitePos of which only 9 are of interest. Model.G = lmer(log10(SrCa) ~ SitePos + (1 | Eel),
2012 Jul 17
2
order or sort doesn´t work properly
Hi all, I want to order a series that is included on the second column in MCT.csv. I do but R doesn?t order, could be because is a csv? I have prove MCT<-read.csv("MCT.csv") a<-order(MCTor[,2],2,decreasing = FALSE) a<-order(MCTor[,2],1,decreasing = FALSE) or the same with sort but didn?t worked. It is suposed that a will have the ordered on ascending or descending
2012 Nov 17
2
lines density
Hi all, I attach a picture, with my output plot. I put this command to obtain it: hist(MCT[,2],probability=TRUE,xlab=" ",ylab="Max",main="M distribution") lines(density(MCT[,2]), lwd = 2) The problem is that when I extract the "bell" is too high? And the higher part doesn?t appear in the plot. There is some trick to adjust the line on the plotted area?
2011 Jul 16
1
Creating composite factor and changing format from character to factor
Dear Help-list, I have a dataframe containing 6 variables, 4 of which are factors, 2 numeric. I want to create another factor variable (SitePos) by combining 2 existing factors (Site and Position). I have tried a number of approaches based on trolling the R FAQs, various R webpages, etc., none of which work. One approach e.g. Data1$SitePos <- paste(Data1$Site, Data1$Position) creates the
2006 Nov 15
1
trellis.par.set and grid : how to set by default that I want a grid on my graphes ?
Hello all, I want to draw a grid behind my graphes, using lattice package. I manage to do it with instructions like this one : xyplot(Sepal.Length + Sepal.Width ~ Petal.Length , data = iris, allow.multiple = TRUE, scales = "same",type="l", panel = function(...) { panel.grid(h=-1, v= -1) ; panel.superpose(...) } ) I was wondering if there were a way to do it
2008 Feb 14
1
Replacing a character string when finding substring match
Dear R-experts, I need to replace the values of a vector(tx) with a word ('Vehicle') when the value of the vector contains the word 'vehicle'. Sometimes, the value could be 'MCT vehicle', or 'control-vehicle', etc. I tried gsub like this treatment<-gsub('vehicle','Vehicle', tx, ignore.case=T) But then I end up with values like 'MCT
2011 Jan 27
1
normalizing prizes to a specific year - how to?
Dear list I have a large data frame with house prices. Prices have been converted to price per m2, to be able to compare. Prices are spread over almost 10 years, each price is tagged with the year it relates to. I would like to 'normalize' all the prices to, eg. 2010 prices. The data frame looks like this > head(dafP) Y P 1 2004 11199.60 2 2005 15310.10 3 2005 19491.50 4
2006 Jun 01
3
Key titles in Lattice
Hi, I'm creating some lattice plots that have a key and I'd like to put a label on the key. The problem is that the text label for the key prevents the values of the group variables from being shown (see example below). I don't think that this is a feature, but I might be abusing the title arg for key. I'm using R Version 2.3.0 (2006-04-24) on Windows XP and lattice V0.13-8
2005 Jul 25
1
order of panels in xyplot
I'm having trouble with the order of the panels using xyplot. I had used this bit of code before and received the desired plot (the code was not identical, but very similar; perhaps more importantly I was working with an older version of R) . Now the panels appear right to left instead of left to right, as it says in the help files, which is what I would like. Does anyone know if this has
2011 Mar 15
1
Bug in lattice auto.key argument
The Lattice auto.key argument has a bug in R.12.2. R version 2.12.2 (2011-02-25) Platform: i386-pc-mingw32/i386 (32-bit) .... other attached packages: [1] lattice_0.19-17 loaded via a namespace (and not attached): [1] grid_2.12.2 If I set up my plot parameters as require(lattice) superpose.line.settings <- trellis.par.get("superpose.line") str(superpose.line.settings)
2002 May 17
1
Strange R CMD check \usage parse error
In running R CMD check I get an error I can't debug. Would someone please let me know if they spot a syntax error in the code below or if there is a workaround for the parse error? Thanks -Frank Error in parse(file, n, text, prompt) : parse error Error in codoc(package = "Hmisc") : cannot source usages in documentation object 'plsmo' Execution halted * checking for
2003 Aug 29
2
Lattice plot questions
Win2k, R1.7.1: I am currently working with some growth curve data from a biotoxicology experiment. Each of 12 subjects had their blood drawn at 0, 2, 4, 6, 8, and 10 weeks. For the purposes of the project, it would be helpful if I were able to do the following: a. Produce 12 panels, each displaying the *same* data, with the "strip" at the top of a particular panel showing
2009 Jun 14
1
learning about panel functions in lattice
Hi All, I am trying to understand panel functions. Let's use this example. library(lattice) time<-c(rep(1:10,5)) y <-time+rnorm(50,5,2) group<-c(rep('A',30),rep('B',20)) subject<-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10)) myData <-data.frame(subject,group,time,y) head(myData) Plot 1 xyplot(y ~ time
2010 Oct 19
2
superpose.polygon, panel.polygon and their colors
Dear R-helpers, the problem I'm facing today is to convince lattice to paint some areas in gray. The areas I would like to have in gray, are confidence bands I've googled around in the mailing list archives and eventually find some clues. This link is my starting point http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html I'm reproducing here the code for your convenience est
2002 Dec 19
1
lattice and display
Hi, I have just started using lattice and it looks great. But I already have 3 questions about xyplot display. ---------------------------------------------------------------------------- --------------------------------- 1.I would like to create two differeny xyplot with different color to identify my different groups but I have trouble applying colors. Here are the scripts
2006 Aug 18
3
setting a value of text_field from a controller
Hi, I need to set up an initial value from controller. In my views I''ve something like <%= text_field "object", "name" %> and would like to do something like this from controller def index @object[:name] = ''default value'' end but still got an error. Object doesn''t have database model (and will not have) Thank you PS: now using
2005 Feb 10
1
xyplot() question
Dear R Users, I have an xyplot() where different plotting symbols are used for subgroups (originally used within S-Plus, but hopefully it?s also applicable to R users). How can I fit separate regression lines for every subgroup? So far, I can only plot the overall fitted line. The code looks like this: trellis.device() sps<-trellis.par.get("superpose.symbol") sps$pch<-1:7