similar to: Displaying data in Trellis

Displaying 20 results from an estimated 800 matches similar to: "Displaying data in Trellis"

2012 Mar 26
2
trellis plot
Hi everyone, I am just trying to figure out how to do a xyplot where in addition to dots and lines I can change dots' colors according to an individual variable (e.g., marital disruption across time, a dummy 0/1). When I use "groups" specification (see below), I get two different lines for each individual based on groups, and what I want is to get one line connecting dots, and
2011 Jun 09
2
scatterplot3d - help assign colors based on multiple conditions
Hi I am relatively new to R and am trying to figure out to plot 3d scatter plot using defined colors based on x-axis and y-axis values. Right now in the code below, I assign colors based on certain values in the names of the x-axis. Now if I want to extend the condition to assign a color based on the names of both x-axis and y-axis values, what should I be doing? Any help or ideas would be
2013 Jun 10
1
Selecting divergent colors
Hi, I was trying to make a density plot with 13 samples. To distinguish each sample, it would be good if each color is as different as possible from the other colors. I could use the built in function, but that does not do more than 8 colors and then goes back to recycling the cols. If I use a palette, then it is really difficult to distinguish between the colors. So, is there a way that I can
2011 Oct 19
2
Simple color strip
Hi, I was trying to get an image/pdf of a sequence of colors in the order given. For example: myCols <- c('#0000BF','#0000BF','#0000FF','#0000FF','#0000BF','#0000FF') I'd like to make a strip of colors as they appear in the order above and save it as a pdf file. Is there a function in the base package (or some other package) to do this?
2011 Mar 15
1
How to read only specified columns from a data file
R-help, I'm trying to read a data file with plenty of columns. I just need the first 5 but it doe not work by doing something like: > mycols <- rep(NULL, 430) ; mycols[c(1:4)] <- NA > read.table(myfile, skip=2, colClasses=mycols) Any suggestions? Thanks in advance
2012 May 07
1
Plotting a raster image
Hello, I have a data frame which looks like > head(d) a1 a2 n j col 1 1 1 88341002 11 #E7E7E7 2 1 2 25094882 11 #E7E7E7 3 1 3 16916246 11 #E7E7E7 4 1 4 14289229 11 #E7E7E7 5 1 5 11945929 11 #E7E7E7 6 1 6 8401235 11 #E7E7E7 The values in 'j' run from 1 to 11. I would like to plot the point (a1,a2) with color given by j I tried mi <-
2012 Aug 20
2
Unable to reference variable created in dataframe
Hello, I have question about referencing a variable that I created in a dataframe, and I am hoping the experts on here can be of assistance. I have a dataset of highway bridges with approximately 10,000 observations. I imported these into R in the form of a dataframe called "Bridges". I am interested in running some basic linear models on a few key variables with the data. Say
2009 Sep 11
3
Barplot+Table
I am trying to automate a report that my company does every couple of years for the state of Maine. In the past we have used SPSS to run the data and then used complicated Excel template to make the tables/graphics which we then imported into Word. Since there are 256 tables/graphics for this report, this work flow is a little painful. I would like to automate the process and I think I can do
2005 Mar 30
5
2d plotting and colours
Hi! I am new to R just 3 days in it and i apologize if my questions seem very trivial and consumed your valuable time. I am coding in perl and i stumbled upon R regarding plotting good statistical graphs. I tried the kmean clustering for a large matrix ,say > 150 * 150 . I tried the example code given in the tutorial to perform 2d plot # i ranges from 2 to 10 cl <- kmeans(x, i, 20)
2004 Nov 20
2
subset on data frame
I have a data frame. And I'd like to subset according to rownames. subset(mydataframe, rownames(mydataframe) == myrow, select = mycols) it turned out that "myrow" cannot be a vector. But I have multiple rows to pick. Is there a way to get around this problem?? Thank you for your help!! Lei Jiang Department of Chemsitry University of Washington Box 351700 Seattle, WA 98195
2013 Jun 25
1
Correct scaling of axis in persp3d plot
Hi, I want to format my axis in my persp3d plot. With my data, which I attached I created a persp3d plot with the following code, which I summarized from different code snippets I found: library(rugarch)library(rgl)library(fGarch)fd <-as.data.frame(modelfit,which ='density')color <-rgb(85,141,85,maxColorValue=255)x <-seq(-0.2,0.2,length=100)y <-c(1:2318)f
2004 Dec 03
1
How to wrap or split labels on plot
Dear R gurus, I want to wrap labels that are too long for a plot. I have looked at strsplit(), substr(), nchar(), and strwrap(). I think it's some combination but I'm having difficulty trying to figure out the right combo. I think I need to create some new matrix containing the labels already split, though I'm not sure if maybe there is a quick and dirty way to address this
2012 Apr 09
3
Gradients in bar charts XXXX
Hello, I have a graphics-related question: I was wondering if anyone knows of a way to create a bar chart that is colored with a three-part gradient that changes at fixed y-values. Each bar needs to fade green-to-yellow at Y=.10 and from yellow-to-red at Y=.20. Is there an option in a package somewhere that offers an easy way to do this? Attached is a chart I macgyvered together in Excel using a
2004 Nov 16
2
Barplot difficulties
Hello. I am an R newbie struggling to learn and use R . I have read many portions of the R Reference Manual, as well as the FAQs. Given that I learn something new each time, I know I might be missing something obvious. But I appeal to your good nature to help me through this initial problem. I have attached a pdf file to demonstrate what I desire and have listed what my data looks like in
2010 Sep 23
4
Simple categorical scatter plot
New to R. I am trying to create a simple xy plot wherein the line segment color is determined by a categorical column The following does not change colors for me, probably because I don't quite have a handle on either functions or value mapping syntax. ---------- time <- c(1, 2, 3, 7,10,11,14,16,20) pressure <- c(0,10,20,20,50,18,60,65,90) status <- c(0, 0, 1, 1, 1, 0, 3, 3,
2017 Oct 24
3
draw a circle with a gradient fill
Hi all,I would like to draw a simple circle where the color gradient follows the rule color = 1/(r^2) where r is the distance from the circle. I would also like to add a color bar with values going from -40 to -110 (and associate those with the color gradient that fills the circle). So far I experiemented with draw circle
2011 Mar 11
5
How to calculate means for multiple variables in samples with different sizes
Hello R-helpers: I have data like this: sample replicate height weight age A 1.00 12.0 0.64 6.00 A 2.00 12.2 0.38 6.00 A 3.00 12.4 0.49 6.00 B 1.00 12.7 0.65 4.00 B 2.00 12.8 0.78 5.00 C 1.00 11.9 0.45 6.00 C 2.00 11.84 0.44 2.00 C 3.00 11.43 0.32 3.00 C 4.00 10.24 0.84 4.00 D
2012 Apr 10
5
Creating a loop with an indefinite end term
Everyone, I'm very new to R, especially when it comes to loops and functions, so please bear with me if this is an elementary question. I cannot seem to figure out how to construct a loop which runs a function until a certain value is computed. For example, say I have the following: num = numeric (10) num [1] = 0 for (i in 2:10) { num [i] = num [i-1] + 5 } This adds 5 to the
2010 Jul 15
2
replace negative numbers by smallest positive value in matrix
Hi Group, I have a matrix, and I would like to replace numbers less than 0 by the smallest minimum number. Below is an small matrix, and the loop I used. I would like to get suggestions on the "R way" to do this. Thanks, Juliet # example data set mymat <- structure(c(-0.503183609420937, 0.179063475173256, 0.130473004669938, -1.80825226960127, -0.794910626384209, 1.03857280868547,
2017 Jan 21
2
problema con grafico lattice ....
Hola, Por si lo quieres con colores rellenando cada punto: #---------------- library(data.table) library(lattice) dat <- read.table("pba.csv", header=TRUE, dec=",", as.is=TRUE) row.names(dat) <- NULL dat <- as.data.table(dat) dat$mycol <- ifelse(dat$sol =="ControlAE", "red", dat$sol) dat$mycol <- ifelse(dat$mycol