Displaying 20 results from an estimated 400 matches similar to: "a quick question about "format()""
2006 Feb 14
1
weird behavior of nsmall in format
>From the help page of format, nsmall should control the number of digits.
> format(0.123456789, nsmall = 10)
[1] "0.1234567890"
> format(0.123456789, nsmall = 1)
[1] "0.1234568"
> format(0.123456789, nsmall = 2)
[1] "0.1234568"
> format(0.123456789, nsmall = 8)
[1] "0.12345679"
It adds zeros fine but for
2009 Sep 09
2
ggplot2: mixing colour and linetype in geom_line
Hi all,
I try to represent a multiple curve graphic where the x-axis is the
temperature and the different y-axes are the different X (X22,X43,X44...)
some X corresponds to the same molecule (22 and 44 are for CO2 for instance)
so I use the same colour for them.
I wanna mix the linetype with the colour to be able to visually see the
difference between X43 and X45
The best I have done up to now
2007 Oct 02
1
splom pairs and groups argument
Hello,
I'm trying to pull off a certain graph using splom, and can't quite get my panel functions right.
Basically, the equivalent using pairs would be something like this (using iris data set as an example):
panel.corval <- function(x, y, digits=2, prefix="", cex.cor,col,pch)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
2008 Feb 24
1
Jitter in correlation matrix?
Hi,
I am just starting to use R for a graduate course, and I like how the
correlation matrix at
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=137
I did something similar by copying from the examples(pairs), but it
seems that I need to jitter the bottom panel... and I have no idea how
to do that, and I mean no idea at all. I'd appreciate any help...
Here are the graphs:
2008 Jun 19
1
PrettyR (describe)
#is there a way to get NA in the table of descriptive statistics instead of
the function stopping Thank you in advance
#data
x.f <- structure(list(Site = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L), .Label = c("BC", "HC", "RM119", "RM148", "RM179",
"RM185",
2009 Mar 11
2
Combining math and variables in expression
I am trying to get the following line in a plot margin using mtext:
100% Area = 120.000 km^2
Where I intend that "100% Area =" is text, 120.000 is a number that varies
according to different data, and km^2 should be a neat
km-with-superscript-2.
The expression function fails me, since it apparently cannot coerce an
expression when a variable is involved.
In the R help file there is
2011 Nov 24
1
pairs(), expression in label and color in text.panel
Hello,
I'd like to add custom labels to my pair() plot. These
labels include math expression but they aren't correctly
displayed...
Further, I want that the boxes for the text.panel (diagonal)
have an other background color (grey80). Is that generally
possible? If yes how do I have to set it?
What I've so far is:
panel.cor <- function(x, y, digits=2, prefix="",
2009 Jan 05
1
Error : unused arguments in pairs()
Hi there,
I am just starting in R and this might be a very basic question.
I applied one on the examples of
pairs()
to my own data. The examples shows scatter plots on one side of the matrix
and the correlation coefficients on the other which works well. I then
modified it slightly because I want different colors in the plots. Now i am
getting the error of unused arguments, because the color
2002 Aug 23
2
Surprising result from integrate
Hi all,
sorry for this extensive question, but I think that I'm missing something
fundamental.
I stepped into a surprising result with the integrate function and I would
be glad if someone could put some light onto this. I try to integrate over
an s-shaped growth-function. The results from this calculation seem to be
correct for small values of t. Just for fun I tried some large values and
2010 Sep 30
2
panel.pairs in splom
Hello,
I have a customized pairs () fonction as follows that displays correctely my
data.
------------------------------------------------------------------------
panel.cor1 <- function (x, y, digits=2, prefix="")
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r <- cor(x, y,use="pairwise.complete.obs",
2010 Aug 31
1
"pairs" with same xlim and ylim scale
Hi list,
I have a function which basically is a wrapper of pairs with some useful panel
functions. However, I'm having trouble to pass the "xlim" and "ylim" into the
function so the x and y axes are in the same scale and 45 degree lines are
exactly diagonal. I've looked at some old posts, they didn't help much. I
think this is b/c I have multiple panel
2009 Jan 31
1
display p-values and significance levels
Hi there,
I got a piece of code for the Iris data which allows to display correlation
coefficients for each Iris species in the lower panel (color coded). I would
now like to add e.g. a "*" to show the significance of each correlation next
to the correlation coefficient.
Furthermore I would like to make a t.test between the species "setosa" and
"versicolor" for
2018 Jan 31
2
swiotlb buffer is full
Hello,
I've noticed firefox got randomly stuck, and as sometimes that leads to a
complete system lock-up, I've checked dmesg and got this:
[Jan29 10:49] nouveau 0000:01:00.0: swiotlb buffer is full (sz: 2097152 bytes)
[ +0.000033] swiotlb: coherent allocation failed for device 0000:01:00.0 size=2097152
[ +0.000004] CPU: 6 PID: 1023 Comm: Xorg Not tainted 4.15.0-rc8 #1
[ +0.000003]
2008 Mar 24
1
Inaccurate qgamma() (PR#11030)
I haven't looked inside to see what is causing this, but there's a big
discontinuity in qgamma:
curve(qgamma(x, shape=19), from=1e-10, to=2e-10)
This appears in both R-patched and R-devel.
Duncan Murdoch
2003 Aug 01
2
'format' problem
Dear R experts,
format(12345678, digits = 2)
gives
[1] "1.2e+07"
while
format(1234567, digits = 2)
gives
[1] "1234567"
but I'd like the last number to be represented as "1.2e+06" string too.
Where am I wrong?
Thanks,
Timur.
2011 Jan 11
1
Postscript function Bug at R x64 2.12.1?
Hi list. I was saving my modified pairs graphic using a custom panel from
the R Graphics site, and I got an interesting difference in the final image
when I save it as eps or png.
This custom panel make possible to show at the left side of the pairs plot
the p-value as symbol and the correlation r value with its cex proportional
to the r value itself.
Well, when saving as a png file
2009 Dec 06
2
Error in eval(expr, envir, enclos) : object 'N' not found
I'm running an LSODA to generate some graphs, but I need to stop at a certain
point and use those values to generate another LSODA output. This is
working fine, but when I try to run the second LSODA, I get the "Error in
eval(expr, envir, enclos) : object 'N' not found". Any ideas what can be
causing this? I have no object 'N' anywhere in the script. I made an
2011 Jul 13
1
AR-GARCH with additional variable - estimation problem
Dear list members,
I am trying to estimate parameters of the AR(1)-GARCH(1,1) model. I have one
additional dummy variable for the AR(1) part.
First I wanted to do it using garchFit function (everything would be then
estimated in one step) however in the fGarch library I didn't find a way to
include an additional variable.
That would be the formula but, as said, I think it is impossible to add
2010 Dec 02
4
Integral of PDF
The integral of any probability density from -Inf to Inf should equal 1, correct? I don't understand last result below.
> integrate(function(x) dnorm(x, 0,1), -Inf, Inf)
1 with absolute error < 9.4e-05
> integrate(function(x) dnorm(x, 100,10), -Inf, Inf)
1 with absolute error < 0.00012
> integrate(function(x) dnorm(x, 500,50), -Inf, Inf)
8.410947e-11 with absolute error <
2006 Sep 10
1
R number output format
I'd like to save the number 0.0000012 to a file just as it appears, but when
I dput(0.0000012, "t.txt"), I got 1.2e-06, NOT 0.0000012.
Anybody knows how I can do this?
> 0.0000012
[1] 1.2e-06
> as.character(0.0000012)
[1] "1.2e-06"
> dput(0.0000012, "t.txt")
Thanks.
[[alternative HTML version deleted]]