similar to: formatR: farewell to ugly R code

Displaying 20 results from an estimated 6000 matches similar to: "formatR: farewell to ugly R code"

2010 Dec 03
0
formatR update (0.1-5)
In formatR 0.1-5, the dependency on the gWidgets and animation packages are removed. The GUI by gWidgets is optional now. Meanwhile, the function tidy.source() has been moved from the animation package to this package. > library(formatR) > tidy.source(textConnection(' # rotation of the word "Animation" # in a loop; change the angle and color # step by step for (i in
2010 Dec 03
0
formatR update (0.1-5)
In formatR 0.1-5, the dependency on the gWidgets and animation packages are removed. The GUI by gWidgets is optional now. Meanwhile, the function tidy.source() has been moved from the animation package to this package. > library(formatR) > tidy.source(textConnection(' # rotation of the word "Animation" # in a loop; change the angle and color # step by step for (i in
2014 Sep 18
2
formatR 1.0 caused error
Recently in our R 3.1.0 installation the package formatR was upgraded to version 1.0, doing my usual thing, I got the following error, and the destination html file was not generated. What can I do if I want to stay at the current formatR version? Jun Error: unrecognized fields specified in html_dependency: attachment In addition: Warning messages: 1: 'function (...) {
2010 Apr 19
1
Follow up on installing formatR...
Good morning folks: Made a second go at installing this and succeeded, but with some strange behaviours along the way. First the system back story. Using up to date edition Ubuntu 8.04 Using up to date edition of R 2.10.1 Using the Toronto, Ontario repository to draw from. After the first attempt ended up with two of the four dependencies installed so only the Rgtk related items would be
2012 Jun 07
2
¿Reglas de estilo para código en R?
Hola: Me suena algo de que el año pasado alguien dijo algo sobre unas sugerencias de reglas de estilo para escribir código en R. No he oído nada más en esta lista (a lo mejor se me ha pasado por alto) Ayer se publicó un mensaje sobre esto precisamente en un blog en inglés: http://pairach.com/2012/06/06/r-style-guide/ (copiado debajo para facilitar la lectura y comentarios en esta lista)
2011 Jan 10
0
Package animation update 2.0-1
Hi, The package animation 2.0-1 is on CRAN now (http://cran.r-project.org/package=animation). ? ? ? ? ? ? ? ? ?CHANGES IN animation VERSION 2.0-1 NEW FEATURES ? ?o demo('Xmas_card') contributed by Yuan Huang ? ?o demo('flowers') to show how to download images from the Internet ?and create an animation ? ?o a new function pdftk() as a wrapper to call the Pdftk toolkit
2011 Jan 10
0
Package animation update 2.0-1
Hi, The package animation 2.0-1 is on CRAN now (http://cran.r-project.org/package=animation). ? ? ? ? ? ? ? ? ?CHANGES IN animation VERSION 2.0-1 NEW FEATURES ? ?o demo('Xmas_card') contributed by Yuan Huang ? ?o demo('flowers') to show how to download images from the Internet ?and create an animation ? ?o a new function pdftk() as a wrapper to call the Pdftk toolkit
2009 Mar 20
2
Why does the lexical analyzer drop comments ?
It happens in the token function in gram.c:     c = SkipSpace();     if (c == '#') c = SkipComment(); and then SkipComment goes like that: static int SkipComment(void) {     int c;     while ((c = xxgetc()) != '\n' && c != R_EOF) ;     if (c == R_EOF) EndOfFile = 2;     return c; } which effectively drops comments. Would it be possible to keep the information
2012 Jun 02
2
Double-buffering problem, this time with an example.
Most of my animations that used to work on windows() version 2.11.1 and earlier now flash as if the double buffering is turned off or buffer swapping is triggered by other events than in the past. The simplified example below using symbols should illustrate the problem in a windows environment. windows() radius <- 8 n <- 6 ang <- seq(0,2*pi,length=n+1)[-(n+1)] ca <- cos(ang) sa
2013 Feb 17
1
tidy.source() gets confused when # is not a comment but a part of a literal string?
I needed to clean someone else code and run it through tidy.source. It encountered a number of hangups which after some experimentation lead me to suspect that the culprit is # symbol when it is a part of literal string. For example if i copy the following to the clipboard confuse.tidy <-    function() {   txt <- 'abra # cadabra' } and run with default arguments >tidy.source()
2013 Jan 24
1
Recommendation for website to format R code
Hi list, Could anyone recommend some good website for formatting R code? For example, when you copy paste R code to gmail and back to R, it loses its format, the dash symbol causes errors. I've had someone used it to format my code here on the list, but can't find it anymore. Mike [[alternative HTML version deleted]]
2004 Dec 10
4
cbind() and factors.
Hi I'm seeing some "odd" behaviour with cbind(). My code is: > cat <- read.table("cogs_category.txt", sep="\t", header=TRUE, quote=NULL, colClasses="character") > colnames(cat) [1] "Code" "Description" > is.factor(cat$Code) [1] FALSE > is.factor(cat$Description) [1] FALSE > is.factor(rainbow(nrow(cat))) [1]
2017 Jun 08
0
Rainbow in loop
Does: rainbow(3)[1] rainbow(3)[2] rainbow(3)[3] ... solve your issue? B. > On Jun 8, 2017, at 8:20 AM, WRAY NICHOLAS <nicholas.wray at ntlworld.com> wrote: > > Hi R folk I have a distance time graph for a locomotive and at various times > different events occur on board the loco. I want to put a vertical line on the > speed time graph for each event, but I
2014 Apr 18
1
How to use rainbow function without the gamma argument
Hi, I am using a old code (probably written for R 2.5) and it stops when calling rainbow() with gamma argument. I saw that gamma argument is not present in newer version of R rainbow function. How can I translate this line of code: rainbow(100, s = 1.0, v = 0.75, start = 0.0, end = 0.75, gamma = 1.5) ? It fails with: Error in rainbow(100, s = 1, v = 0.75, start = 0, end = 0.75, gamma = 1.5) :
2017 Jun 08
2
Rainbow in loop
Hi R folk I have a distance time graph for a locomotive and at various times different events occur on board the loco. I want to put a vertical line on the speed time graph for each event, but I want to colour each different kind of event differently to see visually whether there's any pattern to these events happening. I could just create a vector of colours and use abline which is easy
2009 Nov 30
3
Assign palette (e.g. rainbow) to a series of points on 1 plot
I have 11 vectors representing insect survival probabilities in response to different levels of toxins at 10 concentrations lx100=c(1,1,1,.8,.5,.4,.2,0) day100=c(0,1,2,3,4,5,6,7,8) lx90=c(1,1,1,1,.9,.8,.6,.4,.2,.1,0) day90=c(0,1,2,3,4,5,6,7,8,9,10) #...and so on10% and a zero (control) series lx0=c(1,1,1,1,1,1,.9,.9,.8,.8,.6,.5,.4,.3,.2,.1,.1,0)
2003 Oct 23
6
repeating colors in graph 2
I've tried looking at ?colors and ?palette and if I'm understanding it correctly, I'm supposed to type in (for example) palette(rainbow(13)) before I type in my plot (of 13 lines) if I want 13 different colors. But this does not work. Other things that i have tried besides rainbow give me errors. Am I just doing something completely wrong? Anna
2008 Jan 06
3
Can a dynamic graphic produced by rgl be saved?
Dear r-helpers, Can one save a dynamic graphic produced by rgl, e.g.: open3d(); x <- sort(rnorm(1000)); y <- rnorm(1000); z <- rnorm(1000) + atan2(x,y); plot3d(x, y, z, col=rainbow(1000), size=2) as a dynamic figure that can be embedded in a pdf? _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400
2004 Jul 12
1
pixmapIndexed color question
Hi I use pixmapIndexed tmp.vimp <- array(0,c(x.dim,y.dim)) tmp.vimp <- pixmapIndexed(tmp.vimp, col=rainbow) to plot values of a 2D matrix. I 'fill' the pixmapIndexed like: for (x in 1:x.dim) { for (y in 1:y.dim) { tmp.vimp at index[x,y] <- my.matrix[x,y] }} how can I define, that the colors are painted e.g. according the rainbow
2008 Sep 17
6
creating rainbow gradients
Hi, how can I create a rainbow gradient in R? For example, let's say I have a plot of y = x...and I want the plot to go from red -> orange -> yellow -> green -> blue -> etc. Right now, I know how to do something like go from red to blue, using the plotrix library: library(plotrix) redToBlue <-