Re: [R] Include a formula using the function “makeParamSet”

2019-10-09 Thread Jeff Newmiller
Technically this question is off-topic on this mailing list (read the Posting Guide!), but I might hazard a guess that the package doesn't like using variable that is a lowercase "c" since that is an extremely common R function name. You can sometimes get away with this, but it takes very carefu

[R] Include a formula using the function “makeParamSet”

2019-10-09 Thread Nelly Reduan
Hello, I am performing Latin Hypercube sampling from functions "makeParamSet" and "generateDesign" (package "ParamHelpers") in R. Using the function "makeParamSet", how can I specify a formula to define a given parameter ? Here is an example where "g� is the product of �a� and �c�: ps <- make

Re: [R] Interpretation of davies.test() in segmented package

2019-10-09 Thread Vincenzo Iannuzzi - vincenzo.iannu...@studio.unibo.it
Dear Vito, if we don�t know the number of break points �a priori�, and the davies.test function returns a significant result, how can I obtain the exact number of break points for a �lm�? I would to know this in order to specify in a properly way the �npsi� option in the segmented function. Th

Re: [R] Interpretation of davies.test() in segmented package

2019-10-09 Thread Vincenzo Iannuzzi
Dear Vito, if we don�t know the number of break points �a priori�, and the davies.test function returns a significant result, how can I obtain the exact number of break points for a �lm�? I would to know this in order to specify in a properly way the �npsi� option in the segmented function. Th

Re: [R] Creating a histogram from a frequency vector - correction!

2019-10-09 Thread David Carlson
Does it have to be a histogram or does it just have to look like one? counts <- c(73,53,42,67,41,50) vals <- c(1,2,3,4,5,6) barplot(counts~vals, space=0) If you want a more histogram-like axis: barplot(counts~vals, space=0, names.arg="") axis(1, 1:6 - .5, 1:6) David L Carlson Anthropology Depar

Re: [R] Creating a histogram from a frequency vector

2019-10-09 Thread Rui Barradas
Hello, Here are 3 ways. The first are almost the same, they use base graphics. x <- 1:6 y <- c(73,53,42,67,41,50) barplot(setNames(y, x)) Or names(y) <- x barplot(y) And 3: library(ggplot2) ggplot(data.frame(x, y), aes(x, y)) + geom_col() Hope this helps, Rui Barradas Às 16:12 de 0

Re: [R] Creating a histogram from a frequency vector

2019-10-09 Thread Nick Wray via R-help
Aargh of course - so obvious I'd completely overlooked that.>. Thanks Nick > On 09 October 2019 at 16:21 Ivan Krylov wrote: > > > On Wed, 9 Oct 2019 16:12:57 +0100 (BST) > Nick Wray via R-help wrote: > > > I have a vector like say 73,53,42,67,41,50 where these numbers are > > the number of oc

Re: [R] Creating a histogram from a frequency vector - correction!

2019-10-09 Thread Stephen Ellison
Sorry; that was not the working version. Should be freqs <- c(11, 19, 5, 3, 2, 1, 0, 0, 2, 3, 2) freqhist <- function(counts, xname=deparse(substitute(counts)), breaks=0:length(counts), mids=(breaks[-1]+breaks[-length(breaks)])/2 , ...){ binwidths <- diff(brea

Re: [R] Creating a histogram from a frequency vector

2019-10-09 Thread Stephen Ellison
> I have a vector like say 73,53,42,67,41,50 where these numbers are the > number of occurrences of the data values 1,2,3,4,5,6 - so in essence I have > the frequency bit from the hist() function. I can't see an elegant way (there > are clearly messy workarounds like generating a vector of 73 1's,

Re: [R] Creating a histogram from a frequency vector

2019-10-09 Thread Ivan Krylov
On Wed, 9 Oct 2019 16:12:57 +0100 (BST) Nick Wray via R-help wrote: > I have a vector like say 73,53,42,67,41,50 where these numbers are > the number of occurrences of the data values 1,2,3,4,5,6 > I can't see an elegant way <...> of creating a histogram from this > data set. Is there one? A h

[R] Creating a histogram from a frequency vector

2019-10-09 Thread Nick Wray via R-help
I have a vector like say 73,53,42,67,41,50 where these numbers are the number of occurrences of the data values 1,2,3,4,5,6 - so in essence I have the frequency bit from the hist() function. I can't see an elegant way (there are clearly messy workarounds like generating a vector of 73 1's, 53 2