Re: [R] function sample: diferences across R versions

2019-07-30 Thread Jeff Newmiller
There seem to be a couple of ways to do this. Rngkind( sample.kind="Rounding" ) or RNGversion("3.5.2") per ?Random https://stat.ethz.ch/pipermail/r-help/2019-June/463109.html On July 30, 2019 5:31:13 PM PDT, Jose Claudio Faria wrote: >Thanks Patrick. > >I took a look at the documentation o

Re: [R] function sample: diferences across R versions

2019-07-30 Thread Jose Claudio Faria
Thanks Patrick. I took a look at the documentation of the RNGkind and RNGversion functions but didn't understand how they work. Can you exemplify how I can, through them, to recapture the old behavior? Best, ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\ Jose Claudio Faria UESC/DCET/Brasil jose

Re: [R] function sample: diferences across R versions

2019-07-30 Thread Patrick (Malone Quantitative)
Poorly phrased--makes it act differently with respect to set.seed() . On Tue, Jul 30, 2019 at 6:55 PM Patrick (Malone Quantitative) wrote: > > My understanding is that sample() in 3.6.0 did, in fact, change in > ways that detach it from set.seed(). > > You can use RNGkind() or RNGversion() to rec

Re: [R] function sample: diferences across R versions

2019-07-30 Thread Patrick (Malone Quantitative)
My understanding is that sample() in 3.6.0 did, in fact, change in ways that detach it from set.seed(). You can use RNGkind() or RNGversion() to recapture the old behavior. See https://cran.rstudio.com/bin/windows/base/NEWS.R-3.6.1.html in the section CHANGES IN R 3.6.0 . Also, please do not pos

[R] function sample: diferences across R versions

2019-07-30 Thread Jose Claudio Faria
Hi, I just noticed the difference in a teaching data generation script between version 3.6.1 and earlier. #! R version 3.4.3 set.seed(2019); sample(1:10, 1) [1] 8 #! R version 3.5.1patched set.seed(2019); sample(1:10, 1) [1] 8 #! R version 3.5.3patched set.seed(2019); sample(1:10, 1) [1] 8 #! R

Re: [R] Problem with rio/haven

2019-07-30 Thread Bert Gunter
My guess: See the check.names argument in ?data.frame. I suspect that the code is using this -- or something like it -- with its value = FALSE. 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 "B

Re: [R] Column 'xyz' does not exist

2019-07-30 Thread Jeff Newmiller
Your example is not reproducible [1][2][3] as recommended by the Posting Guide (referenced in the footer of this and every message on this mailing list). [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3

Re: [R] ggplot - position=position_dodge()) and scale_y_continuous

2019-07-30 Thread Rui Barradas
Hello, You must use a categorical variable in 'fill'. Example: (I also set the fill colours to something else.) ggplot(data = datax, aes(x = x, y = y, fill = factor(fac))) + geom_bar(stat = "identity", color = "black", position = position_dodge()) + theme_minimal() + scale_fil

[R] ggplot - position=position_dodge()) and scale_y_continuous

2019-07-30 Thread Knut Krueger via R-help
Hello to all, how can I can set both y as character to get the bars beside like example 1 and use scale_y_continuous And an additional question: why are the bar colors of x-axes = 8 turned datax= data.frame("fac"=c(c(rep(1,10),c(rep(2,10,"x"=c(c(1:10,c(1:10))), "y"=c(89,69,46,57

[R] Fwd: Re: Column 'xyz' does not exist

2019-07-30 Thread Ivan Calandra
I have no idea about Tibble... [Reply to the list if you want helpful answers ;) ] Ivan -- Dr. Ivan Calandra TraCEr, laboratory for Traceology and Controlled Experiments MONREPOS Archaeological Research Centre and Museum for Human Behavioural Evolution Schloss Monrepos 56567 Neuwied, Germany +4

Re: [R] Column 'xyz' does not exist

2019-07-30 Thread Ivan Calandra
Hi, I would guess that your data object (matrix, data.frame?) does not have a column called "Previous_stage". Maybe you just misspelled it; remember that R is case-sensitive. Please forgive me if I'm completely off! HTH, Ivan -- Dr. Ivan Calandra TraCEr, laboratory for Traceology and Control

Re: [R] Column 'xyz' does not exist

2019-07-30 Thread Uwe Ligges
Use the functional style such as mean(x) instead of the piping style such as x %>% mean. Best, Uwe Ligges On 30.07.2019 11:26, Tolulope Adeagbo wrote: Thanks Uwe, maybe i can be clearer; the error is: Warning: Error in : Column `Previous_stage` is unknown. Ans please what do you mean by

Re: [R] Column 'xyz' does not exist

2019-07-30 Thread Tolulope Adeagbo
Thanks Uwe, maybe i can be clearer; the error is: Warning: Error in : Column `Previous_stage` is unknown. Ans please what do you mean by functional programming style? On Tue, Jul 30, 2019 at 10:18 AM Uwe Ligges wrote: > Don't use pipes but functional programming style, then you can eaasily > tra

Re: [R] Column 'xyz' does not exist

2019-07-30 Thread Uwe Ligges
Don't use pipes but functional programming style, then you can eaasily traceback() and use debugging tools. Best, Uwe Ligges On 30.07.2019 11:03, Tolulope Adeagbo wrote: So I'm having this error: column 'Previous stage does not exist' bal_matrix = loan_data_2 %>% as.tibble() %>% dplyr::a

[R] Column 'xyz' does not exist

2019-07-30 Thread Tolulope Adeagbo
So I'm having this error: column 'Previous stage does not exist' bal_matrix = loan_data_2 %>% as.tibble() %>% dplyr::arrange(Account_number) %>% dplyr::group_by(Previous_stage, Current_stage) %>% dplyr::summarise( Total_bal = sum(Balance, na.rm = TRUE) ) %>% tidyr::spread(key = Curr

[R] Problem with rio/haven

2019-07-30 Thread Sigbert Klinke
Hi, I got the following error when reading a Stata file: > library("rio") > x <- import('XXX.dta') Fehler in df_parse_dta_file(spec, encoding) : Evaluation error: Column name `Merge` must not be duplicated. Use .name_repair to specify repair. I understand that the column name "Merge" appears