Displaying 20 results from an estimated 5000 matches similar to: "wishlist -- Fix for major format.pval limitation (PR#9574)"
2007 Feb 20
0
fix for a major format.pval limitation
'format.pval' has a major limitation in its implementation for example
suppose a person had a vector like 'a' and the error being ?0.001.
> a <- c(0.1, 0.3, 0.4, 0.5, 0.3, 0.0001)
> format.pval(a, eps=0.001)
The person wants to have the 'format.pval' output with 2 digits always
showing like this
[1] "0.10" "0.30"
2007 Mar 02
0
Patch for format.pval limitation in format.R
'format.pval' has a major limitation in its implementation for example
suppose a person had a vector like 'a' and the error being ?0.001.
> a <- c(0.1, 0.3, 0.4, 0.5, 0.3, 0.0001)
> format.pval(a, eps=0.001)
The person wants to have the 'format.pval' output with 2 digits always
showing like this
[1] "0.10" "0.30"
2012 Dec 14
1
format.pval () and printCoefmat ()
Hi List,
My goal is to force R not to print in scientific notation in the sixth column (rel_diff - for the p-value) of my data frame (not a matrix).
I have used the format.pval () and printCoefmat () functions on the data frame. The R script is appended below.
This issue is that use of the format.pval () and printCoefmat () functions on the data frame gives me the desired results, but coerces
2006 Apr 17
1
strsplit does not return correct value when spliting "" (PR#8777)
Full_Name: Charles Dupont
Version: 2.2.0
OS: linux
Submission from: (NULL) (160.129.129.136)
when
strsplit("", " ")
returns character(0)
where as
strsplit("a", " ")
returns "a".
these return values are not constiant with each other.
Charles Dupont
2006 Dec 13
2
exporting a table to latex
Hi
I am using the latex() command from the Hmisc package to export table
to latex. For formating of the values, I use the format() function. But
I don't manage to get the format of the values right: I don't want
scientific notation, but if I say scientific=FALSE, I get many digits
after the decimal point which I can not control with digits=... and
nsmall=... in the format command.
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
2019 Jun 20
2
base::format adds extraneous whitespace for some inputs
Dear R Core Team,
First of all, thank you for your amazing work on developing and
maintaining this wonderful language.
I just stumbled upon the following behavior in R version 3.6.0:
format(9.91, digits = 2, nsmall = 2)
format(9.99, digits = 2, nsmall = 2)
yield "9.91" and " 9.99" with an extraneous whitespace.
My expected output for the second command is
2015 Nov 19
0
format.pval
Today I stumbled upon a very strange behaviour of format.pval. If all p
values are below the threshold eps one gets
format.pval(c(0.0002, 0.0004), eps = 0.001)
## [1] "< 0.001" "< 0.001"
format.pval(0.0004, eps = 0.001)
## [1] "< 0.001"
i.e., "< [eps]" as described in the manual of format.eps.
Yet, if one ore more are above (and one or more
2012 Mar 16
2
variable values in plotmath expressions
## I would like help in using variable values in plotmath expressions
## in lattice
x <- 1:10
y <- 1:10
pval <- .95
plot(y ~ x, ## works as I want in base graphics
main=substitute(list(alpha * " = " * group("",list(p),"")),
list(p=pval)))
plot(y ~ x, ## doesn't work as intended: "pval" is displayed
main=substitute(list(alpha *
2001 Sep 25
2
glm.nb, anova.negbin
Dear R-collegues,
I'm getting an error message (Error in round) when summarising a glm.nb
model, and when using anova.negbin (in R 1.3.1 for windows):
> m.nb <- glm.nb(tax ~ areal)
> m.bn
Call: glm.nb(formula = tax ~ areal, init.theta = 5.08829537115498,
link = log)
Coefficients:
(Intercept) areal
3.03146 0.03182
Degrees of Freedom: 283 Total (i.e. Null); 282
2006 Jun 09
4
HTML nsmall vector format problem
Hello All
I am having a bit of trouble formatting my HTML with the desired number
of digits after the decimal place. Am I doing something
wrong/misunderstanding or is it a bug?
Looking at the example supplied with ?HTML.data.frame:
HTML(iris[1:2,1:2],nsmall=c(3,1),file="")
Gives html output that includes the lines:
</tr> <tr><td
2009 May 20
2
round function seems to produce maximum 2 decimals
I am trying to use round()to force R to display a specific number of
decimals, but it seems to display <=2 decimals no matter what I specify in
the digits argument. As an alternative I tried signif(), but it also
produces unexpected results. See example code and results below. Format()
works, but then the result no longer is numeric. Am I missing something
simple?
I am using R 2.9.0 on Windows
2008 May 08
2
applying cor.test to a (m, n) matrix
Hi everybody,
I would like to apply cor.test to a matrix with m rows and n columns and get the results in a list of matrices , one matrix for p.val, one for the statistic, one for the correlation and 2 for upper and lower confidence intervals, something analog with cor() applied to a matrix.
I have done my own function to get a matrix of p.values and i suppose i can build similar functions for
2012 Feb 27
1
How to incorporate interaction terms in MRM function of ecodist library?
Hi,
I'm interested in incorporating some interaction terms between my
explanatory variables (distance matrices in this case) when I'm using the
function MRM of the package ecodist. The function is doing a multiple
regression on distance matrices. I can get the function to work perfectly on
my explanatory matrices by adding a (+) sign as known. However, when I try
to use the (*) sign or
2020 Oct 15
0
package(moments) issue
moments::anscombe.test(x) does give errors when x has too few values or if
all the values in x are the same
> moments::anscombe.test(c(1,2,6))
Error in if (pval > 1) pval <- 2 - pval :
missing value where TRUE/FALSE needed
> moments::anscombe.test(c(2,2,2,2,2,2,2,2))
Error in if (pval > 1) pval <- 2 - pval :
missing value where TRUE/FALSE needed
You can use tryCatch() to
2011 Jul 12
1
problem plotting points based on different values
Hello Friends,
I am new to R and stuck with a problem.
i have two columns drug_A and drug_B, i have plotted a scatter plot
using the ggplot2 function.
My problem is with the third column, it is the p-value column.
I want to color and size points differently based on the p_value, the
p_value range is between 0<0.0001< 0.001<0.05<1.
I used a script using the ifelse loop, but it
2020 Oct 15
0
package(moments) issue
Another bad case is
> moments::anscombe.test(rep(c(1,1.1),length=35))
Error in if (pval > 1) pval <- 2 - pval :
missing value where TRUE/FALSE needed
I haven't checked the formulas carefully, but I suspect the problem is from
taking the cube root of a negative number in
z <- (1 - 2/(9 * a) - ((1 - 2/a)/(1 + xx * sqrt(2/(a -
4))))^(1/3))/sqrt(2/(9 * a))
In R, the
2004 Mar 03
3
Adding text (coefts) to pairs panels
Hi,
First of all, thanks for the efforts of all the developers and contributors
- I'm very new to R and at the moment am just using it to create some
graphics, but it seems to be quite powerful.
I've googled the archives and wasn't able to find anyhting that dealt with
this problem, so would appreciate any suggestions/tips.
In a pairs plot I'd like to plot a linear regression line
2009 Nov 13
2
format (PR#14062)
Full_Name: Dirk Jacob
Version: R 2.8.1 and 2.9.1
OS: Win XP
Submission from: (NULL) (153.96.32.62)
I want to convert numbers to strings
like:
> inputs= c(0.3+0*(1:12) )
> (format(inputs,digits=3,scientific=T,collapse=" "))
and it works
[1] "3e-01" "3e-01" "3e-01" "3e-01" "3e-01" "3e-01" "3e-01"
2020 Oct 15
2
package(moments) issue
Hi Bill,
Thanks for prompt reply and letting me know a way around it.
I have more than 1200 observations and not all the values are the same.
However, my data points are quite similar, for example,
0.079275, 0.078867, 0.070716 in millions and etc. I have run the data
without converting it to millions and I still get the same error
message. As I have kurtosis value, it should be fine for the