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 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
>joseclaudio.faria at gmail.com
>Telefones:
>55(73)3680.5545 - UESC
>55(73)99966.9100 - VIVO
>///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
>
>If you have software to deal with statistics, you have arms;
>if you have good software, you have arms and legs;
>if you have software like R, you have arms, legs and wings...
>the height of your flight depends only on you!
>
>Em ter, 30 de jul de 2019 às 19:56, Patrick (Malone Quantitative)
> escreveu:
>>
>> 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 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 post in HTML.
>> >
>> > Pat
>> >
>> > On Tue, Jul 30, 2019 at 6:45 PM Jose Claudio Faria
>> >  wrote:
>> > >
>> > > 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 version 3.6.0patched
>> > > set.seed(2019); sample(1:10, 1)
>> > > [1] 8
>> > >
>> > > #! R version 3.6.1patched
>> > > set.seed(2019); sample(1:10, 1)
>> > > [1] 9  # <- Here!
>> > >
>> > > Is it a bug?
>> > > if not (is a new feature) how can I maintain compatibility
>between version
>> > > 3.6.1 and all others?
>> > >
>> > > Regards,
>> > > ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
>> > > Jose Claudio Faria
>> > > UESC/DCET/Brasil
>> > > joseclaudio.faria at gmail.com
>> > > Telefones:
>> > > 55(73)3680.5545 - UESC
>> > > 55(73)99966.9100 - VIVO
>> > > ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
>> > >
>> > > If you have software to deal with statistics, you have arms;
>> > > if you have good software, you have arms and legs;
>> > > if you have software like R, you have arms, legs and wings...
>> > > the height of your flight depends only on you!
>> > >
>> > > [[alternative HTML version deleted]]
>> > >
>> > > __
>> > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > > https://stat.ethz.ch/mailman/listinfo/r-help
>> > > PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>> > > and provide commented, minimal, self-contained, reproducible
>code.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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
joseclaudio.faria at gmail.com
Telefones:
55(73)3680.5545 - UESC
55(73)99966.9100 - VIVO
///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\

If you have software to deal with statistics, you have arms;
if you have good software, you have arms and legs;
if you have software like R, you have arms, legs and wings...
the height of your flight depends only on you!

Em ter, 30 de jul de 2019 às 19:56, Patrick (Malone Quantitative)
 escreveu:
>
> 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 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 post in HTML.
> >
> > Pat
> >
> > On Tue, Jul 30, 2019 at 6:45 PM Jose Claudio Faria
> >  wrote:
> > >
> > > 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 version 3.6.0patched
> > > set.seed(2019); sample(1:10, 1)
> > > [1] 8
> > >
> > > #! R version 3.6.1patched
> > > set.seed(2019); sample(1:10, 1)
> > > [1] 9  # <- Here!
> > >
> > > Is it a bug?
> > > if not (is a new feature) how can I maintain compatibility between version
> > > 3.6.1 and all others?
> > >
> > > Regards,
> > > ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
> > > Jose Claudio Faria
> > > UESC/DCET/Brasil
> > > joseclaudio.faria at gmail.com
> > > Telefones:
> > > 55(73)3680.5545 - UESC
> > > 55(73)99966.9100 - VIVO
> > > ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
> > >
> > > If you have software to deal with statistics, you have arms;
> > > if you have good software, you have arms and legs;
> > > if you have software like R, you have arms, legs and wings...
> > > the height of your flight depends only on you!
> > >
> > > [[alternative HTML version deleted]]
> > >
> > > __
> > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide 
> > > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 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 post in HTML.
>
> Pat
>
> On Tue, Jul 30, 2019 at 6:45 PM Jose Claudio Faria
>  wrote:
> >
> > 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 version 3.6.0patched
> > set.seed(2019); sample(1:10, 1)
> > [1] 8
> >
> > #! R version 3.6.1patched
> > set.seed(2019); sample(1:10, 1)
> > [1] 9  # <- Here!
> >
> > Is it a bug?
> > if not (is a new feature) how can I maintain compatibility between version
> > 3.6.1 and all others?
> >
> > Regards,
> > ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
> > Jose Claudio Faria
> > UESC/DCET/Brasil
> > joseclaudio.faria at gmail.com
> > Telefones:
> > 55(73)3680.5545 - UESC
> > 55(73)99966.9100 - VIVO
> > ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
> >
> > If you have software to deal with statistics, you have arms;
> > if you have good software, you have arms and legs;
> > if you have software like R, you have arms, legs and wings...
> > the height of your flight depends only on you!
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 post in HTML.

Pat

On Tue, Jul 30, 2019 at 6:45 PM Jose Claudio Faria
 wrote:
>
> 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 version 3.6.0patched
> set.seed(2019); sample(1:10, 1)
> [1] 8
>
> #! R version 3.6.1patched
> set.seed(2019); sample(1:10, 1)
> [1] 9  # <- Here!
>
> Is it a bug?
> if not (is a new feature) how can I maintain compatibility between version
> 3.6.1 and all others?
>
> Regards,
> ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
> Jose Claudio Faria
> UESC/DCET/Brasil
> joseclaudio.faria at gmail.com
> Telefones:
> 55(73)3680.5545 - UESC
> 55(73)99966.9100 - VIVO
> ///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
>
> If you have software to deal with statistics, you have arms;
> if you have good software, you have arms and legs;
> if you have software like R, you have arms, legs and wings...
> the height of your flight depends only on you!
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 version 3.6.0patched
set.seed(2019); sample(1:10, 1)
[1] 8

#! R version 3.6.1patched
set.seed(2019); sample(1:10, 1)
[1] 9  # <- Here!

Is it a bug?
if not (is a new feature) how can I maintain compatibility between version
3.6.1 and all others?

Regards,
///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\
Jose Claudio Faria
UESC/DCET/Brasil
joseclaudio.faria at gmail.com
Telefones:
55(73)3680.5545 - UESC
55(73)99966.9100 - VIVO
///\\\///\\\///\\\///\\\///\\\///\\\///\\\///\\\

If you have software to deal with statistics, you have arms;
if you have good software, you have arms and legs;
if you have software like R, you have arms, legs and wings...
the height of your flight depends only on you!

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R-es] Creación de vector con una secuencia de números enteros.

2019-07-30 Thread Javier Marcuzzi
Estimado Daniel García Abiétar

La documentación en este caso puede ser confusa, mis compañeros ya dieron
la solución, pero aporto el siguiente código para que copie y pegue en R,
posiblemente si mira los resultados se dará cuenta.

x <- c(1, 2, 3)
x
typeof(x)
length(x)
x <- c(1, 2.2, TRUE, "hola")
x
typeof(x)
length(x)

Javier Rubén Marcuzzi

El dom., 28 jul. 2019 a las 14:14, Jorge I Velez ()
escribió:

> Basta con
>
> mi_vector <- 11:30
>
> Si requieres algo mas general, entonces
>
> ?seq
>
> es lo que buscas.
>
> Saludos,
> Jorge.-
>
> El El dom, 28 de jul. de 2019 a las 11:17 a. m., Jesús Para Fernández <
> j.para.fernan...@hotmail.com> escribió:
>
> > Mas fácil que todo eso
> >
> > mi_vector <- c(11:30)
> >
> > c es lo que crea el vector y para crear una secuencia usas :
> >
> > Obtener Outlook para Android
> >
> > 
> > From: R-help-es  on behalf of Daniel
> > García Abiétar 
> > Sent: Sunday, July 28, 2019 6:13:18 PM
> > To: r-help-es@r-project.org 
> > Subject: [R-es] Creación de vector con una secuencia de números enteros.
> >
> > Buenas.
> >
> > Soy un chaval novato en el uso de R. Ando haciendo un curso online, y he
> > llegado a una parte en la que me he atascado. La instrucción es la
> > siguiente:
> >
> > crea una variable llamada
> > | 'mi_vector' que contenga un vector con los números enteros del 11 al
> > 30. Recuerda
> > | que puedes usar el operador secuencia ':'
> >
> > A lo cual yo he introducido el siguiente comando:
> >
> > 'mi_vector' <- vector("numeric", length = 11:30)
> >
> > Pero me da el siguiente error:
> >
> > Error in vector("numeric", 11:30) : invalid 'length' argument
> >
> > ¿Alguien podría echarme una mano para resolver por qué me sucede esto?
> > ¿Dónde está mi error?
> >
> > Muchas gracias, un saludo.
> >
> > [[alternative HTML version deleted]]
> >
> > ___
> > R-help-es mailing list
> > R-help-es@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-help-es
> >
> > [[alternative HTML version deleted]]
> >
> > ___
> > R-help-es mailing list
> > R-help-es@r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-help-es
> >
> --
> Sent from my phone. Please excuse my brevity and misspelling.
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


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 "Bloom County" comic strip )

On Tue, Jul 30, 2019 at 1:22 AM Sigbert Klinke
 wrote:
>
> 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 at least twice in the
> Stata file.
>
> My problem is that I have created the data as data.frame in R and saved
> with the export command of rio. How could it be that I can save a data
> set but I'am not able to read in again?
>
> Sigbert
>
> --
> https://hu.berlin/sk
> https://hu.berlin/mmstat3
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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] https://cran.r-project.org/web/packages/reprex/index.html (read the 
vignette) 

On July 30, 2019 2:03:01 AM PDT, Tolulope Adeagbo  
wrote:
>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 = Current_stage, value = Total_bal, fill = 0)
>
>Please assist.
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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_fill_manual(values = c("blue", "red")) +
  scale_x_continuous(breaks = 1:12) +
  scale_y_discrete(limits = c(0, 100))


Hope this helps,

Rui Barradas

Às 10:50 de 30/07/19, Knut Krueger via R-help escreveu:

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,43,5,83,35,15,19,
  51,16,36, 4, 3,3,77, 5,30,61))


ggplot(data=datax, aes(x=x, y=as.character(y), fill=fac)) +
   geom_bar(stat="identity", color="black", position=position_dodge())+
   theme_minimal()+
   scale_x_continuous(breaks=c(1:12)) #+
  # scale_y_continuous(limits=c(0, 100))


ggplot(data=datax, aes(x=x, y=y, fill=fac)) +
   geom_bar(stat="identity", color="black", position=position_dodge())+
   theme_minimal()+
   scale_x_continuous(breaks=c(1:12)) +
scale_y_continuous(limits=c(0, 100))


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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,43,5,83,35,15,19,
 51,16,36, 4, 3,3,77, 5,30,61))


ggplot(data=datax, aes(x=x, y=as.character(y), fill=fac)) +
  geom_bar(stat="identity", color="black", position=position_dodge())+
  theme_minimal()+
  scale_x_continuous(breaks=c(1:12)) #+
 # scale_y_continuous(limits=c(0, 100))


ggplot(data=datax, aes(x=x, y=y, fill=fac)) +
  geom_bar(stat="identity", color="black", position=position_dodge())+
  theme_minimal()+
  scale_x_continuous(breaks=c(1:12)) +
scale_y_continuous(limits=c(0, 100))


Kind regards Knut

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra



 Forwarded Message 
Subject:Re: [R] Column 'xyz' does not exist
Date:   Tue, 30 Jul 2019 10:43:55 +0100
From:   Tolulope Adeagbo 
To: Ivan Calandra 



It has, i have checked and double checked.
Could it be a problem with Tibble?

On Tue, Jul 30, 2019 at 10:39 AM Ivan Calandra > wrote:


   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 Controlled Experiments
   MONREPOS Archaeological Research Centre and
   Museum for Human Behavioural Evolution
   Schloss Monrepos
   56567 Neuwied, Germany
   +49 (0) 2631 9772-243
   https://www.researchgate.net/profile/Ivan_Calandra

   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 functional programming style?
>
> On Tue, Jul 30, 2019 at 10:18 AM Uwe Ligges
   mailto:lig...@statistik.tu-dortmund.de>>
> wrote:
>
>> 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::arrange(Account_number) %>%
>>>     dplyr::group_by(Previous_stage, Current_stage) %>%
>>>     dplyr::summarise(
>>>       Total_bal = sum(Balance, na.rm = TRUE)
>>>     ) %>%
>>>     tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
>>>
>>> Please assist.
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org  mailing list
   -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>       [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org  mailing list
   -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
   http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

   __
   R-help@r-project.org  mailing list --
   To UNSUBSCRIBE and more, see
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide
   http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 Controlled Experiments
MONREPOS Archaeological Research Centre and
Museum for Human Behavioural Evolution
Schloss Monrepos
56567 Neuwied, Germany
+49 (0) 2631 9772-243
https://www.researchgate.net/profile/Ivan_Calandra

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 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
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::arrange(Account_number) %>%
dplyr::group_by(Previous_stage, Current_stage) %>%
dplyr::summarise(
  Total_bal = sum(Balance, na.rm = TRUE)
) %>%
tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)

Please assist.

   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide

http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 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
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::arrange(Account_number) %>%
 >    dplyr::group_by(Previous_stage, Current_stage) %>%
 >    dplyr::summarise(
 >      Total_bal = sum(Balance, na.rm = TRUE)
 >    ) %>%
 >    tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
 >
 > Please assist.
 >
 >       [[alternative HTML version deleted]]
 >
 > __
 > R-help@r-project.org  mailing list
-- To UNSUBSCRIBE and more, see
 > https://stat.ethz.ch/mailman/listinfo/r-help
 > PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 > and provide commented, minimal, self-contained, reproducible code.
 >



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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
> 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::arrange(Account_number) %>%
> >dplyr::group_by(Previous_stage, Current_stage) %>%
> >dplyr::summarise(
> >  Total_bal = sum(Balance, na.rm = TRUE)
> >) %>%
> >tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)
> >
> > Please assist.
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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::arrange(Account_number) %>%
   dplyr::group_by(Previous_stage, Current_stage) %>%
   dplyr::summarise(
 Total_bal = sum(Balance, na.rm = TRUE)
   ) %>%
   tidyr::spread(key = Current_stage, value = Total_bal, fill = 0)

Please assist.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 = Current_stage, value = Total_bal, fill = 0)

Please assist.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 at least twice in the 
Stata file.


My problem is that I have created the data as data.frame in R and saved 
with the export command of rio. How could it be that I can save a data 
set but I'am not able to read in again?


Sigbert

--
https://hu.berlin/sk
https://hu.berlin/mmstat3

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.