-
Two ways to save a plot in png…
rencontre sans inscription sur saint-dizier Two ways to save a plot in png. dev.copy() saves the plot with transparent background while savePlot() with white background. See the difference. dev.copy(device = png, file = “devcopy.png”) dev.off() savePlot(file = “saveplot.png”)
-
Using discontinuous axis or breaks may not…
http://pombaltv.pt/?bandit=conselho-para-filha-sobre-namoro&d7f=2e Using discontinuous axis or “breaks” may not be a good idea to visualize data. Instead, use two plots, one with the whole data and another for zoomed data. However, if the situation is not allowed, there is an R package to do it. The package plotrix can put breaks or gaps on the axes.
-
How to use eval Here is an example…
How to use eval()? Here is an example. test.dframe <- data.frame(x = 1:10, y = rnorm(10)) addSmooth <- function(data, smooth = TRUE) { require(ggplot2) p <- "ggplot(data = data, aes(x = x, y = y))" p.line <- "geom_line()" p.smooth <- "stat_smooth()" if (smooth == TRUE) { p.all <- paste(p, p.line, p.smooth, sep = " +…
-
checkUsage in the codetools package examines the function…
checkUsage() in the codetools package examines the function and report possible problems. R functions look for a global variable if the variable is not found in the scope. If a function accidentally has an “orphan” variable which is not passed on to the function but has the same name as one of the global variables,…
-
Defining Macros on the Command Line Macros can…
Defining Macros on the Command Line Macros can be defined on the Make command line. For example: make CFLAGS=–ms would start up Make and define the macro CFLAGS with the value “–ms”. Macros defined on the command line take precedence over macros of the same name defined in the makefile. If a command-line macro contains…
-
Side by side comparison between ggplot2 and lattice…
Side by side comparison between ggplot2 and lattice http://learnr.wordpress.com/tag/ggplot2/ Code examples and plot output http://wiki.stdout.org/rcookbook/Graphs/ And of course, http://had.co.nz/ggplot2/
-
Differences in zooming or scaling in ggplot Either…
Differences in zooming or scaling in ggplot. Either scale_y_continuous() or coord_cartesian() can be used but they work in slightly different way. scale_y_continuous (or scale_x_continuous) will drop data which are out of the range, while coord_cartesian() won’t. It does not affect the plot if the plot is drawn only with the given data. However, if the…
-
Plot multi column data with ggplot ggplot is…
Plot multi column data with ggplot ggplot is a great visualization tool for R. It draws beautiful plots but the difference from the native plotting system in R takes some time to get used to it. Here are two examples how to plot data in multiple columns. The original data have three columns with one…
-
Insert the current time into R history timestamp…
Insert the current time into R history timestamp()
-
Rename multiple files on Linux If you are…
Rename multiple files on Linux If you are lucky to have rename installed on your system, use it. Rename is a Perl program and can take Perl regular expression. rename ‘s/^comp/compare/’ *pdf Or copy the code below. http://www.perlmonks.org/?node_id=632437 #!/usr/bin/perl -w # # This script was developed by Robin Barker (Robin.Barker@npl.co.uk), # from Larry Wall’s original…