Displaying 20 results from an estimated 8000 matches similar to: "Plotting a quadratic line on top of an xy scatterplot"
2011 Feb 17
4
Find and replace all the elements in a data frame
Hi all,
I'm having a problem once again, trying to do something very simple. Consider
the following data frame:
x <- read.table(textConnection("locus1 locus2 locus3
A T C
A T NA
T C C
A T G"), header = TRUE)
closeAllConnections()
I am trying to make a new data frame, replacing "A" with "A/A", "T" with "T/T",
"G" with
2011 Feb 20
3
Partial italic in graph titles when looping
Dear all,
I have a rather complicated problem. I am trying to loop through making graphs,
so that the graph-making process is fully automated. For each graph, I'd like to
make sure the corresponding title is formatted properly. The titles will be a
combination of a gene name and numerical position within the gene. The gene name
should be italic-bold, whereas the gene position should be
2011 Apr 16
2
Rotating the x-axis labels of a barplot
Dear listserv,
Here is my latest formatting problem. I would like to rotate the x-axis labels
by 45 degrees on a _barplot_. Apparently this is slightly different from the
example given in the R FAQ, which is for rotating the x-axis labels on a
scatterplot
(http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f).
I have adapted that code, as best I could, and
2008 May 22
1
Plotting a Quadratic...
I have an equation describing the best-fit model for a set of points (just 2
axes) that is in the form:
y=b+mx+px^2
Where b is the intercept, m is the slope describing a linear term, and p is
a slope of the quadratic term.
I would like to plot this equation on a curve (I know the equation is
y=(.1766x^2)+(.171x)+.101) on the original scatterplot. Any easy way to plot
this equation and
2017 Sep 24
3
Shift the normal curve to the top or near to the top of the histogram
Dear All:
One more thing.
I want to add the normal curve to the histogram. Is there away to stretch
the peak of the curve to the top of the histogram or at least near to the
top of the histogram.
Please see the code below.
Lizard.tail.lengths <- c(6.2, 6.6, 7.1, 7.4, 7.6, 7.9, 8, 8.3, 8.4, 8.5,
8.6,8.8, 8.8, 9.1, 9.2, 9.4, 9.4, 9.7, 9.9, 10.2, 10.4, 10.8,11.3, 11.9)
x<-seq(5,12, 0.001)
2010 Sep 16
3
Help with customizing a histogram figure
Hi all,
Please consider the following code:
require(plotrix)
l <- list(rnorm(50),rnorm(50,sd=2),rnorm(50,mean=3))
multhist(l)
I have two things I need help with:
(1) In the output, there are empty spaces on the x-axis. How would I eliminate
these spaces? I want a nice, smooth, empty-spaceless x-axis.
(2) How could I add tracing lines to each histogram? I am undoubtedly using the
wrong
2010 Jun 18
1
Fitting a polynomial using lrm from the Design library
Hi all,
I am looking to fit a logistic regression using the lrm function from the Design library. I am interested in this function because I would like to obtain "pseudo-R2" values (see http://tolstoy.newcastle.edu.au/R/help/02b/1011.html).
Can anyone help me with the syntax?
If I fit the model using the stats library, the code looks like this:
model <- glm(x$trait ~ x$PC1 +
2010 Jun 16
2
Accessing the elements of summary(prcomp(USArrests))
Hello again,
I was hoping one of you could help me with this problem. Consider the sample data from R:
> summary(prcomp(USArrests))
Importance of components:
PC1 PC2 PC3 PC4
Standard deviation 83.732 14.2124 6.4894 2.48279
Proportion of Variance 0.966 0.0278 0.0058 0.00085
Cumulative Proportion 0.966 0.9933 0.9991 1.00000
How do I access the
2017 Sep 25
0
Shift the normal curve to the top or near to the top of the histogram
Hi Abou,
Try this:
library(plotrix)
curve(rescale(dnorm(x
,mean=mean(Lizard.tail.lengths),sd=sd(Lizard.tail.lengths)),
c(0,6)),add=TRUE, col=2, lwd = 2)
Jim
On Mon, Sep 25, 2017 at 9:35 AM, AbouEl-Makarim Aboueissa
<abouelmakarim1962 at gmail.com> wrote:
> Dear All:
>
> One more thing.
>
> I want to add the normal curve to the histogram. Is there away to stretch
> the
2010 Oct 06
2
Pointing to a specific place on the x-axis with an arrow
Hi all,
I am trying to do something simple, but which is deviling me. I want to add an
up-arrow to the x-axis, pointing to a specific location on the axis. I want the
arrow to be as large as possible.
Here is where I'm at with my code:
#this part if from the ?plot example:
require(stats)
plot(cars)
lines(lowess(cars))
#I am trying to use mtext to add the arrow... but I don't know how
2017 Sep 24
2
Remove spacing at the top and bottom of a plot
Dear All:
Is there is away to remove spacing at the top and the bottom of a plot? If
so, any help will be appreciated.
Please use this code as an example:
par(mfrow=c(1,2))
lizard <- c(6.2, 6.6, 7.1, 7.4, 7.6, 7.9, 8, 8.3, 8.4, 8.5, 8.6,8.8, 8.8,
9.1, 9.2, 9.4, 9.4, 9.7, 9.9, 10.2, 10.4, 10.8,11.3, 11.9)
n.draw <- 100
mu <- 9
n <- 24
SD <- sd(lizard)
draws <-
2010 Sep 26
2
Splitting a data frame into several completely separate data frames
Hello again,
How do I split a data frame into smaller, completely separate data frames
(rather than separate data frames comprising a single "list")? Consider the
following data, and my coding attempt:
x <- read.table(textConnection("id type number
indv.1 bagel 6
indv.2 bagel 1
indv.3 donuts 10
indv.4 donuts 9"), header = TRUE)
closeAllConnections()
x.split <-
2017 Sep 24
0
Remove spacing at the top and bottom of a plot
The default margins are set as lines below, left, top, and right using mar=c(5.1, 4.1, 4.1, 2.1). Just change the top margin something like 1.1:
par(mfrow=c(1,2), mar=c(5.1, 4.1, 1.1, 2.1))
---------------------------
David L. Carlson
Department of Anthropology
Texas A&M University
-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of AbouEl-Makarim
2004 Nov 03
4
Newbie question: plotting regression models
Greetings.
Is there any way to get R to take a regression model object and draw a
plot of the regression function? How about overlaying that plot over a
scatterplot of the actual data? Thanks in advance for any help anyone
can provide.
Aaron
-----
Aaron Solomon?? (??ben Saul Joseph??) ??Adelman
E-mail??: ??adelmaas at musc.edu
Web site??: ??http??://??people.musc.edu??/??~adelmaas??/??
2009 May 11
1
3d Scatterplot using rgl
Hi,
I am trying to plot a 3d scatter plot using the rgl package but am having trouble.
I have a matrix containing x, y and z co-ordinates and a fourth element related to a count variable.
I would like to plot the points using plot3d with the sizes of the points related to the fourth element in the matrix. Is this possible with plot3d or do I need to use something else?
I include a small example
2011 Mar 22
1
how to convert a data.frame to a list of dist objects for individual differences MDS?
I have a 45 x 16 data frame consisting of dissimilarities among 10
colors, giving in each
column the 45 = 10*9/2 pairwise judgments for one of 16 subjects. The
rownames
identify each pair of colors, e.g, "AC" = ("A","C"), and the pairs are
ordered by columns
in the lower triangle of each distance matrix.
> helm.raw <-
2012 Mar 04
2
How do I create a scatterplot with two explanatory variables?
Hi there,
I'm trying to make a scatterplot of removed versus duration for each type of bee. No matter what I try, I can't seem to get my code to work.
Any help would be appreciated. Thanks!
My r-code:
dat$BEE <- with(dat, factor(BEE, c(1,2)))
plot(REMOVED~DURATION,pch=BEE, col=BEE) REMOVED DURATION BEE
1 0.07 2 QUEEN
2 0.10 5 QUEEN
3 0.11 7 QUEEN
4 0.12 11 QUEEN
5 0.15 12 QUEEN
6 0.19
2006 Jan 17
5
simple question
How do I pass parameters from one controller to another during
redirect_to command? I want to pass both model and non-model objects.
The solution I use is via session, but I rather pass it as parameters to
the redirect_to
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Apr 03
15
How should I pick a random entry from the database?
Hi guys. Total newbie here. I''ve been doing web stuff since 1996 but
only began the foray into scripting last year. I haven''t got my skull
completely 360 degrees around OOP yet. It''s just me here (in Japan) and
there are no Ruby groups in my area (never mind any in English).
I''ve got a database table - real simple: question, answer, and id fields
- and I
2005 Oct 04
1
Rcmdr and scatter3d
Hi folks,
I'd like to use scatter3d (which is in R commander) to plot more than one
dataset in the same graph, each dataset with a different color. The kind
of stuff you would do with "holdon" in Matlab.
I read a recent message that was posted to this list with a similar
problem, but I couldn't understand the reply. Could someone give me one
example? How do you plot subgroups