similar to: Plotting 3 vectors on one graph.

Displaying 20 results from an estimated 20000 matches similar to: "Plotting 3 vectors on one graph."

2008 Feb 26
4
numeric format
Hi! I'm an R newbie and this should be a trivial problem, but I can't make it work and cannot find what I'm doing wrong in the literature. I entered the the command: table<-data.frame(x, scientific=F, digits=4) table This prints a column of x with 16 useless decimal places after the decimal point. Also, it prints an unwanted index number (1-20) in the left column. How do I get rid
2009 May 19
1
Wilcoxon nonparametric p-values
When I use wilcox.test, I get vastly different p-values than the problems from Statistics textbooks. For example: The following problem comes from "Applied Statistics and Probability for Engineers", 2nd Edition, by D. C. Montgomery. Page736, problem 14.7. The problem is to compare the sample data with a population median of 8.5. The book answer is p = 0.25, wilcox.test answer is p =
2008 Jan 30
4
Loop with variable index
I have a list of 20 values. The first time through a loop I want to find the mean and stnd.dev. of the first two values; the second time through the loop I want to find the mean and stnd. dev. of the first 3 values, etc. until the last time through the loop I want to find the mean and stnd. dev. of all 20 values, so I end up with 19 means and stnd. deviations. How would I construct such a loop?
2009 Jul 08
2
Formatting a Table
I've created a short program to print a table of learning curve factors. However, I cannot figure out how to format the table to: 1) Get rid of the [1]s in the first column and replace it with the values of N. 2) Line up the first row with the factors (decimal fractions). Thanks for any help. The complete program and output is as follows: > Lc<-seq(0.70,0.95,0.05) #Specify learning
2009 May 17
1
One Sample Nonparametric
Hi! I'm doing one and two sample nonparametric tests for the median using wilcox test. For a one-sample test I use: > wilcox.test(x, mu =50 (or whatever), y=NULL,correct=TRUE) For two-sample test I use: > wilcox.test(x,y,correct=TRUE) The problem is when I try to duplicate problems from textbooks, I get p-values that are much different from the examples from the literature. They are
2007 Jul 30
8
regular expressions : extracting numbers
Hello all, I have a vector of character strings, in which I have letters, numbers, and symbols. What I wish to do is obtain a vector of the same length with just the numbers. A quick example - extract of the original vector : "lema, rb 2%" "rb 2%" "rb 3%" "rb 4%" "rb 3%" "rb 2%,mineuse" "rb" "rb" "rb 12"
2010 Jun 15
0
Plotting two ellipses in one graph
Dear R Users: What I need to do is to plot two ellipses in the same graph (one for each group). You can use either X1 or X2 as the X-axis and the other variable as the Y-axis. Also I need to show the 95% C.I. or P.I. of the overlapping part of the two ellipses, and for each ellipse separately. Data can be found at http://www.usm.maine.edu/~aaboueissa/Rhelps/dataelipse.txt Thank you so
2005 Oct 19
1
Plotting more than one series on the same graph
I'm new to R and have searched for help and consulted the the pdf manuals, but I can't seem to figure out how to plot more than one series on the same graph. I've tried using multiple par(new=TRUE) statements such as >plot(series1, ci.type="line", col="red", lwd=2, ci.lty=0, ci.col="red") >par(new=TRUE) >plot(series2, ci.type="line",
2006 Feb 13
2
Plotting contour & filled.contour in one graph
Dear All, I have a question on overlaying a filled.contour (e.g. on soil properties data) and contour (by elevation) in one graph. Both have the same z matrix dimension. I'm able to overlay both graph, but the plots dimension did not overlap well on the same plots. How can I have both filled.contour and contour on the same graph? The commands that I have written are as follows:
2010 Aug 12
3
Plotting one dot in a graph
I'd like to plot a point at the intersection of these two curves. Thanks x <- seq(.2, .3, by = .01) f <- function(x){ x*cos(x)-2*x**2+3*x-1 } plot(x,f(x), type = "l") abline(h = 0)
2009 Jun 08
3
Plotting two regression lines on one graph
Hi! I have fitted two glms assuming a poisson distribution which are: fit1 <- glm(Aids ~ Year, data=aids, family=poisson()) fit2 <- glm(Aids ~ Year+I(Year^2), data=aids, family=poisson()) I am trying to work out how to represent the fitted regression curves of fit1 and fit2 on the one graph. I have tried: graphics.off() plot(Aids ~ Year, data = aids) line(glm(Aids ~ Year,
2009 Jun 15
3
Aligning axis values when plotting more than one graph on same axes
Dear R Users, I am trying to plot a barchart with a line graph superimposed (using par(new=TRUE)). There are 12 bars and 12 corresponding points for the line graph. This is fine, except that I'm encountering two problems: 1) The position of the points (of the line graph) are not centred on the middle (horizontally) of each corresponding bar. In fact, whilst the first point is located on the
2011 Aug 30
2
Plotting multiple vectors in one window?
Hi all. Using the following code: plot(bsa, abs, col='blue', pch=16, xlim=c(0, 25), ylim=c(0.0, 1.0), xlab = expression(paste(BSA, " (", mu, "g)", sep="")), ylab=expression(A[595])) plot(unknown1, abs2, col='blue', pch=16, xlim=c(0, 25), ylim=c(0.0, 1.0), xlab = expression(paste(Unknown_1, " (", mu, "g)", sep="")),
2013 Feb 09
3
help on plotting series with different x-axis values on a graph with one x-axis
Hi, I have run into this problem a couple of times now and hope you can help! If I want to plot mulitiple series with differing x-axis values (however, all in the same range) in 1 plot with one common axis R obstruses the plots. E.g. if I plot water content against time and I start with the sampler at 5 cm depth, it plots that one right. But the next depth, 15 cm, is measured at slightly
2007 Sep 26
1
plot rows of matrix against a vector on one graph
I am very new to R and statistical analysis in general. I am trying to plot a matrix of several hundred rows against a vector of 4 values. This all has to be on the same graph with different rows represented by different color. This sounds like it should not be hard to do, but I am having problems with it. Could someone please help? Any advice appreciated!!! Thank you for your time Olena
2010 Feb 13
3
Plot different regression models on one graph
The following variables have the following significant relationships (x is the explanatory variable): linear, cubic, exponential, logistic. The linear relationship plots without any trouble. Cubic is the 'best' model, but it is not plotting as a smooth curve using the following code: cubic.lm<- lm(y~poly(x,3)) lines(x,predict(cubic.lm),lwd=2) How do I plot the data and the estimated
2005 Nov 21
1
Plotting one or more series on the same graphs
Hi, I'm from Italy (sorry for my english...). I've two questions about the plot function. I've to create a simple graph for the data set "n_species": species=sqlQuery(dati, "select count(distinct species), season from captures_complete_r group by species, season") n_species=tapply(species$count, species$season, sum) n_species=data.frame(n_species) n_species
2007 Apr 25
1
Scripting graph generation
Hi, I'm looking to automate the generation of some graphs in R. I can't seem to figure out how to script R, and change the output device of hist() or plot() to create a .gif or .png file. This seems like something that is probably really simple, and I've just overlooked the call do do it. Can anyone point me in the right direction, or maybe send a sample script? thanks, --Mike
2013 Mar 28
2
how to search a list that contains multiple dissimilar vectors?
Dear All, This is a simple question, but I'm stumped about the simplest way to search a list object such as the following: This randomish snippet: n <- c(round(runif(round(runif(1,1,10),0),1,10),0)) alist <- new("list") for (i in seq_along(n)) { alist[[i]] <- c(round(runif(round(runif(1,1,10),0),1,10),0)) } names(alist) <- sample(letters[1:length(n)]) rm(n);c(alist)
2011 Apr 23
3
Problem having tick marks aligned when plotting three graphs on top of one another.
R 2.10 Windows 7 I am trying to plot three graphs on top of each other. I need to have the axises perfectly aligned. For some reason the ticks on the y axes are slightly off so they do not perfectly align. Can someone tell me how I can get the to overlay each other perfectly? I thought the yaxp parameter would solve my problem, but it does not. My data and code follows: >