Re: [R] Using ggplot2 to plot percentages in bar chart.

2016-12-05 Thread Jeff Newmiller
I don't understand how your labelling technique was supposed to work. Below is my reproducible example of how I would approach this problem. When you post next time, try to follow this method of making something we can put into our fresh R environment and see your problem directly. ---

Re: [R] Using ggplot2 to plot percentages in bar chart.

2016-12-05 Thread Ulrik Stervbo
I always use geom_text when I want to add text or labels to a plot. HTH Ulrik Shawn Way schrieb am Mo., 5. Dez. 2016, 23:58: > That’s precisely what I’m trying to accomplish. > > Shawn Way, PE > > From: John Kane [mailto:jrkrid...@yahoo.ca] > Sent: Monday, December 05, 2016 4:47

[ESS] Curly brace indentation

2016-12-05 Thread Jan T Kim via ESS-help
Hello All, since some time, I get the following indentation behaviour: If I type f <- function(x) { return(x * x); } this gets indented as f <- function(x) { return(x * x); } i.e. the closing curly brace is not vertically aligned with the opening one.

Re: [R] Using ggplot2 to plot percentages in bar chart.

2016-12-05 Thread John Kane via R-help
I've never seen   stat_bin used like that. What exactly is it supposed to do. It looks like you are trying to label the %ages in each piece of the bar. On Monday, December 5, 2016 2:17 PM, Shawn Way wrote: I have the following data in which I'm trying to summarize in a

Re: [R] Using ggplot2 to plot percentages in bar chart.

2016-12-05 Thread Shawn Way
That’s precisely what I’m trying to accomplish. Shawn Way, PE From: John Kane [mailto:jrkrid...@yahoo.ca] Sent: Monday, December 05, 2016 4:47 PM To: Shawn Way ; r-help@r-project.org Subject: Re: [R] Using ggplot2 to plot percentages in bar chart. I've never seen stat_bin used

Re: [R] scatter plot of numerical variables against different sample ids

2016-12-05 Thread Shawn Way
You can also try using ggplot2 to generate the plot: > library(tidyr) > library(ggplot2) > data <- gather(mldf,Element,Value,2:4) > p <- ggplot(data,aes(x=factor(Element),y=Value,group=Sample,color=Sample)) > p+geom_line() Shawn Way, PE -Original Message- From: R-help

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Bert Gunter
Typo: "lazy evaluation" not "lay evaluation." -- 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 Mon, Dec 5, 2016 at 1:46 PM, Bert Gunter

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Bert Gunter
Sorry, hit "Send" by mistake. Inline. On Mon, Dec 5, 2016 at 1:34 PM, Bert Gunter wrote: > Inline. > > -- 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

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Bert Gunter
Inline. -- 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 Mon, Dec 5, 2016 at 9:53 AM, Rui Barradas wrote: > Hello, > > Inline.

Re: [R] Forecast Modeling using R model node in SPSS Modeler

2016-12-05 Thread Ista Zahn
Hi Paul, I suggest forgetting about SPSS and using R directly. Getting started with R is easier than ever thanks to the growing number of tutorials, workshops, mailing lists and forums. Best, Ista On Mon, Dec 5, 2016 at 4:09 PM, Paul Bernal wrote: > Hello everyone, > >

[R] Forecast Modeling using R model node in SPSS Modeler

2016-12-05 Thread Paul Bernal
Hello everyone, I have been trying really hard to use the SPSS Modeler´s R modeling node to generate forecasts without success. I personally think the R integration in SPSS Modeler is kind of poor, since you are only allowed to work with R version 2.15.2. Is there anyone who has worked time

Re: [R] scatter plot of numerical variables against different sample ids

2016-12-05 Thread Jim Lemon
Hi Maria, Perhaps something like this: mldf<-read.table(text="Sample Cu Zn Mn M1 1 5 10 M2 2.5 11 8 M3 1.15 11 12 M4 2 4 30 M5 8 15 35", header=TRUE) matplot(mldf,type="b",pch=c("C","Z","M")) Jim On Mon, Dec 5, 2016 at 11:25 PM, Maria Lathouri via R-help

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread David Winsemius
> On Dec 5, 2016, at 9:53 AM, Rui Barradas wrote: > > Hello, > > Inline. > > Em 05-12-2016 17:09, David Winsemius escreveu: >> >>> On Dec 5, 2016, at 7:29 AM, John Sorkin wrote: >>> >>> Rui, >>> I appreciate your suggestion, but

[R] Revolutions blog: November 2016 roundup

2016-12-05 Thread David Smith via R-help
Since 2008, Microsoft (formerly Revolution Analytics) staff and guests have written about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. And in case

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Rui Barradas
Hello, Inline. Em 05-12-2016 17:09, David Winsemius escreveu: On Dec 5, 2016, at 7:29 AM, John Sorkin wrote: Rui, I appreciate your suggestion, but eliminating the deparse statement does not solve my problem. Do you have any other suggestions? See code below.

[R-es] Suma condicionada.-

2016-12-05 Thread Freddy Omar López Quintero
Hola comunidad, Les consulto mi duda. Quisiera generar N números aleatorios tal que su suma esté predeterminada a un valor k. Sé que con la distribución Dirichlet, por ejemplo, se podrían obtener números aleatorios tal que su suma es la unidad. Por ejemplo MCMCpack::rdirichlet(1,rep(10,7))

[R] Using ggplot2 to plot percentages in bar chart.

2016-12-05 Thread Shawn Way
I have the following data in which I'm trying to summarize in a stacked bar plot showing the percentages as a label in the bar. The data is as follows: > head(data) MASTERPAK2LT MASTERPAK4LT MASTERPAK7LT MASTERPAK10LT MASTERPAK22LT 1XXX X

Re: [ESS] how to edit openbugs model file?

2016-12-05 Thread Paul Johnson
Thanks, everybody. I'm taking the suggestion Martin offered, since this thing is required to be named *.txt in the current OpenBUGS. Solution Put this at the end of the *.txt file: # Local Variables: # mode: R # End: That works. This question was raised by an interesting problem. This might

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Rui Barradas
Hello, For some reason I got moderation in reply to Bert's post so I'll retry. Get rid of 'xx', keep 'yy': frame[, yy] # this works Hope this helps, Rui Barradas Em 05-12-2016 15:29, John Sorkin escreveu: Rui, I appreciate your suggestion, but eliminating the deparse statement does not

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Rui Barradas
Bert is right, that's exactly what I mant. Rui Barradas Em 05-12-2016 15:36, Bert Gunter escreveu: John: I think you need to re-read about how functions pass arguments and data frame access works in R. What Rui meant was to get rid of all the xx stuff and access your column by: col <-

[R] Followup [Can't install or upgrade the "PKI" package on a Debian testing system]

2016-12-05 Thread Emmanuel Charpentier
Dear list; since I've posted the message below, Simon Urbanek has fixed the problem (in less than 5 hours, phewww...). The version available on Rforge *is* installable with OpenSSL 1.1 Note that you'll have to install it with "install.packages('PKI',,'https://www.rforge.net/')", NOT

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread David Winsemius
> On Dec 5, 2016, at 7:29 AM, John Sorkin wrote: > > Rui, > I appreciate your suggestion, but eliminating the deparse statement does not > solve my problem. Do you have any other suggestions? See code below. > Thank you, > John > > > mydf <- >

Re: [R] ggplot2, qplot, problems

2016-12-05 Thread Jeff Newmiller
Given the error messages, it looks like the OP may already have updated and needs to update their code to match. Perhaps reading ?qplot or learning how to use the ggplot function instead of qplot should be next steps. -- Sent from my phone. Please excuse my brevity. On December 5, 2016

Re: [R] ggplot2, qplot, problems

2016-12-05 Thread Michael Dewey
I do not use ggplot2 myself but I think my first action would be to update you version of ggplot2 and possibly also of R. On 05/12/2016 10:28, Daniel wrote: Dear the R Community, I just encountered an error while using ggplot2 and the qplot function (please see below for the warnings and

Re: [R] Sensitivity Analysis for Moderated Mediation?

2016-12-05 Thread Bert Gunter
This post actually has nothing to do with R programming per se, and hence is off topic here. Please post elsewhere, e.g. on stats.stackexchange.com or other list that discusses "mediation models". Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Bert Gunter
John: I think you need to re-read about how functions pass arguments and data frame access works in R. What Rui meant was to get rid of all the xx stuff and access your column by: col <- frame[, yy] That *does* work. Cheers, Bert Bert Gunter "The trouble with having an open mind is that

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread John Sorkin
Rui, I appreciate your suggestion, but eliminating the deparse statement does not solve my problem. Do you have any other suggestions? See code below. Thank you, John mydf <- data.frame(id=c(1,2,3,4,5),sex=c("M","M","M","F","F"),age=c(20,34,43,32,21)) mydf class(mydf) myfun <-

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Rui Barradas
I forgot to say that I've commented out the line # This does not work. #col <- xx[,"yy"] Rui Barradas Em 05-12-2016 15:17, Rui Barradas escreveu: Hello, You don't need xx <- deparse(substitute(...)), since you are passing the data.frame to your function. Just use myfun <-

Re: [R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread Rui Barradas
Hello, You don't need xx <- deparse(substitute(...)), since you are passing the data.frame to your function. Just use myfun <- function(frame,var){ [...] # Nor does this work. col <- frame[,yy] print(col) } myfun(mydf,age) myfun(frame = mydf, var = age) [1] 2 3 I can get the name

Re: [R] "Patched " version listed on CRAN mirrors is actually Oct RC version

2016-12-05 Thread Duncan Murdoch
On 05/12/2016 8:31 AM, Watson, David W. (MSFC-ES62) wrote: I have been trying to download the “patched” version of 3.3.2 from CRAN, but the version that gets delivered is actually the October Release Candidate version, (R version 3.3.2 RC (2016-10-26 r71594). It has been doing this since 3.3.2

[R] Write a function that allows access to columns of a passed dataframe.

2016-12-05 Thread John Sorkin
I am trying to write a function which, when passed the name of a dataframe and the name of a column of the dataframe, will allow me to work on the columns of a dataframe. I can not get my code to work. Please see the code below. Any help in getting the function to work would be appreciated.

[R] "Patched " version listed on CRAN mirrors is actually Oct RC version

2016-12-05 Thread Watson, David W. (MSFC-ES62)
I have been trying to download the “patched” version of 3.3.2 from CRAN, but the version that gets delivered is actually the October Release Candidate version, (R version 3.3.2 RC (2016-10-26 r71594). It has been doing this since 3.3.2 has been released. Is there a real patched version

[R] Sensitivity Analysis for Moderated Mediation?

2016-12-05 Thread Dominik Wyss
Dear group, medsens() is a fantastic method for testing sensitivity of mediation models estimated by the mediate(). (mediation package by Tingley et al; Version 4.4.5). However, I'm wondering whether medsens() is also appropriate for moderated mediation? And if not, is there an alternative

Re: [R] Question about proxy setting of R

2016-12-05 Thread qwertyui_period
Dear Jim, Thanks to your advice, "Proxy Authentification" window�showed up, however, I couldn't access to the internet. Error messages are as below. -- -- --- > update.packages(ask='graphics',checkBuilt=TRUE) --- Please select a CRAN

Re: [R] Clustering methods for data that has bimodal distribution

2016-12-05 Thread Ranjan Maitra
Hello Adrian, It all depends on what the structure of the dataset is. For instance, you said that all your values are betweenn -1 and 1. Do the data rown sum-squared up to 1? How about the means? Are they zero. I guess all this has to depend on the application and how the data were processed

[R] Can't install or upgrade the "PKI" package on a Debian testing system

2016-12-05 Thread Emmanuel Charpentier
Dear list, It seems that recent changes in openssl somehow broke the installation or update of the PKI package. This is probably specific of my setup(s) (Debian testing, updated frequently). Copy of a mail to Simon Urbanek (PKI maintainer), sent 5 days ago without reply nor acknowledgement

[R] ggplot2, qplot, problems

2016-12-05 Thread Daniel
Dear the R Community, I just encountered an error while using ggplot2 and the qplot function (please see below for the warnings and error), and i have no idea about how to make changes so that it will work. Could anyone kindly advise me a bit and help me out here?

Re: [R-es] Big data con R o phyton?

2016-12-05 Thread Carlos Ortega
Hola Jesús, Con Spark el lenguaje preferente a usar es Scala. Python y R ofrecen adaptaciones, que aprovechan gran parte de su sintaxis (no toda) y esas adaptaciones PySpark, RSpark incluyen funciones especiales para delegar trabajos de procesamiento a Spark en modo distribuido. Pero al menos

Re: [R] error serialize (foreach)

2016-12-05 Thread Jon Skoien
Parallel processing usually includes quite a lot of overhead, which is expensive if the computation itself is quick. This is definitely an example where the function is too simple to take advantage of parallelization. Another thing is that your example has some errors, which makes the effect

Re: [R] Question about proxy setting of R

2016-12-05 Thread Carina Salt via R-help
As far as I can see, the 'internal' method doesn't work for https mirrors (on my system, anyway). However, the http mirrors still exist (try " http://cloud.r-project.org/; for example) so why not just use one of those? Cheers, Carina On 5 December 2016 at 12:27, jim holtman

[R] openxlsx: No Formatting of Numbers

2016-12-05 Thread G . Maubach
Hi All, Dear Readers, I am using openxlsx to export data to Microsoft Excel 2013, 32-Bit, German Version: --- schnipp --- library("openxlsx") dataset <- structure( list( a = c(1126039.81, 45636.44, 14847.41), b = c(1194447.5, 88310.53, 18699.68), c = c(1560307.73,

[R] openxlsx: No Formatting of Numbers (TEXT ONLY)

2016-12-05 Thread G . Maubach
Hi All, Dear Readers, I am using openxlsx to export data to Microsoft Excel 2013, 32-Bit, German Version: --- schnipp --- library("openxlsx") dataset <- structure( list( a = c(1126039.81, 45636.44, 14847.41), b = c(1194447.5, 88310.53, 18699.68), c = c(1560307.73,

Re: [R] scatter plot of numerical variables against different sample ids

2016-12-05 Thread Ivan Calandra
Hi Maria, What happens is that R plots with boxplots (explaining the horizontal lines, i.e. boxes with n=1) when the x-variable is a factor. What you can do is transform your Sample column into numeric and then plot it, with some adjustment of axis labels. For example: datf <-

Re: [R] Question about proxy setting of R

2016-12-05 Thread jim holtman
You will probably have to check with your network folks to see what is possible on your system. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Mon, Dec 5, 2016 at 6:33 AM,

[R] scatter plot of numerical variables against different sample ids

2016-12-05 Thread Maria Lathouri via R-help
Dear all I know that my question is very simple but although I tried to find an answer online, I couldn't and I am stuck.  I have a dataset of three numerical variables measured in different samples ID. Something like this: Sample        Cu        Zn        MnM1               1          5        

Re: [R-es] Big data con R o phyton?

2016-12-05 Thread José Luis Cañadas
Hola Hombre, aprender python no estorba. Pero en realidad en temas de bigdata python lo que tiene es pyspark que es una api para los modelos que hay en spark. En R está sparkR pero no están todos los modelos que hay en mllib de spark, se supone que el paquete sparklyr soluciona este tema, a ver