Re: [R] Paths in knitr

2017-06-08 Thread Yihui Xie
Why do you have to set the base.dir option? Regards, Yihui -- https://yihui.name On Thu, Jun 8, 2017 at 6:15 AM, wrote: > Hi All, > > I have to compile a report for the management and decided to use RMarkdown > and knitr. I compiled all needed plots (using separate R scripts) before > compilin

Re: [R] Paths in knitr

2017-06-09 Thread Yihui Xie
, but did not work. > > Can you give me a hint where I can find information/documentation on this > path issue? > > Kind regards > > Georg > > > > Gesendet: Donnerstag, 08. Juni 2017 um 15:05 Uhr > > Von: "Yihui Xie" > > An: g.maub...@weinwolf.d

Re: [R] Paths in knitr

2017-06-12 Thread Yihui Xie
hich can then easily be integrated into a Rmd > report. I have yet to see how I can include these file into a complete > report. > > Kind regards > > Georg > > > - Weitergeleitet von Georg Maubach/WWBO/WW/HAW am 12.06.2017 08:47 > - > > Von:Yihui Xie > An:

Re: [R] RMarkdown question

2017-08-29 Thread Yihui Xie
Although it is not an elegant solution, but if your output format is HTML, you can add an arbitrary empty HTML element like before your code chunk. Then you can jump to this via a link like "see [this code chunk](#foo)". Regards, Yihui -- https://yihui.name On Tue, Aug 29, 2017 at 1:30 PM, Roy

Re: [R] WordCloud Does not display in RMD File in R Studio

2016-07-29 Thread Yihui Xie
Typically you don't need to open the png() device manually. Try comment out that line. BTW, I'm not sure which wordcloud package you were using, but this one is the best one I have seen: https://github.com/Lchiffon/wordcloud2 Regards, Yihui -- Yihui Xie Web: http://yihui.name On F

Re: [R] png package in Ubuntu 12.04 with R 3.1.0

2015-05-26 Thread Yihui Xie
sudo apt-get install libpng12-dev I'm not sure about Ubuntu 12.04. You may need a different libpng??-dev. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Tue, May 26, 2015 at 2:10 AM, Gygli, Gudrun wrote: > > Dear All, > > > I am using R to analyse computer s

Re: [R] what constitutes a 'complete sentence'?

2015-07-03 Thread Yihui Xie
in doubt, I always check what MASS does: http://cran.rstudio.com/web/packages/MASS/index.html Turns out its description is not a complete sentence, either. Sounds like R has become a language for statistical computing and graphics, plus English grammar since 3.0.x. Regards, Yihui -- Yihui Xie W

Re: [R] Rmarkdown / knitr naming the output file

2015-07-06 Thread Yihui Xie
There is no direct way to get it, but you can get 1) the input filename via knitr::current_input(), and 2) the output format via knitr::opts_knit$get('rmarkdown.pandoc.to'). You may be able to figure out the output filename based on these two pieces of information. Regards, Yihui --

Re: [R] Trellis Plots: translating lattice xyplot() to ggplot()

2015-07-10 Thread Yihui Xie
o need to print() the plot, and no need to pdf(), either. See the attached PDF I generated. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Fri, Jul 10, 2015 at 7:18 PM, Rich Shepard wrote: > On Fri, 10 Jul 2015, David Winsemius wrote: > >> #Generally one needs to complete a pdf

Re: [R] Trellis Plots: translating lattice xyplot() to ggplot() [RESOLVED]

2015-07-11 Thread Yihui Xie
opefully you learned some lessons on what a reproducible example means. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Sat, Jul 11, 2015 at 9:03 AM, Rich Shepard wrote: > On Fri, 10 Jul 2015, Yihui Xie wrote: > >> Your LyX example has two problems: > > > Yihui, et a

Re: [R] Knitr/Lattice/Lyx [was: Trellis Plots: translating lattice xyplot() to ggplot()]

2015-07-11 Thread Yihui Xie
in the end. When you see errors from parse(), that often means the code is not syntactically correct. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Sat, Jul 11, 2015 at 7:07 PM, Rich Shepard wrote: > On Sat, 11 Jul 2015, Yihui Xie wrote: > >> I guess you didn't tell us yo

Re: [R] Knitr: setting echo = FALSE globally

2015-07-20 Thread Yihui Xie
Section 5.1.3 of the book "Dynamic Documents with R and knitr" is titled "Global Options". I don't know how to make it more clear for readers to find information on global options in the book. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Mon, Jul 20, 2015

Re: [R] Error in .External2(C_X11, paste("png::", filename, sep = ""), g$width, : unable to start device PNG

2015-08-11 Thread Yihui Xie
apt-get build-dep r-base-dev). Regards, Yihui -- Yihui Xie Web: http://yihui.name On Tue, Aug 11, 2015 at 8:32 AM, Ramiro Barrantes wrote: > Hello, > > I have the following reproducible knitr document: > > \documentclass{article} > \usepackage[sc]{mathpazo} > \usepackage[T1]{fo

Re: [R] Suggestions for workaround for R Markdown problem with data() ?

2015-01-12 Thread Yihui Xie
m. You may also try to reinstall the package: BiocInstaller::biocLite('IlluminaHumanMethylation450kanno.ilmn12.hg19') --- output: pdf_document --- ```{r} library(IlluminaHumanMethylation450kanno.ilmn12.hg19) data(IlluminaHumanMethylation450kanno.ilmn12.hg19) ``` Regards, Yihui --

Re: [R] RMarkdown vignettes v. Jupyter notebooks?

2018-10-11 Thread Yihui Xie
I just have one comment on the multi-language support in R Markdown (inline below): On Thu, Oct 11, 2018 at 6:19 AM Ista Zahn wrote: > > Hi Spencer, > > On Thu, Oct 11, 2018 at 5:08 AM Spencer Graves > wrote: > > > > Hello: > > > > > >What are the differences between Jupyter notebooks an

Re: [R] RMarkdown vignettes v. Jupyter notebooks?

2018-10-11 Thread Yihui Xie
In case Jeff's point was not clear enough: the *.nb.html file is very similar to *.ipynb and it is very different with other output formats that R Markdown generates. A .nb.html file is generated alongside .Rmd when you preview an R Markdown notebook, and it contains both the R Markdown source docu

Re: [R] a knitr question

2014-07-29 Thread Yihui Xie
Yeah, it is just my personal opinion. Some users like it, and some do not. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Tue, Jul 29, 2014 at 5:36 PM, Peter Alspach wrote: > Kia ora Erin > > But beware - to quote from Yihui 2013 introduction to knitr > > "It is e

Re: [R] one more knitr question, please

2014-07-30 Thread Yihui Xie
Not sure if you mean \newpage{}/\pagebreak{} in LaTeX. If that is the case, it is possible but easy, and I do not understand why you want to break a code chunk onto two pages. The easiest thing to do is just to write two code chunks. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Wed

Re: [R] a knitr question

2014-07-30 Thread Yihui Xie
with-command-prompts/) Re Rich: yes, I'm aware of approaches of post-processing the prompts, but this problem would not have existed in the first place if we do not include prompts at all. I'm not sure if it makes much sense to create some mess and clean it afterwards. Regards, Yihui -- Yi

Re: [R] a knitr question

2014-07-30 Thread Yihui Xie
No. That is not my suggestion. Joshua Wiley correctly explained what I was suggesting. Prompts are useful in the R console, but not necessarily in a report. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Wed, Jul 30, 2014 at 6:47 PM, Duncan Murdoch wrote: > So your suggestion is t

Re: [R] a knitr question

2014-07-31 Thread Yihui Xie
Great. I also said "I see the point of keeping prompts", and that is why the chunk option prompt=TRUE is provided in knitr. I may not agree with your preference, but that does not mean I should stop you completely from having your own preference. Regards, Yihui -- Yihui Xie

Re: [R] knitr and stopifnot replacement.

2014-08-22 Thread Yihui Xie
Yep, that is exactly the answer. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Fri, Aug 22, 2014 at 6:35 AM, Bart Kastermans wrote: > On 22 Aug 2014, at 12:39, Duncan Murdoch wrote: > >> On 22/08/2014, 6:02 AM, Bart Kastermans wrote: >>> I have a daily generated

Re: [R] Apply rmarkdown::render() outside the RStudio don't find pandoc

2014-08-28 Thread Yihui Xie
message so we do not have to imagine what could be wrong). Anyway, at least you have to let your system know where is pandoc-citeproc (per instructions above again), which may or may not be the problem given the missing error message. Regards, Yihui -- Yihui Xie Web: http://yihui.name On

Re: [R] shiny datatables column filtering plugin

2014-09-02 Thread Yihui Xie
, Yihui -- Yihui Xie Web: http://yihui.name On Tue, Sep 2, 2014 at 11:59 AM, Charles Determan Jr wrote: > Greetings, > > I am currently exploring some capabilities of the 'Shiny' package. I am > currently working with the most recent version of 'shiny' from

Re: [R] shiny datatables column filtering plugin

2014-09-03 Thread Yihui Xie
u want, this may or may not be enough. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Wed, Sep 3, 2014 at 7:12 AM, Charles Determan Jr wrote: > Thank you for checking Yihui, on the off chance are you familiar with any > other methods to filter on multiple conditions? > > >

Re: [R] shiny datatables column filtering plugin

2014-09-03 Thread Yihui Xie
s": [{ "search": { "regex": true }, "targets": [0, 1, 2, 3, 4] }] }) The global search box works, though. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Wed, Sep 3, 2014 at 2:09 PM, Charles Determan Jr wrote: > Thank you Yihui, this would certainly w

Re: [R] [Sweave] doesn't accept unicode?

2014-10-21 Thread Yihui Xie
pec} \usepackage{xunicode} \begin{document} <<>>= degree <- "°" print(degree) @ \end{document} Similar things apply to ü. You need to specify the argument `encoding = 'UTF-8'` when calling Sweave() or knitr::knit(). Regards, Yihui -- Yihui Xie Web: http://yihui.n

Re: [R] R Markdown and scan()

2014-10-25 Thread Yihui Xie
only way is to make a connection, such as textConnection() as you mentioned. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Sat, Oct 25, 2014 at 10:58 AM, John Fox wrote: > Dear Peter, > > Thanks for the suggestion -- it's a bit better for the example I provided > th

Re: [R] Error: pandoc version 1.12.3 or higher is required and was not found

2015-09-23 Thread Yihui Xie
ough for you to choose between knitr::pandoc() and rmarkdown::render() :-) Regards, Yihui -- Yihui Xie Web: http://yihui.name On Wed, Sep 23, 2015 at 6:13 AM, Ryszard Czermiński wrote: > I am trying to use R Markdown, but call to render() gives me an error: > Error: pandoc version 1.12

Re: [R] r-markdown - keeping figures

2015-10-21 Thread Yihui Xie
html_document: keep_md: yes --- Regards, Yihui -- Yihui Xie Web: http://yihui.name On Wed, Oct 21, 2015 at 7:21 AM, Jeff Newmiller wrote: > I think the default now is to not save them unless you set the fig.path chunk > option. > > http://kbroman.org/knitr_knutshell/pages/Rm

Re: [R] conditionally disable evaluation of chunks in Rmarkdown...

2015-11-10 Thread Yihui Xie
nyway, you may use a custom function to do it. e.g. cond_eval = function(x) { if (isTRUE(knitr::opts_chunk$get('eval'))) x } Then `r cond_eval(x)` instead of `r x`. Regards, Yihui -- Yihui Xie Web: http://yihui.name On Tue, Nov 10, 2015 at 4:40 AM, Witold E Wolski wrote: > I do

Re: [R] installing tikzDevices for R 3.2.3

2016-01-15 Thread Yihui Xie
): install.packages("tikzDevice", repos="https://cran.rstudio.com";) # make sure your version of R supports https Regards, Yihui -- Yihui Xie Web: http://yihui.name On Fri, Jan 15, 2016 at 9:37 PM, Ranjan Maitra wrote: > On Fri, 15 Jan 2016 21:25:06 -0600 Ranjan Maitra >

Re: [R] tikzDevice and Sweave

2016-01-18 Thread Yihui Xie
be reduced to the absolutely minimal: \documentclass{article} \begin{document} <>= plot(sin, -pi, 2*pi, main = "A stand alone TikZ plot", xlab = "x", ylab = "sin(x)") @ \end{document} Regards, Yihui -- Yihui Xie Web: http://yihui.name On Mon, Jan 18, 20

Re: [R] roxygen2 v6.0.0

2017-02-06 Thread Yihui Xie
) Regards, Yihui -- Yihui Xie Web: http://yihui.name On Mon, Feb 6, 2017 at 9:46 AM, Marc Girondot via R-help wrote: > Hi, > > I used roxygen2 v5.0.1 to document my package, and all was ok. I have just > updated to roxygen2 v6.0.0 and my script is broken and I can't find wh

Re: [R] Is ImageMagick package not compatible with R 3.3.2?

2017-03-15 Thread Yihui Xie
I'm the author of the animation package, and I do plan to switch to the magick package in the future instead of using ImageMagick as a system dependency. Regards, Yihui -- https://yihui.name On Wed, Mar 15, 2017 at 12:32 AM, Bert Gunter wrote: > A google search on "ImageMagick Package R" brough

[R] "panel.first" passed to plot() in "..."

2009-09-02 Thread Yihui Xie
e grid drawn in each plot with "panel.first" in "..."? Thanks a lot! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA __ R-help@r-

Re: [R] Create directory and copy files in R

2009-09-22 Thread Yihui Xie
of internal R functions/objects, as you did in 'dir <- dirname(fn)' because 'dir' is already an R function. > library(fortunes) > fortune('dog') Firstly, don't call your matrix 'matrix'. Would you call your dog 'dog'? Anyway, it might

Re: [R] R PNG graph width limitation

2009-09-22 Thread Yihui Xie
Given the DPI=72, do you really need a graph that's wider than 450 inches? Or can you really read a picture that is so wide? Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Sep 22,

Re: [R] Problem in using BATCH command

2009-09-22 Thread Yihui Xie
rst (or put the 'bin' directory into your environment variable 'PATH'). Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Sep 22, 2009 at 11:01 AM, Manuj Sharma wrote:

Re: [R] R PNG graph width limitation

2009-09-22 Thread Yihui Xie
Well, if you don't care about its width, I'd suggest you use the pdf() device instead, e.g. # 200 inches! pdf("hugeplot.pdf", width = 200, height = 200) par(mar = rep(0, 4)) plot(rnorm(1), pch = 19) dev.off() Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://y

Re: [R] R PNG graph width limitation

2009-09-22 Thread Yihui Xie
like counting the stars in the sky. If you insist on reading the result of your clustering of 5981 cases, I'd suggest looking at smaller pieces of results at one time (i.e. sub-clusters). Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State

Re: [R] how to save plots automatically

2009-09-22 Thread Yihui Xie
Something like for(i in 1:20){ pdf(sprintf("myplot%d.pdf",i)) # your calculation and plots here dev.off() } If you have 100 plots in total, then you should have 5 graphs in each single pdf. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of

Re: [R] Sweve/cacheSweave

2010-02-11 Thread Yihui Xie
d The control sequence marked should not appear between \csname and \endcsname. (I cc'ed to Cameron to see if I'm correct) Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Thu, Feb 1

Re: [R] SVGAnnotation in Windows

2010-03-07 Thread Yihui Xie
SVGAnnotation works fine for me under Windows. I guess Cleber was using R < 2.10. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 2010/3/6 Uwe Ligges : > > > On 06.03.2010 18:35, C

[R] parse an HTML page with verbose error message (using XML)

2010-03-11 Thread Yihui Xie
r messages without really stopping the parsing process; the first approach cannot return detailed error messages, while the second one will stop the program... Thanks! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department

Re: [R] rmaxwell in C

2010-03-12 Thread Yihui Xie
") if (any(a <= 0)) stop("argument 'a' must be positive") sqrt(2 * rgamma(n = n, 1.5)/a) } Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Fri, M

Re: [R] rmaxwell in C

2010-03-12 Thread Yihui Xie
The manual R-exts, section 6.7.1 should help if you want to call rgamma() in C. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 2010/3/12 xie : > rmaxwell() depends on rgamma(), so what

Re: [R] XML: Slower parsing over time with htmlTreeParse()

2010-03-15 Thread Yihui Xie
-- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Mon, Mar 15, 2010 at 7:09 AM, Janko Thyson wrote: > Sorry, I listed the wrong package in the header of my previous p

Re: [R] Export rgl plot3d scatter

2009-06-29 Thread Yihui Xie
ck, but I still prefer using rgl directly. 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 Mon, Jun 2

Re: [R] From THE R BOOK -> Warning: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm!

2010-03-30 Thread Yihui Xie
e observed some proportion data which fell in [0,1]). E.g. y=rbinom(10, size = 1, prob = .3); x=rnorm(y) # or y = factor(y) glm(y~x, family = binomial) Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames

Re: [R] WinBUGS Question

2010-04-13 Thread Yihui Xie
model.file='model_i.bug',...) } The above code might need paste() here and there, e.g. paste('data_', i, sep=''). I don't know if WinBUGS itself supports such a loop. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa

[R] [R-pkgs] formatR: farewell to ugly R code

2010-04-16 Thread Yihui Xie
ersion of R (>=2.10.1) install.packages('formatR') library(formatR) # or formatR() Screen-shots can be found here: http://yihui.name/en/2010/04/formatr-farewell-to-ugly-r-code/ Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa Sta

Re: [R] [R-pkgs] formatR: farewell to ugly R code... Problem with too old ver. of Gtk

2010-04-18 Thread Yihui Xie
ers can specify other types of GUI's now. For example, a screenshot for the Java interface is here: http://yihui.name/en/2010/04/formatr-farewell-to-ugly-r-code/#comment-9788 Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University

Re: [R] How to open only one file in a .gz file?

2009-09-27 Thread Yihui Xie
rarchive.tar.gz"). You didn't tell us sessionInfo(), so I'm not sure whether you are able to use the "tar" command. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 20

Re: [R] Is there a R function that can do similar things like 'pdist' in Matlab?

2009-09-30 Thread Yihui Xie
That's not correlation. It's distance instead. See ?dist Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Sep 29, 2009 at 8:22 PM, RT Ye wrote: > Hi, > > I want to c

[R] Modify base R functions in Rprofile.site

2009-10-03 Thread Yihui Xie
locale: LC_COLLATE=Chinese_People's Republic of China.936;LC_CTYPE=Chinese_People's Republic of China.936;LC_MONETARY=Chinese_People's Republic of China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936 attached base packages: [1] datasets utils stats graphics

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
functions to parse and deparse R code without really modifying them in the base enviroment? I'm using the command 'R CMD Sweave'. If there is no neat approach, I'll change my question to: how to write a package, say, Sweave2, that can be run using command line 'R CMD Sweave2

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Hi Charlie, Thanks a lot! Your "dark voodoo" really helps! And also, thanks so much to Duncan for your detailed explanation! Finally I used Charlie's trick to modify makeRweaveLatexCoderunner(), and has left parse() & deparse() untouched. Regards, Yihui -- Yihui Xie Phon

Re: [R] Problem with na.omit when using length()

2009-10-05 Thread Yihui Xie
just put na.omit() inside length() if you intend to omit the NA elements of the vector (otherwise you are trying to omit the NA's of the returned value of length() which is a scalar 2): length(na.omit(sno[a==1 & b==0])) Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://y

Re: [R] celebrating revision 50000

2009-10-09 Thread Yihui Xie
I extracted the data for hours of a day and created some graphs here: http://yihui.name/en/2009/10/5-revisions-committed-to-r/ Certainly our R core gods are so very hard-working and devoted that some even commit revisions to R at 3am in the morning! Regards, Yihui -- Yihui Xie Phone: 515

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Yihui Xie
gt; sapply(x[sapply(x, function(i) is.function(get(i)))], isdebugged) f FALSE Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Fri, Oct 23, 2009 at 12:28 PM, Andrew Yee wrote: > This is kin

Re: [R] how do you know which functions are being debugged?

2009-10-23 Thread Yihui Xie
Oops... I forgot to mention that 'envir' (or 'pos') should be specified in ls()/get() in my last reply if you are looking for debugged functions in environments other than ".GlobalEnv". Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Depart

[R] Datasets for "The Statistical Sleuth"

2009-10-24 Thread Yihui Xie
tion) if anyone has already done the work of packing up all the data sets. Thanks a lot! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA __ R-help@r-proj

[R] Announcement: the 2nd Chinese R Conference

2009-10-29 Thread Yihui Xie
gistration, and Shanghai useRs: user-2009...@cos.name Thanks! P.S. we hope the next conference will be better prepared; please contact user-2...@cos.name if you have any suggestions on the 3rd Chinese R Conference. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Dep

Re: [R] qqplot

2009-11-02 Thread Yihui Xie
abline(0,1) is somewhere in the upper-left corner which you are unable to see. At least the first distribution seems to have a larger mean than the second one (i.e. they are not the same distribution). Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of

Re: [R] about the cox result

2009-11-03 Thread Yihui Xie
coef(summary(fit_cox)) should give you what you wanted. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Nov 3, 2009 at 12:31 AM, 孟欣 wrote: > Hi all: > I finished cox analysis lik

Re: [R] Rpad and R 2.10.0

2009-11-07 Thread Yihui Xie
Yes I noticed the same problem since R 2.10.0, and I don't know why either. Let's forward the email to the maintainer. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 2009/11/7 Eric

[R] deparse() and the 'else' statement

2009-11-09 Thread Yihui Xie
grDevices utils datasets methods base other attached packages: [1] animation_1.0-8 MASS_7.3-3 loaded via a namespace (and not attached): [1] tools_2.10.0 Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames,

Re: [R] Rpad and R 2.10.0

2009-11-12 Thread Yihui Xie
Good job, Jeff! I've downloaded the source package, modified HTMLargs() as you suggested and recompiled the package. Rpad works perfectly now! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ame

Re: [R] vignettes: .png graphics or pre-compiled .pdf

2009-11-13 Thread Yihui Xie
Hi Michael, I have a dirty solution as attached to use png() for Sweave. HTH. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Fri, Nov 13, 2009 at 10:02 AM, Michael Friendly wrote: > I

Re: [R] vignettes: .png graphics or pre-compiled .pdf

2009-11-13 Thread Yihui Xie
I was reminded that the attachments were blocked by the list, so I send these links again: http://yihui.name/en/wp-content/uploads/2009/11/Sweave2.Rnw http://yihui.name/en/wp-content/uploads/2009/11/Sweave2.r http://yihui.name/en/wp-content/uploads/2009/11/Sweave2.pdf Regards, Yihui -- Yihui Xie

Re: [R] Silently loading an R package.

2009-11-13 Thread Yihui Xie
please read the 'Details' section of ?require To suppress messages during the loading of packages use 'suppressPackageStartupMessages': this will suppress all messages from R itself but not necessarily all those from package authors. Regards, Yihui -- Yihui

Re: [R] vignettes: .png graphics or pre-compiled .pdf

2009-11-14 Thread Yihui Xie
it as a package. This has been in my mind for a long time. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 2009/11/14 Michael Friendly : > Thanks, Yihui > Your solution, for png(), only

[R] How to extract the variable names from a formula

2009-11-19 Thread Yihui Xie
Hi all, Suppose I have a formula: a = log(y) ~ x1 + I(x2^2) How can I extract the original variable names 'y', 'x1', 'x2' from this formula? Thanks a lot! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State

Re: [R] How to remove R banner?

2009-12-02 Thread Yihui Xie
Rgui (Windows) does support '--quiet'. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Dec 1, 2009 at 11:17 PM, Sharpie wrote: > > > Peng Yu wrote: >> >>

Re: [R] Announcement: the 2nd Chinese R Conference

2009-12-02 Thread Yihui Xie
cations in semiconductor industry - Java programming with R - social network analysis - writing R extensions For more details, please visit: http://cos.name/useR/useR-2009/ Thanks! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Sne

Re: [R] animated R plots

2009-12-23 Thread Yihui Xie
(0:1, 0:1) for (i in 1:10) { points(x[i], y[i]) Sys.sleep(0.1) } # this is equivalent to the above animation # but 10 image frames are generated in the end for (i in 1:10) { plot(0:1, 0:1) points(x[1:i], y[1:i]) Sys.sleep(0.1) } Regards, Yihui -- Yihui Xie Phone: 515-294-6609

Re: [R] An unprofessional message

2009-12-24 Thread Yihui Xie
lack") for (j in 1:1000) { angle = angle + speed plot.new() plot.window(c(1, n), c(0, 1)) for (i in 1:n) text(i, 0.5, x[i], srt = angle[i], cex = runif(1, 1, 4), col = sample(colors(), 1)) Sys.sleep(0.02) } Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.nam

Re: [R] An unprofessional message

2009-12-24 Thread Yihui Xie
I have wrapped it into a Flash animation, so we can really see it now: http://yihui.name/en/2009/12/merry-christmas-using-r/ Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Thu, Dec 24, 2009

Re: [R] I'm offering $300 for someone who know R-programming to do the assignments for me.

2009-05-07 Thread Yihui Xie
Homework?... 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 Fri, May 8, 2009 at 12:19 PM, ayaku1

Re: [R] How to generate pdf in more than 1 papes

2009-05-11 Thread Yihui Xie
pages in 10 files 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, May 12, 2009 at 1:14 PM, Xiaogang

Re: [R] graphically representing frequency of words in a speech?

2009-06-10 Thread Yihui Xie
of a Flash object to generate tag cloud, and it has fantastic 3D rotation effect of the cloud. I've spent a couple of hours porting it into R; see the source code and effect here: http://yihui.name/en/2009/06/creating-tag-cloud-using-r-and-flash-javascript-swfobject/ HTH. Regards, Yihui -- Yi

[R] How to get commands history as a character vector instead of displaying them?

2009-03-23 Thread Yihui Xie
ople's Republic of China.936;LC_MONETARY=Chinese_People's Republic 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 Regards, Yihui -- Yihui Xie Phone: +86-(0)10-825090

Re: [R] newton method

2009-03-23 Thread Yihui Xie
^2 - 40 * x + 100, 7.15, c(-6.2, 7.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 Statistics, Room 1037, Mingde Main Building, Renmin University of China, Beijing, 100872, China On Mon, Mar 23,

Re: [R] How to get commands history as a character vector instead of displaying them?

2009-03-30 Thread Yihui Xie
ow(x)] 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 Mon, Mar 23, 2009 at 6:13 PM, Wacek Kusnierczyk

[R] new line between '}' and 'else' in function body

2009-04-02 Thread Yihui Xie
ror when you break the line between "}" and "else" in a function, e.g. f = function(x) { if (x) { 1 } # a new line here! else { 2 } } > f(TRUE) [1] 1 > f(FALSE) [1] 2 Seems strange... Regards, Yihui -- Yihui Xie Phone: +86-(0)10-8250908

[R] extract tables as data.frames from HTML source

2009-04-02 Thread Yihui Xie
27;m writing to ask whether someone has already contributed a more general function (with the package XML or other packages). Thanks! 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] new line between '}' and 'else' in function body

2009-04-03 Thread Yihui Xie
on(x) {" "if (x) {" [3] "1" "} else {" [5] "2" "}" [7] "}), srcfile = )" instead. Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-8250908

Re: [R] Dynamic visualisation of R data using Adobe FLEX

2009-05-02 Thread Yihui Xie
e let me know if there's any progress in your project. 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

Re: [R] Is SEM package of R suitable for sem analysis

2009-12-27 Thread Yihui Xie
tories about the SEM software, in which I can only feel the blind faith in software. Sigh... The good thing is, R is open source, so is the sem package. You can see everything in it, and you can extend it as you wish (in case your teacher think it is less suitable). Regards, Yihui -- Yihui Xie Pho

[R] problems in building R with libpng/cairo/jpeg

2009-12-27 Thread Yihui Xie
ux novice. Any hints for my installation? Thanks! Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] rmarkdown and source call to R file.

2021-01-22 Thread Yihui Xie
I don't know the answer (there are multiple possible reasons for the file not being found), but as the first step to debug the problem, you may replace this chunk ```{r, echo=FALSE} library(knitr) source("helper.R", local = knitr::knit_global()) summarized_table<-give_table(params$ldf_sum

Re: [R] problems in knitting to html

2021-04-20 Thread Yihui Xie
Could you provide a minimal reproducible example along with your xfun::session_info('rmarkdown')? Thanks! Regards, Yihui -- https://yihui.org On Tue, Apr 20, 2021 at 11:06 AM Troels Ring wrote: > > Dear friends - newly installed windows 10 and R version 4.0.5 > (2021-03-31) -- "Shake and Throw"

Re: [R] problems in knitting to html

2021-04-20 Thread Yihui Xie
htmltools_0.5.1.1 jsonlite_1.7.2knitr_1.31 > magrittr_2.0.1markdown_1.1 > methods_4.0.5 mime_0.10 rlang_0.4.10 rmarkdown_2.7 > stats_4.0.5 stringi_1.5.3 > stringr_1.4.0 tinytex_0.31 tools_4.0.5 utils_4.0.5 > xfun_

Re: [R] traceback performs differently in "interactive-mode" then in "script-mode"

2022-12-21 Thread Yihui Xie
Hi Malte, I think I asked the same question on Stack Overflow ten years ago: https://stackoverflow.com/q/13116099/559676 I hope you'll find the answer helpful there. Regards, Yihui -- https://yihui.org On Wed, Dec 21, 2022 at 6:19 AM Flender, Malte wrote: > Hello, > > a few days ago I encount

Re: [R] TOC in vignette (knitr::rmarkdown)

2019-08-26 Thread Yihui Xie
output: rmarkdown::html_vignette: toc: true The syntax is the same for all R Markdown output formats: https://bookdown.org/yihui/rmarkdown/html-document.html#table-of-contents Regards, Yihui -- https://yihui.name On Mon, Aug 26, 2019 at 9:32 AM Helmut Schütz wrote: > > Dear all, > > I can

Re: [R] Double / single backticks for inline R code in an Rmarkdown file

2019-10-14 Thread Yihui Xie
params$data is "hawaii" in this case, so the output of ``r params$data`` is `hawaii` The double backticks don't have any special meaning here. Only the inside pair of backticks (i.e. `r `) makes sense to R Markdown (or precisely speaking, knitr). The outside pair will be left untouched afte

Re: [R] R Markdown & chunk extraction in R

2020-04-08 Thread Yihui Xie
And please note that knitr::knit_code$get() only works (i.e. returns a named list of code chunks) inside a knitr document when the document _is being knitted_. It doesn't work outside the document. Ideally, you should use the document parser of knitr, but it is not exported. Regards, Yihui -- http

Re: [R] R Markdown & chunk extraction in R

2020-04-08 Thread Yihui Xie
e if I am wrong. > > Best, > Ashim > > On Wed, Apr 8, 2020 at 8:47 PM Yihui Xie wrote: >> >> And please note that knitr::knit_code$get() only works (i.e. returns a >> named list of code chunks) inside a knitr document when the document >> _is being knitted_. It doe

Re: [R] Looking for knitr example for beginner (NO RStudio)

2013-07-18 Thread Yihui Xie
/knitr/demo/minimal/ (you must have read this page), and more examples at https://github.com/yihui/knitr-examples If you are asking about the internals of knitr, "Luke, use the source": https://github.com/yihui/knitr Or for a more comprehensive introduction, see http://www.crcpress.com/produc

  1   2   3   4   >