Re: [R] draw a circle with a gradient fill

2017-10-24 Thread Berry, Charles
> On Oct 24, 2017, at 2:56 AM, Alaios via R-help wrote: > > Hi all,I would like to draw a simple circle where the color gradient follows > the rule color = 1/(r^2) where r is the distance from the circle. This is called a radial gradient fill in SVG speak. [snip] > but this package does not

Re: [R] Problem Subsetting Rows that Have NA's

2017-10-24 Thread Ek Esawi
z <- x[x[,2]==0&!is.na(x[,2]),] seems to work and get you what you want, but doesn't answer your question, z <- x[x[,2]==0&!is.na(x[,2]),] Best of luck, EK On Tue, Oct 24, 2017 at 3:05 PM, BooBoo wrote: > This has every appearance of being a bug. If it is not a bug, can someone > tell me what

Re: [R] read.table(..., header == FALSE, colClasses = )

2017-10-24 Thread Benjamin Tyner
Yes, it makes sense now; lesson learned. Thank you both! Sometimes it seems that no matter how good the documentation, some useR will inevitably (ab)use the code in ways that were never intended by the authors. Then when the code and/or documentation changes, it is not always obvious to the use

Re: [R] draw a circle with a gradient fill

2017-10-24 Thread Jim Lemon
Hi Alex, This is harder than it looks for a number of reasons. First you want to desaturate the colors as you move out, which requires something more sophisticated than the approximation I have done in the code below. RGB may not be the best colorspace to use for this. Second is that when you draw

Re: [R] as.data.frame doesn't set col.names

2017-10-24 Thread David L Carlson
You left out all the most important bits of information. What is yo? Are you trying to assign a data frame to a single column in another data frame? Printing head(samples) tells us nothing about what data types you have, especially if the things that look like text are really factors that were

Re: [R] Problem Subsetting Rows that Have NA's

2017-10-24 Thread Ben Tupper
Hi, It's related to how NAs are treated in comparison operations. See the Details section of https://www.rdocumentation.org/packages/base/versions/3.4.1/topics/Comparison You can try something like this... x[whic

[R] Problem Subsetting Rows that Have NA's

2017-10-24 Thread BooBoo
This has every appearance of being a bug. If it is not a bug, can someone tell me what I am asking for when I ask for "x[x[,2]==0,]". Thanks. > #here is the toy dataset > x <- rbind(c(1,1),c(2,2),c(3,3),c(4,0),c(5,0),c(6,NA), + c(7,NA),c(8,NA),c(9,NA),c(10,NA) + ) > x [,1] [,2] [1,]

Re: [R] as.data.frame doesn't set col.names

2017-10-24 Thread Ed Siefker
Wait. Now I'm really confused. > > head(samples) quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20HET E11.5 F20het BB84 E11.5 F20het BB84 E11.5

Re: [R] Creating a data table (frame?) from a SQL Statement?

2017-10-24 Thread Jeff Newmiller
Please always cc the list... the group usually has better answers than any one person, and I don't do private consulting on the net. For future reference, there is also an r-sig-db mailing list where this question really belongs. Since I almost never use jdbc, I would need a reprex (hint you ar

[R] as.data.frame doesn't set col.names

2017-10-24 Thread Ed Siefker
Why doesn't this work? > samples$geno <- as.data.frame(sapply(yo, toupper), col.names="geno") > samples quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20

Re: [R] Creating a data table (frame?) from a SQL Statement?

2017-10-24 Thread Jeff Newmiller
Your question desperately needs a reproducible example (a.k.a. "reprex"), because you have to be using contributed packages to do any of this. You also need to clarify whether you are intending to access data already in an external database, or are planning to load it using R and manipulate it w

Re: [R] draw a circle with a gradient fill

2017-10-24 Thread Bert Gunter
There are lots of different ways to do this. I don't use plotrix, which uses base R graphics functionality, so I can't help you with your current approach. However, it is easy to do this "by hand" in the newer, object-based grid package (on which ggpot and lattice are built) . The idea, which proba

[R] Creating a data table (frame?) from a SQL Statement?

2017-10-24 Thread Morkus via R-help
Hello, I'm new to R so this is probably a simple question for somebody. I have an RScript that reads a CSV on the disk using read.table(...). It then does a boxM test using that data. However, I'm now trying to load the same data via an SQL command, but I can't seem to get the data structure d

Re: [R] read.table(..., header == FALSE, colClasses = )

2017-10-24 Thread Martin Maechler
> Benjamin Tyner > on Tue, 24 Oct 2017 07:21:33 -0400 writes: > Jeff, > Thank you for your reply. The intent was to construct a minimum > reproducible example. The same warning occurs when the 'file' argument > points to a file on disk with a million lines. But you a

[R] [R-pkgs] hsdar is back on CRAN

2017-10-24 Thread Lukas Lehnert via R-packages
hsdar is back on CRAN We are very happy to announce that a new version of the hsdar-package (hyperspectral data analysis in R) is available on CRAN. The introductory vignette is available here: https://cran.r-project.org/web/packages/hsdar/vignettes/Hsdar-intro.pdf The main class "Speclib" ha

[R] [R-pkgs] randomForestSRC 2.5.1 and OpenMP

2017-10-24 Thread Udaya B. Kogalur
Dear useRs: The latest build of randomForestSRC (2.5.1) includes a configuration file that switches on the -fopenmp tag during compilation on systems that support OpenMP parallel processing. Previously, to achieve parallel processing, we required the additional step of executing an autoconf comma

[R] [R-pkgs] NMOF 1.2-2 (Numerical Methods and Optimization in Finance)

2017-10-24 Thread Enrico Schumann
Dear all, version 1.2-2 of package NMOF is on CRAN now. NMOF stands for 'Numerical Methods and Optimization in Finance'. The package provides R code and datasets for the book with the same name, written by Manfred Gilli, Dietmar Maringer and Enrico Schumann, published by Elsevier/Academic Press

Re: [R] Linear regression with tranformed dependant variable

2017-10-24 Thread Michael Friendly
Step back a minute: normality is NOT required for predictors in a multiple regression model, though the sqrt(x) transformation may also make the relationship more nearly linear, and linearity IS assumed when you fit a simple model such as y ~ x + w + z. (Normality is only required for the residu

Re: [R] read.table(..., header == FALSE, colClasses = )

2017-10-24 Thread Benjamin Tyner
Jeff, Thank you for your reply. The intent was to construct a minimum reproducible example. The same warning occurs when the 'file' argument points to a file on disk with a million lines. But you are correct, my example was slightly malformed and in fact gives an error under R version 3.2.2.

[R] draw a circle with a gradient fill

2017-10-24 Thread Alaios via R-help
Hi all,I would like to draw a simple circle where the color gradient follows the rule color = 1/(r^2) where r is the distance from the circle. I would also like to add a color bar with values going from -40 to -110 (and associate those with the color gradient that fills the circle). So far I exp