Re: [R] Seeking to validate data quality requirements - should I develop a package?

2017-08-04 Thread Architector Data Tools via R-help
Thanks Bert, I will definately look through rseek, and reuse wherever possible. Scanning through the first few pages, maybe "datacheck" can provide something. But I have in mind a complete DQ package, a sports car with 4 good wheels ;) and still seems likely that I will need to develop something

[R] Latin hypercube sampling from a non-uniform distribution

2017-08-04 Thread Marine Regis
Hello, I am performing a sensitivity analysis using a Latin Hypercube sampling. However, I have difficulty to draw a Hypercube sample for one variable. I�ve generated this variable from a Poisson distribution as follows: set.seed(5) mortality_probability <- round(ppois(seq(0, 7, by = 1),

Re: [R] define a list with names as variables

2017-08-04 Thread Martin Maechler
> Giovanni Gherdovich > on Fri, 4 Aug 2017 12:36:49 +0200 writes: > Hello Thomas, Ulrik, > thanks for your suggestions. There's also the setNames(, names) which is a trivial wrapper to achieve this. I had provided it for R (in package 'stats')

Re: [R] define a list with names as variables

2017-08-04 Thread Giovanni Gherdovich
On Fri, Aug 4, 2017 at 4:25 PM, Bert Gunter wrote: >> f <- function(foo,bar) structure(list(bar),names =foo) > >> f("hello","world") > $hello > [1] "world" > > Cheers, > Bert Thanks Bert, I didn't know about "structure()". Giovanni

Re: [R] Layer problem in DrawDensity3D (VecStatGraphs3D)

2017-08-04 Thread Duncan Murdoch
On 04/08/2017 7:52 AM, Atte Tenkanen wrote: Hi, When plotting the density estimation with DrawDensity3D-function (in package VecStatGraphs3D) it often happens that the end product ie. layers are not intact , see figure in the link:

Re: [R] Layer problem in DrawDensity3D (VecStatGraphs3D)

2017-08-04 Thread Bert Gunter
You are more likely to get useful help if you post a reproducible example (data and code). -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Aug

Re: [R] define a list with names as variables

2017-08-04 Thread Bert Gunter
> f <- function(foo,bar) structure(list(bar),names =foo) > f("hello","world") $hello [1] "world" Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

[R] Layer problem in DrawDensity3D (VecStatGraphs3D)

2017-08-04 Thread Atte Tenkanen
Hi, When plotting the density estimation with DrawDensity3D-function (in package VecStatGraphs3D) it often happens that the end product ie. layers are not intact , see figure in the link: https://www.dropbox.com/s/vzyaiu0vso8hjw2/20623868_1021234554853_1371245353_n.png?dl=0 Can we

Re: [R] Seeking to validate data quality requirements - should I develop a package?

2017-08-04 Thread Bert Gunter
Sounds like you'll be reinventing square wheels. Searching "data quality package" on rseek.org brought up many hits. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom

Re: [R] legend and values do not match in ggplot

2017-08-04 Thread Jeff Newmiller
Not possible to debug your specific problem without sample data [1][2][3], but learning how to setup and manage factors is a key skill for getting this right. You will also make it less likely that the email you send gets damaged in transit if you send plain text email instead of HTML. [1]

[R] legend and values do not match in ggplot

2017-08-04 Thread greg holly
I have following codes for ggplots. The legends are given in the plot do not match with the values specified in the codes given below. Your helps highly appreciated. Greg library(ggplot2) p <- ggplot(a,aes(x=NO_BMI_FI_beta ,y=FI_beta ,color= Super.Pathway))+ theme_bw()

Re: [R] define a list with names as variables

2017-08-04 Thread Jeff Newmiller
You can wrap the list-creating function call (e.g. lapply) in a call to ?setNames, or you can use the ?map function from the purrr package. -- Sent from my phone. Please excuse my brevity. On August 4, 2017 3:14:44 AM PDT, Ulrik Stervbo wrote: >Hi Giovani, > >I would

Re: [R] switch of cex adjustment with mfrow?

2017-08-04 Thread Jannis via R-help
Thanks guys for your help. Your suggestions will work in my case, the behaviour beeing dependent on the order of arguments (which Steve mentions) is however, not the way I would expect R to work. In addition, the way I interpret the documentation: "A numerical value giving the amount by which

Re: [R] define a list with names as variables

2017-08-04 Thread Thomas Mailund
Do you mean like this? > f <- function(foo, bar) { + result <- list(bar) + names(result) <- foo + result + } > (x <- f("hello", "world")) $hello [1] "world" > names(x) [1] "hello" -- Thomas Mailund On 4 August 2017 at 12.08.28, Giovanni Gherdovich (g.gherdov...@gmail.com) wrote:

Re: [R] define a list with names as variables

2017-08-04 Thread Giovanni Gherdovich
Hello Thomas, Ulrik, thanks for your suggestions. Giovanni On Fri, Aug 4, 2017 at 12:13 PM, Thomas Mailund wrote: > Do you mean like this? > > >> f <- function(foo, bar) { > + result <- list(bar) > + names(result) <- foo > + result > + } > >> (x <- f("hello",

Re: [R] define a list with names as variables

2017-08-04 Thread Ulrik Stervbo
Hi Giovani, I would create an unnamed list and set the names after. Best, Ulrik On Fri, 4 Aug 2017 at 12:08 Giovanni Gherdovich wrote: > Hello, > > I'm having troubles defining a list where names are variables (of type > character). Like this, which gives "foo" instead

[R] Seeking to validate data quality requirements - should I develop a package?

2017-08-04 Thread Architector Data Tools via R-help
I am planning to develop an R package to manage all aspects of data quality. I am very experienced in data quality, but fairly new to R. I have tried to find a suitable data quality package, and am surprised not to find much to suit my requirements. Developing the package would be an ambitious

[R] define a list with names as variables

2017-08-04 Thread Giovanni Gherdovich
Hello, I'm having troubles defining a list where names are variables (of type character). Like this, which gives "foo" instead of "world" (the way I meant it is that "world" is the value of the variable foo). Any hint? > f <- function(foo, bar) { list(foo = bar) } > x <- f("hello", "world") >

Re: [R] How automatic Y on install y/n prompts?

2017-08-04 Thread Dimlak Gorkehgz
Thank you that worked. On Tue, Aug 1, 2017 at 9:43 PM, Jeff Newmiller wrote: > You should read the section on Indexing in the Introduction to R document > that comes with R, regarding $ and `[[`. > -- > Sent from my phone. Please excuse my brevity. > > On August 1,

Re: [R] Restructuring Star Wars data from rwars package

2017-08-04 Thread Ulrik Stervbo
Hi Matt, the usual way would be to use do.call(): .lst <- list(x = list(a = 1, b = 2), y = list(a = 5, b = 8)) do.call(rbind, lapply(.lst, data.frame, stringsAsFactors = FALSE)) however, your list has vectors of unequal lengths making the above fail. You somehow need to get everything to have