Re: [R] sweave tables as images?

2012-05-25 Thread Yihui Xie
You may take a look at knitr's graphics manual which tells you how you can automatically crop the white margins: https://github.com/downloads/yihui/knitr/knitr-graphics.pdf ("Cropping PDF Graphics"). I'm not sure if pdfcrop works in this case, though. Regards, Yihui -- Yihui

Re: [R] knitr customization

2012-05-25 Thread Yihui Xie
Fayetteville, AR 72701 > Ph: (479) 575-6324, 575-8630 (fax) > http://definetti.uark.edu/~gpetris/ > It seems you miss the Sweave styles, and it requires trivial efforts to switch back; just use render_sweave() in your first chunk, and you will get the familiar look.

Re: [R] sweave tables as images?

2012-05-25 Thread Yihui Xie
ehind the scene. That being said, Sweave can be regarded as a subset of knitr, so if you really want to play the old trick, you still can do it in knitr. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ame

Re: [R] sweave tables as images?

2012-05-25 Thread Yihui Xie
suecomment-5266580 Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Fri, May 25, 2012 at 4:16 PM, Alexander Shenkin wrote: > Thanks Yihui, > > That's a great idea, and comes close to

Re: [R] fBasics package: dnig

2008-09-10 Thread Yihui Xie
. > > > Without looking closer at the specific distribution: Why shouldn't it be > more than 1? The density at x=0.25 of a uniform(a=0, b=0.5) distribution is > 2 - hopefully. > > Uwe Ligges > > > > >> --Raj >> -- Yihui Xie <[EMAIL PROTECTED]

Re: [R] relsurv package

2008-09-10 Thread Yihui Xie
op,data=rdata) > > with the datasets in the package (rdata and slopop) it gives me an error: > > Error in nrow(x) : object "x" not found > > 2) > If I have a date format like:"6/17/1997 " "9/10/1990 " "12/4/1996 " how > to convert it in

Re: [R] using R for online course/distance ed

2008-09-10 Thread Yihui Xie
> My question: has anyone else used R for an online course, please? If > so, did it go well, please? > > Thanks in advance, > Sincerely, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > Universi

Re: [R] All possible pairs of two variables

2008-09-10 Thread Yihui Xie
t; x : it takes all integer values from 0 to y and, > y : takes all values from 0, 10 > > I am looking for some R code to find all possible pairs of (x,y). Can anyone > please help me? > > > -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509

Re: [R] How to obtain a sequence of dates consisting of only weekdays

2008-09-11 Thread Yihui Xie
pecify "weekdays" rather than "day". > > Hope to have some assistance. > > Thank you! > > Regards, > wy -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.

Re: [R] How to obtain a sequence of dates consisting of only weekdays

2008-09-11 Thread Yihui Xie
see. That's a nice idea. Thanks. > > In that case, I suppose I will have to manually find out the starting weekday > of the first day specified (I will have to know whether the starting day is > Tuesday, Wednesday etc) before subsetting using what you have mentioned below. > &g

Re: [R] How to obtain a sequence of dates consisting of only weekdays

2008-09-11 Thread Yihui Xie
[EMAIL PROTECTED]> wrote: > Hi, > > Thanks for the reply. I also thought of your method. But it will not be quite > right if my starting day is not on a Monday. Then, it will include weekends? > Hope to have flexibility in that the starting day can be any day of the week > not

Re: [R] All possible pairs of two variables

2008-09-11 Thread Yihui Xie
>> x : it takes all integer values from 0 to y and, >> y : takes all values from 0, 10 >> >> I am looking for some R code to find all possible pairs of (x,y). Can anyone >> please help me? > > ?expand.grid > > Hadley > > -- > http://had.co.nz/ &g

Re: [R] How to load functions in R

2008-09-11 Thread Yihui Xie
f2=eval(x[2]) if more > than one function is stored in the text file > 3. use the functions as normal > > Is there another possibility to do the same? > Thank you, > > Mihai Mirauta > >[[alternative HTML version deleted]] > -- Yihui Xie <[EMAIL PROTECTE

Re: [R] How to load functions in R

2008-09-11 Thread Yihui Xie
; again in R and then save() again. > > Another better option is to consider making your own package. It may sound > complicated but once you mastered it, it makes your functions more portable > and encourages you to document it. Further, the function package.skeleton() > simplifies much o

Re: [R] Save object summary to file

2008-09-11 Thread Yihui Xie
;) > > but receive: > > Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = > stringsAsFactors) : > cannot coerce class "summary.princomp" into a data.frame > > What am I doing wrong? > > Thanks > > -- Yihui Xie <[EM

Re: [R] Greyed text in the background of a plot

2008-09-12 Thread Yihui Xie
;sourceid=searchfeed > ) > > Thanks > > Agus > -- > Dr. Agustin Lobo > Institut de Ciencies de la Terra "Jaume Almera" (CSIC) > LLuis Sole Sabaris s/n > 08028 Barcelona > Spain > Tel. 34 934095410 > Fax. 34 934110012 > email: [EMAIL PROTECTED

Re: [R] bubble(circle) plot help.

2008-09-12 Thread Yihui Xie
came across this at > http://addictedtor.free.fr/graphiques/graphcode.php?graph=73 but the > circleplot function does not exist in fbasic as listed in the document. > -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage:

Re: [R] bubble(circle) plot help.

2008-09-12 Thread Yihui Xie
MAIL PROTECTED]> wrote: >> > >> > I need help creating a bubbleplot, like a simple pseudo three >> > dimensional scatterplot of circles whose sizes index a 3rd variable. I >> > initially came across this at >> > http://addictedtor.free.fr/graphiques/gr

[R] A problem about the color of symbols exceeding the coordinate limits

2008-09-13 Thread Yihui Xie
ic of China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936 attached base packages: [1] stats graphics grDevices utils datasets methods base Thanks! Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 M

Re: [R] Greyed text in the background of a plot

2008-09-13 Thread Yihui Xie
s_rosling_s_talk Of course the example is meaningless currently because I'm not using real data as Hans Rosling did. Regards, Yihui On Fri, Sep 12, 2008 at 10:51 PM, Mark Difford <[EMAIL PROTECTED]> wrote: > > Hi Yihui, > > That's good, I like it! Very nice site. >

Re: [R] Beautify R scripts in microsoft word

2008-09-13 Thread Yihui Xie
nd my reply to a single person :-( Yihui On Sun, Sep 14, 2008 at 1:30 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > I am generating a report containing several R scripts in the appendix. Is > there any way to "beautify" the R source codes in microsoft word, similar to >

Re: [R] Beautify R scripts in microsoft word

2008-09-13 Thread Yihui Xie
osoft word, similar to > what we see in tinn-R ? > > Thanks -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beij

Re: [R] Error Running TinnR with R

2008-09-13 Thread Yihui Xie
t does not seem to work. > I would appreciate any help, as I am not vey technical in the back end of > the coding. > > Thanks > > Vijay > > -- > View this message in context: > http://www.nabble.com/Error-Running-TinnR-with-R-tp19477151p19477151.html > Sent from the

Re: [R] Greyed text in the background of a plot

2008-09-14 Thread Yihui Xie
:ts:hans_rosling_s_talk > > I'm missing the function Rosling.bubbles(), so cannot > actually try it. > > And congratulations, great site and package. > > Agus > > -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086

Re: [R] Scaling X axis from -1 to 1

2008-09-14 Thread Yihui Xie
rm? > > - Gundala Viswanath > Jakarta - Indonesia > -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmi

Re: [R] any package to do generalized linear mixed model?

2008-09-15 Thread Yihui Xie
lme4 On Mon, Sep 15, 2008 at 12:35 PM, Wensui Liu <[EMAIL PROTECTED]> wrote: > I checked GlmmML package. However, it can only do binomial and poisson > distribution. How about others such as gamma or neg binomial? > Thank you so much! > wensui > -- Yihui Xie <[EMAIL P

Re: [R] How to draw a plot like this?

2008-09-15 Thread Yihui Xie
;h") Yihui On Mon, Sep 15, 2008 at 12:00 PM, Jinsong Zhao <[EMAIL PROTECTED]> wrote: > Hi there, > > I hope to draw a plot like this: > http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif > > is it possible to draw it using R? > > thanks for any suggestions

Re: [R] plotting on the figure margin

2008-09-16 Thread Yihui Xie
?par see the 'xpd' argument; e.g. you may use legend(..., xpd = NA) or use the 'lattice' package Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statisti

Re: [R] rgl: plot3d and ellipse3d

2008-09-17 Thread Yihui Xie
Hi Michael, You need to specify both 'box' and 'axes' to FALSE to avoid the box lines (if you don't specify the latter one, there will still be axes lines). Best, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile:

Re: [R] rgl: plot3d and ellipse3d

2008-09-17 Thread Yihui Xie
No, I mean in plot3d(): plot3d(trees, type="s", size=0.5, col="blue", cex=2, box=FALSE, axes=FALSE) not in ellipse3d() Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name Schoo

Re: [R] rgl: How to position a window during open3d call

2008-09-17 Thread Yihui Xie
Thanks Duncan, I have also been wondering about this problem for a long time. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building,

Re: [R] for-loop for opening a series of files

2008-09-17 Thread Yihui Xie
Hi, you may use list.files('dir-of-your-files', ...) to get the paths of all the files, and use file.info() to get the date attribute, then order them by date, and finally in a loop for(i in paths-of-your-files){ open.ncdf(i, ...) ... } Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED

Re: [R] bubble(circle) plot help.

2008-09-17 Thread Yihui Xie
er(sq, sq, function(x, z) 10 + 1 * x + 0.5 * z + 0.5 * x * z + runif(1))) symbols(x, z, y, bg = rgb(1, 0, 0, 0.1), fg = "yellow") ## observe the bubbles from the x-axis or y-axis Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mo

Re: [R] axis text size in scatter plot

2008-09-18 Thread Yihui Xie
Generally speaking, this is controlled by the argument "cex" (or "cex.axis", "cex.lab", ...). See ?par (and ?plot, ?text, ?axis, ?legend, ?text, ...) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mo

Re: [R] about the whisker in boxplot

2008-09-18 Thread Yihui Xie
01801 [2,] 7.998199 $out numeric(0) $group numeric(0) $names [1] "1" ## as you wish... > bxp(b, ylim = range(x)) ## HTH. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name S

Re: [R] outlier and whisker in boxplot

2008-09-18 Thread Yihui Xie
Oh, the 3rd time?! :-) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Fr

Re: [R] Use of colour in plots

2008-09-18 Thread Yihui Xie
example 1 in: http://www.yihui.name/en/post/51.htm Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China,

Re: [R] How to show complete time values in a plot x axis

2008-09-18 Thread Yihui Xie
Hi, I'd suggest you use dotchart() instead of plot(). I believe this is what you expected: dotchart(value, time) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Stati

Re: [R] How to do knn regression?

2008-09-18 Thread Yihui Xie
But seriously speaking, I don't think my method is efficient. Maybe C code will be much faster, as the knn() function in package 'class' has called. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homep

Re: [R] how to keep up with R?

2008-09-18 Thread Yihui Xie
#x27;s an English book 'R for SAS and SPSS Users', you may still write a Chinese one from your own experience) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of St

Re: [R] How to show complete time values in a plot x axis

2008-09-19 Thread Yihui Xie
Sorry, I thought the time values were equal-spaced... Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of

Re: [R] Manage huge database

2008-09-22 Thread Yihui Xie
Hi, You can treat it as a database and use ODBC to fetch data from the CSV file using SQL. See the package RODBC for details about database connections. (I have dealt with similar problems before with RODBC) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86

Re: [R] Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?

2008-09-23 Thread Yihui Xie
ld be clear about is the relationship between the arguments of distribution functions in R and those in a certain theoretical distribution. Refer to http://en.wikipedia.org/wiki/Probability_distribution if you don't remember those formulae for skewness and kurtosis. Regards, Yihui -- Yihui X

Re: [R] How to draw arrows or segment lines in 3 dimensional graph

2008-09-23 Thread Yihui Xie
; (there's a function xyz.convert() in the value returned). See 'trans3d()' in 'grDevices' to know more about the transformation. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://

Re: [R] Bug in "is" ?

2008-09-23 Thread Yihui Xie
Yes, everyone will agree "7" is an integer, but I don't think computers will agree too :-) R thinks it's a double-precision number, except when you explicitly specify it as an integer (say, as.integer()). > class(7) [1] "numeric" > is.double(7) [1] TRUE

Re: [R] Generating series of distributions with the same skewness and different kurtosis or with same kurtosis and different skewness?

2008-09-23 Thread Yihui Xie
66 or 0.1835034 approximately. Then you may compute the kurtosis and find different beta values will lead to different kurtosis values (-0.7315651 and 2.139547 respectively). Is this example clear enough? Only need a little bit mathematical computation. Regards, Yihui -- Yihui Xie <[EMAIL PROTECT

Re: [R] Does R have an "inverse empirical cumulative distribution" function ?

2008-09-26 Thread Yihui Xie
Isn't the "inverse" ECDF just the quantile function?... Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmi

Re: [R] plotting with a table right under it

2008-09-27 Thread Yihui Xie
R is Not Excel, I think... But if you insist on "drawing" a table below the graph, you may use rect() and text(). Why not add your numbers directly to your bars/lines/points/...? If you can express the information in a table, why use a plot? Regards, Yihui -- Yihui Xie <[EMAIL PROT

Re: [R] retrieving weights from a polr object

2008-09-27 Thread Yihui Xie
22 36 10 11 36 61 23 17 43 35 40 26 18 54 13 9 10 8 8 12 6 7 9 18 6 7 15 13 13 7 5 11 14 19 37 17 23 40 3 5 23 78 46 43 48 45 86 [52] 15 25 62 20 23 20 10 22 24 7 10 21 57 23 13 31 21 13 5 6 13 ## Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509

Re: [R] formula form of coxph

2008-10-02 Thread Yihui Xie
> idx = c(1,3,5) > as.formula(paste("Surv(time, status)~", paste("x", idx, sep = "", collapse = > "+"))) Surv(time, status) ~ x1 + x3 + x5 Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086

Re: [R] color code from csv

2008-10-03 Thread Yihui Xie
will be more natural for you, as palette() in 'grDevices' has only 8 colors by default. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main

Re: [R] font color

2008-10-03 Thread Yihui Xie
Hi, isn't the 'col' argument sufficient? e.g. plot(1:26,pch=letters,col=1:26) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde

Re: [R] Time Interval calculation using R

2008-10-04 Thread Yihui Xie
You seem to have omitted a left quotation mark in (2): %H:%M:%S". Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin Un

Re: [R] Help on R Coding

2008-10-04 Thread Yihui Xie
You used variable names 'Date' and 'Cult' in lm2, but *different* names 'Cultc52' and 'Dated16' for prediction. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://

Re: [R] Tinn-R command line argument to increase memory limits.

2008-10-06 Thread Yihui Xie
You can add the arguments here: Options --> Application --> R --> Path Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Re

Re: [R] Write multiple objects / data frames into a single .csv -- write.csv

2008-10-09 Thread Yihui Xie
use "append = TRUE" or rbind() your data.frames together before writing the csv file. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Ming

Re: [R] rgl_081.708: rgl.snapshot fails, causing persistent problems

2008-10-10 Thread Yihui Xie
Thanks, Duncan, I was encountered with the same problem as Michael, and just now I found the version you provided in your homepage could solve this problem well. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Ho

Re: [R] trouble with combining png and pdf

2008-10-15 Thread Yihui Xie
or other software to optimize the file size of your pdf output. These issues are irrelevant to R, so I'll not provide further details here. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.y

Re: [R] plot - central limit theorem

2008-10-15 Thread Yihui Xie
mality - so I performed the Shapiro-Wilk test and plotted the P-values under the demo. See the function clt.ani() in the package 'animation', or http://animation.yihui.name/prob:central_limit_theorem You can use any function to denote the population (specify the argument 'FUN')

Re: [R] histogram without bars but with density line

2008-10-16 Thread Yihui Xie
plot(density(x)) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Thu,

Re: [R] histogram without bars but with density line - frequency-lines?

2008-10-16 Thread Yihui Xie
Bars are corresponding to bins, and the bin-width for lines is 0; please tell me what is the "frequency" at a fixed point (rather than over an interval)? Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-1581080587

Re: [R] A question about "union"

2008-10-17 Thread Yihui Xie
You need to get() their elements instead of merely using variable names. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building,

Re: [R] plot - central limit theorem

2008-10-19 Thread Yihui Xie
For example, for the uniform distribution over (a, b), mean = (a+b)/2 and sd=(b-a)/sqrt(12*n) (although in the case of large sample sizes these results will be very close) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepa

Re: [R] plot - central limit theorem

2008-10-19 Thread Yihui Xie
Thanks, Duncan, I agree with you in terms of doing the tests independently. I've modified the code and updated the package at R-forge. As for the choice of vertical bars or points, you are free to provide the option "type = 'h'" or "type = 'p'"

Re: [R] code works in R desktop but not iin RWeb - How do I modify to get it working in RWeb, please?

2008-10-21 Thread Yihui Xie
"c:/test8.txt" is in *your* local disk, so Rweb cannot read the data file! You should submit your data to Rweb using the button "Browse" which will "Select a local file to submit". Note the name of the data variable will be 'X' (instead of your 'happ

Re: [R] code works in R desktop but not iin RWeb - How do I modify to get it working in RWeb, please?

2008-10-22 Thread Yihui Xie
9)"? By the way, please read the post guide -- I have no way to reproduce your result. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Bui

Re: [R] code works in R desktop but not iin RWeb - How do I modify to get it working in RWeb, please?

2008-10-23 Thread Yihui Xie
Well, I know the problem now. The Rweb at math.montana.edu is rather old (and slow!), I think. Try the one at stat.umn.edu: http://spider.stat.umn.edu/Rweb/ and you'll get the right result. Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-8250

Re: [R] Error Running TinnR with R

2008-10-25 Thread Yihui Xie
Settings/username/Application Data/Tinn-R/tmp/block.r', 'C:/Documents and Settings/username/Application Data/Tinn-R/tmp/lines.r') Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui

Re: [R] Semi-random movement inside a circle

2008-12-18 Thread Yihui Xie
^2) x[cond] = x[cond]/r/1.1 # use 1.1 due to the size of points y[cond] = y[cond]/r/1.1 points(x, y, col = 1:n, cex = 2) Sys.sleep(0.1) } Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Sta

Re: [R] imputing the numerical columns of a dataframe, returning the rest unchanged

2008-12-23 Thread Yihui Xie
chr [1:5] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" ... I'd suggest you get the class of each column first, then apply impute() to these columns (i.e. DF[, sapply(DF, class) == "numeric"]) and assign the new values to the origi

Re: [R] Warning message:In pt(q, df, lower.tail, log.p) : NaNs produced

2009-01-06 Thread Yihui Xie
Obviously your df=0 in pt(STATISTIC, df). Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Tue, Jan

Re: [R] basic sweave question

2009-01-12 Thread Yihui Xie
"Sweave.sty" is in the directory file.path(R.home(), 'share', 'texmf') Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmi

Re: [R] Error installing ggobi in R, Ubuntu Intrepid Ibex

2009-02-10 Thread Yihui Xie
You may read the article in the latest volume of R News: Hadley Wickham, Michael Lawrence, Duncan Temple Lang, and Deborah F. Swayne. An introduction to rggobi. R News, 8(2):3-7, October 2008. Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877

Re: [R] plot slideshow

2009-02-10 Thread Yihui Xie
Or if the computation is time-consuming, you may try the 'animation' package, which has provided an HTML/JavaScript approach to show your graphs one by one, either automatically or manually. See http://animation.yihui.name/animation:start for details. Regards, Yihui -- Yihui Xie Phone:

Re: [R] Chinese language R email list?

2009-02-10 Thread Yihui Xie
Welcome to cos.name :-) And thanks for your "advertising", Ronggui! Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of Chin

Re: [R] Tinn-R

2009-02-10 Thread Yihui Xie
Tinn-R is for MS Windows only. You may take a look at: http://www.sciviews.org/_rgui/projects/Editors.html Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building

Re: [R] Help with rgl

2009-02-17 Thread Yihui Xie
(1) you'll need ImageMagick installed to use the command "convert" to convert image sequences into GIF animations; see ?movie3d (2) "viewport" is read only!! see ?open3d carefully Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-1

Re: [R] Help with rgl

2009-02-17 Thread Yihui Xie
"Chinese extend a helping hand to Russians who happen to be in Brazil about a package written in Germany," which gladdened an American. Trotsky would be even more proud -- and amazed!! :-) Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-1

Re: [R] alpha shape function

2009-02-18 Thread Yihui Xie
er points, so the last whole polygon looks weird... Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On We

Re: [R] question about loading date file in R

2009-02-23 Thread Yihui Xie
The interface is so self-explaining... Data --> Import data --> text files... # pls don't mind :) library(fortunes) fortune(15) Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics

Re: [R] Chull function

2009-03-09 Thread Yihui Xie
Isn't the single example enough in help(chull)? In your case I think you are finding the probability of length(chull(x)) == 3. Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room

Re: [R] North Arrow (.png file) on a Map

2009-03-10 Thread Yihui Xie
t(x, y, "N", adj = c(0.5, 0), cex = 4) } plot(1, type = "n", ylim = c(0, 1)) north.arrow(1, 0.8, 0.3) Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde M

Re: [R] how to rotate the histogram

2009-03-12 Thread Yihui Xie
You may refer to the last example in ?layout Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Wed

Re: [R] sessionInfo() error

2008-10-30 Thread Yihui Xie
I think there must be something wrong with the result of packageDescription('heplots'). It should be a list, but in your case, it is a vector (probably NA, I guess). Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-1581

Re: [R] Help with impute.knn

2008-10-30 Thread Yihui Xie
Please read the help page carefully. The value returned by impute.knn() is not a list with the 'data' component but already a matrix (with two attributes)! Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-1581080587

Re: [R] Error Running TinnR with R

2008-10-31 Thread Yihui Xie
In the 'etc' directory of your installation path, e.g. C:\Program Files\R\etc Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main

Re: [R] problem of unix package installation, following code no response: install.packages("packagename", dependecise=TRUE)

2008-11-11 Thread Yihui Xie
It has nothing to do with your UNIX system. The CRAN mirror at CMU is currently not available. You may choose another mirror. For example, install.packages('SASxport', repos = 'http://cran.cnr.berkeley.edu') Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)

Re: [R] 3D trajectory plot?

2008-11-14 Thread Yihui Xie
But it's not _smooth_ (as Chris asked for)... I also thought about the plot3d(), but I don't know how to smooth the 3D points. AFAIK spline functions only work for 2D cases in R? (Sorry I'm not familiar with splines) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +

Re: [R] Vector of ones and zeros

2008-11-20 Thread Yihui Xie
or rbinom(n, size = 1, prob) Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http://www.yihui.name School of Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China

Re: [R] how to input a string without quote

2008-11-29 Thread Yihui Xie
Wow, you are so lazy... But sometimes R is just designed for lazy guys... ## f = function(a) { s = substitute(a) as.character(s) } ## > f(a = asdf) [1] "asdf" > f(qwer) [1] "qwer" Regards, Yihui -- Yihui Xie <[EMAIL PROTECTED]> Phone: +86-(0)10-8250908

Re: [R] Examples of advanced data visualization

2008-11-29 Thread Yihui Xie
quot;", " ", "", " "), paste("", sep = ""), c(" ", ""), file = file, sep = "\n") } # for example: g.brownian.motion(50, 15, digits = 2, width = 600, height = 500) # see http://

Re: [R] Examples of advanced data visualization

2008-12-02 Thread Yihui Xie
Since SVG has a lot of elements, Firefox is still under development to support different elements in SVG; see: http://www.mozilla.org/projects/svg/status.html Currently animations won't work under Firefox 3.0.4, and all the rest can be viewed using Firefox 3.0.4. Regards, Yihui -- Yihu

<    1   2   3   4