similar to: Referencing factor name

Displaying 20 results from an estimated 40000 matches similar to: "Referencing factor name"

2005 Jun 01
2
How to name variables in a single plot
Dear R Friends , I want to name my variables( more than 2 variables in a single plot) within a plot to distinct them from each other, but I cann't. How it is possible? I don't mean x and y axis using xlab or ylab. At the below , it follows some lines, only as an example that you could try please, if it is possible. I really thanks for your attention. Amir library(graphics) y<-
2007 Sep 10
3
plot legend: combining filled boxes and lines
Hello, I have difficulties combining boxes and lines in plot legend. I searched previous R-posts and found this (with no solution): http://tolstoy.newcastle.edu.au/R/help/06/07/30248.html. Is there a way to avoid boxes behind the line legends? x1 <- rnorm(100) x2 <- rnorm(100, 2) hist(x1, main = "", col = "orange",ylab = "density", xlab = "x", freq =
2007 Feb 23
4
How to plot two graphs on one single plot?
Hi, I am trying to plot two distribution graph on one plot. But I dont know how. I set them to the same x, y limit, even same x, y labels. Code: x1=rnorm(25, mean=0, sd=1) y1=dnorm(x1, mean=0, sd=1) x2=rnorm(25, mean=0, sd=1) y2=dnorm(x2, mean=0, sd=1) plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1, y2), xlab='x', ylab='y') plot(x2, y2, type='p',
2009 Sep 26
1
multiple lattice, xyplot & levelplot on same page
Dear R-users, I'd like to place an xyplot() at the top of a page and a levelplot() at the bottom of the same page, and have the x-axes be the same. I've come close to finding a solution through Rarchive, and can produce an upside-down version of what I'd like (levelplot() on the top - see code below). However, the following error occurs when I try and plot the xyplot() at the top:
2005 May 19
3
Drawing a circle
Hi. I need to draw a circle whit center (a,b) and radio r. So I use the R code below a<-1.975 # valore x del centro b<-1.215 # valores y del centro r<-1.46 # radio x1<-seq(a-r,a+r,by=0.01); #los valores de x yp<-sqrt(r^2-(x1-a)^2)+b; # los valores y a partir de la ra??z positiva yn<-(-1)*sqrt(r^2-(x1-a)^2)+b; # los valores y a partir de la ra??z negativa x<-c(x1,x1);
2012 Nov 20
2
Help with loess
Not sure what I'm doing wrong. Can't seem to get loess values. It looks like loess is returning the same values as the input. j <-loess(x1$total~as.numeric(index(x1) plot(x1$total,type='l', ylab='M coms/y global',xlab='') lines(loess(total~as.numeric(index(x1)),x1)) The plot statement works fine No errors with the "lines" statement But I don't
2011 Dec 22
1
overlaid filled contour plots
I'm trying to make a set of contour plots of bivariate kernel density estimates, showing three such plots overlaid, similar to this plot http://euclid.psych.yorku.ca/SCS/Private/Test/ridge-boot2.pdf except that I would like to have the contours *filled* (using transparent colors). To make this reproducible, I've saved the results of KernSmooth::bkde2D() in the following file:
2007 Dec 05
1
Working with "ts" objects
I am relatively new to R and object oriented programming. I have relied on SAS for most of my data analysis. I teach an introductory undergraduate forecasting course using the Diebold text and I am considering using R in addition to SAS and Eviews in the course. I work primarily with univariate or multivariate time series data. I am having a great deal of difficulty understanding and working with
2007 Oct 24
2
Graphics - plotting two graphs
Hi, I wanted to plot 2 lines on a single graph. Each graph has one axis that can be common. The code that I'm using is: ------------------------------------------------------- par(mfrow=c(1, 1)) x1 <- c(2, 4, 6, 8, 10, 12) x2 <- c(10, 20, 30, 40, 50, 60) y1 <- c(10,12,15,22,34,21) y2 <- c(40, 130, 150, 145, 40, 30) par(las=1, mar=c(4, 4, 2, 4)) plot.new()
2008 Aug 15
6
continuous coloring of a polygon
R2.7.1, WinXP Hi, I have a polygon inside a circle as follows: radius <- 3 x <- seq(-radius,radius,length=2000) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="", xlab="", axes=F) radius <- 2.7 x1 <- seq(-radius,radius,length=2000) y1 <- sqrt(radius^2-x1^2)
2017 Jun 19
1
arrows: no vectors for "code" and "angle" parameters
I was teaching new R users to make some fun graphs. I had some arrows examples worked up we came across a problem. The arrows function ignores 2nd and following elements of vectors given as code an angle. Would you please consider 1) allowing vectors for code and angle, or 2) returning an error or warning when user mistakenly supplies a vector for those parameters? When code like this is
2013 Mar 29
1
multiple plots and looping assistance requested (single plot)
HI Irucka, Please check this: temp<- structure(list(`:Bostoncitydata` = structure(list(Month = c(1L, 2L, 3L, NA), Data1 = c(1.5, 12.3, 11.4, NA), Data2 = c(9.1342, 12.31, 3.5, NA)), .Names = c("Month", "Data1", "Data2"), class = "data.frame", row.names = c(NA, -4L)), `:Chicagocitydata` = structure(list(Month = c(1L, 2L, 3L, 4L, 5L, NA), Data1 = c(1.52,
2004 Nov 08
1
plotting lm coeficients with their means
I am trying to write a function that will run a linear model and plot the regression coeficients with their corresponding means. I am having two problems. I can get the plot with the function below, but I am having trouble labeling the points. function(y,x1,x2,x3,x4){ outlm<-lm(y~x1+x2+x3+x4) imp<-as.data.frame(outlm$coef[-1]) meanvec<-c(mean(x1),mean(x2),mean(x3),mean(x4))
2017 Oct 19
1
overlaying points and lines on a surface3d rgl plot with axes
Hi R users and experts, I am interested in learning more about the use of 3D plots. Specifically, I want to add points and lines to a surface plot. And get the axes and labels plotted also. Here is what I have tried with an example data set : library(rgl) vol2 <- 2*volcano # Exaggerate the relief library(reshape) mvol2 <- melt(vol2) str(mvol2) # First, persp and persp3d plots do not succeed
2010 Sep 05
1
Add y-title to a plot with two y axis
Hi all, We managed to plot two series on the same graph, with two y-axis, however, we haven't managed to add a title to the second y-axis x1=rnorm(25, mean=0, sd=1) y1=dnorm(x1, mean=0, sd=1) x2=rnorm(25, mean=0, sd=1) y2=dnorm(x2, mean=0, sd=1) plot(x1, y1, type='p', xlab='x', ylab='y') par(new=TRUE) plot(x1, y2, type='p', axes= FALSE,
2010 Dec 25
2
predict.lrm vs. predict.glm (with newdata)
Hi all I have run into a case where I don't understand why predict.lrm and predict.glm don't yield the same results. My data look like this: set.seed(1) library(Design); ilogit <- function(x) { 1/(1+exp(-x)) } ORDER <- factor(sample(c("mc-sc", "sc-mc"), 403, TRUE)) CONJ <- factor(sample(c("als", "bevor", "nachdem",
2007 Dec 13
2
Overlaying trellis xyplot on contourplot
Friends: I wish to overlay data points on a contour graph. The following example produces a nice contour plot, but I have not mastered the concept of using panel functions to modify plots. Can someone show me how to overlay the data points (given after contour plot statement) on the contourplot? --Seth model <- function(a,b,c,X1,X2) # provide model function for contour
2010 Mar 17
1
Cropped graph using lattice
I'm fitting data from a mixture experiment, and I'd like to present the results in a ternary graph with contours. I found this code by Walmes Zeviani http://n4.nabble.com/Triangular-filled-contour-plot-td1557386.html which is just what I want--except I would like the axis titles and labels to be proportionately larger than the ternary graph itself, for legibility in publication. When I
2007 Jan 26
1
plotting results from tapply
Hi, there I'm trying to plot what is returned from a call to tapply, and can't figure out how to do it. My guess is that it has something to do with the inclusion of row names when you ask for the values you're interested in, but if anyone has any ideas on how to get it to work, that would be stellar. Here's some example code: y1<-rnorm(40, 2) x1<-rep(1:2, each=20)
2008 Apr 23
2
Can I get rid of this for loop using apply?
Hey all, The code below creates a partial dependence plot for the variable x1 in the linear model y ~ x1 + x1^2 + x2. I have noticed that the for loop in the code takes a long time to run if the size of the data is increased. Is there a way to change the for loop into an apply statement? The tricky part is that I need to change the values of x1 in each step of the loop to give me the