similar to: how to change the format of numeric variable

Displaying 20 results from an estimated 10000 matches similar to: "how to change the format of numeric variable"

2010 Jun 24
2
count data with a specific range
I would like to prepare the data for barplot. But I only have the data frame now. x1=rnorm(10,mean=2) x2=rnorm(20,mean=-1) x3=rnorm(15,mean=3) data=data.frame(x1,x2,x3) If there a way to put data within a specific range? The expected result is as follows: range x1 x2 x3 -10-0 2 5 1 (# points in this
2010 Feb 02
1
[R] Suppressing scientific notation on plot axis tick labels (PR#14202)
On 02/02/2010 6:20 AM, Dimitri Shvorob wrote: > Ruben Roa has kindly suggested using 'scipen' option - cf. > >> fixed notation will be preferred unless it is more than ???scipen??? digits >> wider. > > However, > > options(scipen = 50) > x = c(1e7, 2e7) > barplot(x) > > still does not produce the desired result. This is strange. I see what
2010 Feb 02
2
Suppressing scientific notation on plot axis tick labels
Is there a better alternative to x = c(1e7, 2e7) x.lb = c(0,1e7,2e7) s.lb = format(x.lb, scientific = FALSE, big.mark = ",") barplot(x, yaxt = "n", ylab = "") axis(side = 2, at = x.lb, labels = s.lb) (I am sure there is a better alternative to line 2 :)). Thank you. -- View this message in context:
2010 Jun 22
2
Verify the linear regression model used in R ( fundamental theory)
Hi, folks, As I understand, Least-squares Estimate (second-moment assumption) and the Method of Maximum Likelihood (full distribtuion assumption) are used for linear regression. I do >?lm, but the help file does not tell me the model employed in R. But in the book 'Introductory Statistics with R', it indicates R estimate the parameters using the method of Least-squares. However it
2010 Jul 21
2
Variance of the prediction in the linear regression model (Theory and programming)
Hi, folks, Here are the codes: ############## y=1:10 x=c(1:9,1) lin=lm(log(y)~x) ### log(y) is following Normal distribution x=5:14 prediction=predict(lin,newdata=x) ##prediction=predict(lin) ############### 1. The codes do not work, and give the error message: Error in eval(predvars, data, env) : numeric 'envir' arg not of length one. But if I use the code after the pound sign, it
2008 Sep 15
1
modifying this barplot
Here is an example barplot that needs some tweaking: library(gplots) ratios <- data.frame(c(0.05,0.10,0.9),c(0.06,0.15,0.76)) rownames(ratios) <- c("T1","T2","T3") colnames(ratios) <- c("A1","A2") ratios <- as.matrix(ratios) myplot <- barplot2(ratios, beside = TRUE,col = c("blue",
2010 Jul 02
2
how to save summary(lm) and anova (lm) in format?
Hi, folks, I would like to copy the output of summary(lm) and anova (lm) in R to my word file. But the output will be a mess if I just copy after I call summary and anova. ##################### x=rnorm(10) y=rnorm(10,mean=3) lm=lm(y~x) summary(lm) Call: lm(formula = y ~ x) Residuals: Min 1Q Median 3Q Max -1.278567 -0.312017 0.001938 0.297578 1.310113
2004 Aug 24
2
how to set the number format to pure numeric?
Hello, I want to export a numeric matrix in pure numeric format, i.e. I want 0.0001 to appear as "0.0001". But it seems the default setting for write.table is scientific notation, i.e. it will appear as "1e-04". how to set the number format to pure numeric? Thank you very much for your help. cheers, lichi shi
2010 Jun 23
1
How to 'understand' R functions besides reading R codes
Apologize for not being clearer earlier. I would like to ask again. Thank Joris and Markleeds for response. Two examples: 1. Function 'var'. In R, it is the sum of square divided by (n-1) but not by n. (I know this in R class) 2. Function 'lm'. In R, it is the residual sum of square divied by (n-2) not by n, the same as in the least squares estimate. But the assumption following
2010 Jun 21
2
How to predict the mean and variance of the dependent variable after regression
Hi, folks, As seen in the following codes: x1=rlnorm(10) x2=rlnorm(10,mean=2) y=rlnorm(10,mean=10)### Fake dataset linmod=lm(log(y)~log(x1)+log(x2)) After the regression, I would like to know the mean of y. Since log(y) is normal and y is lognormal, I need to know the mean and variance of log(y) first. I tried mean (y) and mean(linmod), but either one is what I want. Any tips? Thanks in
2010 Jun 29
3
How to delete the replicate rows by summing up the numeric columns
Hi, folks, I am sorry that I did not state the problem correctly yesterday. Please let me address the problem by the following codes: first=c('u','b','e','k','j','c','u','f','c','e')
2012 Aug 29
3
Help on calculating spearman rank correlation for a data frame with conditions
Dear all, Suppose my data frame is as follows: id price distance 1 2 4 1 3 5 ... 2 4 8 2 5 9 ... n 3 7 n 8 9 I would like to calculate the rank-order correlation between price and distance for each id. cor(price,distance,method = "spearman") calculate a correlation for all. Then I tried to use apply(data,list='id',cor(price , distance , method =
2006 Feb 09
2
write.table
Hello! When using the command "write.table" I want to convert the format: 5e-04 to .0005. How can I do it? The only option I found is to use write.matrix but then I cant add rownames. Thank you Ronen [[alternative HTML version deleted]]
2012 Feb 16
2
help with e+01 number abbreviations
Dear List, I will appreciate any advice regarding how to convert the following numbers [I got in return by taxondive()] in numeric integers without the e.g. 6.4836e+01 abbreviations. Thank you very much in advance, Gian > taxa_dive Species Delta Delta* Lambda+ Delta+ S Delta+ Nat1 5.0000e+00 6.4836e+01 9.5412e+01 6.7753e+02 8.7398e+01 436.99 Nat2
2010 Feb 02
0
[R] Suppressing scientific notation on plot axis tick labels (PR#14203)
murdoch at stats.uwo.ca wrote: > On 02/02/2010 6:20 AM, Dimitri Shvorob wrote: >> Ruben Roa has kindly suggested using 'scipen' option - cf. >> >>> fixed notation will be preferred unless it is more than =C3=A2=E2=82=AC= =CB=9Cscipen=C3=A2=E2=82=AC=E2=84=A2 digits >>> wider. >> However,=20 >> >> options(scipen =3D 50) >> x =3D
2009 Aug 12
2
R numeric string problem
Hi, I have a text (.dat) file, in which each row contains several long numeric strings. One of the strings is 38 digits long, for example: 03200801200801172008011720092904008901 When I read in the data file, this string shows up as 3.200801e+36. To get rid of the scientific notation, I used "options(scipen=999)." When I did this, the scientific notation went away, but the numeric
2010 Aug 09
1
x-axis annotation
Hi, I have a simple plot by plot(x,y, log='xy'). However, due to the large range of values of x, the x-axis annotation is printed as "2e+02 1e+03 5e+03 2e+04 1e+05" instead of "200 1000 5000 20000 100000". How can I make it printed as in the later one? Thanks John
2008 Jul 25
2
How to preserve the numeric format and digits ?
Instead of > m <- c(400000000, 50000000000) > paste("A", m, "B", sep="") [1] "A4e+08B" "A5e+10B" I want "A400000000" and "A50000000000"
2006 Mar 10
3
Sweave scientific real display format (e.g. 5e-12)
Dear All, I couldn't figure and couldn't google out how to make construct a pair of \Sexpr s or a LaTeX macro that would include 5\cdot 10^{-12} into the LaTeX output istead of 5e-12 . Any ideas? Thank you G?bor
2008 Jul 21
1
y-axis number format on plot, barplot etc.
I am trying to change the number format shown on the y-axis from scientific 5e05, to 500,000 etc. Does anyone know how to do this? Is there something I can add as an argument to barplot, or would it be through par? barplot(data$Value, names.arg = as.vector(data$Field), main=strTitle) [[alternative HTML version deleted]]