Visualizzazione post con etichetta R-help. Mostra tutti i post
Visualizzazione post con etichetta R-help. Mostra tutti i post

sabato 12 dicembre 2009

A central hub for R bloggers

I would like to suggest to my readers to take a look and bookmark a new blog named R-bloggers which aims to be "a central hub of content collected from bloggers who write about R".
It seems a nice idea to me to have a centralized source of information for the R blogger community.
Good Luck, Tal!

lunedì 15 giugno 2009

Replacing 0 with NA - an evergreen from the list

This thread from the R-help list describe an evergreen tip that, at least once, is proved useful in R practice.

venerdì 8 maggio 2009

Searching through mailing list archives

Romain Francois on his blog posted a very useful function to search through the R mailing list archives. Take a look at it here. Take also a look at the tm package introduced in  R News, 8(2):19–22, Oct. 2008 with an example dealing with analysis of the R-help mailing list.

martedì 28 aprile 2009

Tips from the R-help list : shadow text in a plot and bumps charts

Stumbling across the R-help mailing-list I found, as often happens,  two threads in the spirit of this blog (of course, since they come from the list, the quality is higher): here you can find a function allowing  a shadow outline style for a text in a plot. From here you can follow an interesting thread depicting how to produce bumps charts in R.

venerdì 11 maggio 2007

Density curve over a histogram

This post was updated.

x <- rnorm(1000)
hist(x, freq = FALSE, col = "grey")
curve(dnorm, col = 2, add = TRUE)

This thread (specifically the Ted Harding answer) from the r-help-list augments the usefulness of this simple tip.

This kind of plots cab be easily produced using the lessR package.

For example, from ?color.density:

library(lessR)
# generate 100 random normal data values
y <- rnorm(100)
# normal curve and general density curves superimposed over histogram
# all defaults
color.density(y)


domenica 6 maggio 2007

How to clear screen in R (Windows)

This tip (taken from this old thread) does work only under Windows:

cls <- function() {
       require(rcom)
       wsh <- comCreateObject("Wscript.Shell")
       comInvoke(wsh, "SendKeys", "\014")
       invisible(wsh)
}
cls()
or
# An R function to clear the screen on RGui:
cls <- function() {
if (.Platform$GUI[1] != "Rgui")
return(invisible(FALSE))
if (!require(rcom, quietly = TRUE)) # Not shown any way!
stop("Package rcom is required for 'cls()'")
wsh <- comCreateObject("Wscript.Shell")
if (is.null(wsh)) {
    return(invisible(FALSE))
} else {
comInvoke(wsh, "SendKeys", "\014")
    return(invisible(TRUE))
}
}
cls()

See this StackOverflow Question for other solutions.