Re: [R] R-help Digest, Vol 250, Issue 13

2023-12-15 Thread Karl Ropkins
Kevin,
Maybe also look at what air quality monitoring is being done in area.
https://cran.r-project.org/web/packages/RAQSAPI/vignettes/RAQSAPIvignette.html
Depends what and how near, but might be something relevant there?

Karl

Dr Karl Ropkins
Transport Studies | Environment | University of Leeds

--

Message: 2
Date: Tue, 12 Dec 2023 07:52:59 -0800
From: Bert Gunter 
To: Kevin Zembower 
Cc: R-help email list 
Subject: Re: [R] Advice on starting to analyze smokestack emissions?
Message-ID:

Content-Type: text/plain; charset="utf-8"

You might also try the R-Sig-ecology list, though I would agree that it's
not clearly related. Still, air pollution effects...?

-- Bert

On Tue, Dec 12, 2023 at 3:15 AM Kevin Zembower via R-help <
r-help@r-project.org> wrote:

> Hello, all,
>
> [Originally sent to r-sig-geo list, with no response. Cross-posting
> here, in the hope of a wider audience. Anyone with any experience in
> this topic? Thanks.]
>
> I'm trying to get started analyzing the concentrations of smokestack
> emissions. I don't have any professional background or training for
> this; I'm just an old, retired guy who thinks playing with numbers is
> fun.
>
> A local funeral home in my neighborhood (less than 1200 ft from my
> home) is proposing to construct a crematorium for human remains. I have
> some experience with the tidycensus package and thought it might be
> interesting to construct a model for the changes in concentrations of
> the pollutants from the smokestack and, using recorded wind speeds and
> directions, see which US Census blocks would be affected.
>
> I have the US Government EPA SCREEN3 output on how concentration varies
> with distance from the smokestack.
> See
> https://www.epa.gov/scram/air-quality-dispersion-modeling-screening-models#screen3
> if curious. As a first task, I'd like to see if I can calculate similar
> results in R. I'm aware of the 'plume' steady-state Gaussian dispersion
> package
> (https://rdrr.io/github/holstius/plume/f/inst/doc/plume-intro.pdf), but
> am a little concerned that this package was last updated 11 years ago.
>
> Do you have any recommendations for me on how to get started analyzing
> this problem? Is 'plume' still the way to go? I'm aware that there are
> many atmospheric dispersion models from the US EPA, but I was hoping to
> keep my work within R, which I'm really enjoying using and learning
> about. Are SCREEN3 and 'plume' comparable? Is this the best R list to
> ask questions about this topic?
>
> Thanks for any advice or guidance you have for me.
>
> -Kevin
>
>
>
>
> __
> 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]]




--

Message: 3
Date: Tue, 12 Dec 2023 21:19:12 + (UTC)
From: varin sacha 
To: "r-help@r-project.org" ,  Ben Bolker

Subject: Re: [R] ggplot2: Get the regression line with 95% confidence
bands
Message-ID: <68588390.888662.1702415952...@mail.yahoo.com>
Content-Type: text/plain; charset="utf-8"

Dear Ben,
Dear Daniel,
Dear Rui,
Dear Bert,

Here below my R code.
I really appreciate all your comments. My R code is perfectly working but there 
is still something I would like to improve. The X-axis is showing   2012.5 ;   
2015.0   ;   2017.5   ;  2020.0
I would like to see on X-axis only the year (2012 ; 2015 ; 2017 ; 2020). How to 
do?


#
library(ggplot2)

df=data.frame(year= c(2012,2015,2018,2022), score=c(495,493, 495, 474))

ggplot(df, aes(x = year, y = score)) + geom_point() + geom_smooth(method = 
"lm", formula = y ~ x) +
 labs(title = "Standard linear regression for France", x = "Year", y = "PISA 
score in mathematics") + 
scale_y_continuous(limits=c(470,500),oob=scales::squish)
#









Le lundi 11 décembre 2023 à 23:38:06 UTC+1, Ben Bolker  a 
écrit :







On 2023-12-11 5:27 p.m., Daniel Nordlund wrote:
> On 12/10/2023 2:50 PM, Rui Barradas wrote:
>> Às 22:35 de 10/12/2023, varin sacha via R-help escreveu:
>>>
>>> Dear R-experts,
>>>
>>> Here below my R code, as my X-axis is "year", I must be missing one
>>> or more steps! I am trying to get the regression line with the 95%
>>> confidence bands around the regression line. Any help would be
>>> appreciated.
>>>
>>> Best,
>>> S.
>>>
>>>
>>> #
>>> library(ggplot2)
>>>   df=data.frame(year=factor(c("2012","2015","2018","2022")),
>>> score=c(495,493, 495, 474))
>>>   ggplot(df, aes(x=year, y=score)) + geom_point( ) +
>>> geom_smooth(method="lm", formula = score ~ factor(year), data = df) +
>>> labs(title="Standard linear regression for France", y="PISA score in
>>> mathematics") + ylim(470, 500)
>>> 

Re: [R] R-help Digest, Vol 236, Issue 25

2022-10-27 Thread Thomas Subia
Paul wrote:
" Is there any package besides fitdistrplus that does allow automatic
distribution fitting?"

Automatic distribution fitting can be done using Minitab.
Minitab will try and fit your dataset against 14 distributions.
It has the option of using a Box-Cox or a Johnson methods to transform the 
dataset into a normal distribution.
I suspect that this is as close as you can get to an automatic distribution 
fitting.

Hope this helps!

Thomas Subia

-Original Message-
From: R-help  On Behalf Of 
r-help-requ...@r-project.org
Sent: Thursday, October 27, 2022 3:00 AM
To: r-help@r-project.org
Subject: R-help Digest, Vol 236, Issue 25

Send R-help mailing list submissions to
r-help@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit

https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-help__;!!NX4bS6ECB6Pv!58HVkevfq5zfBsZ-2SRH07K3Plt5jMiaOZESF0m5ISL6OEQ6tVLVvrxTtICUro1_0hb0FfINk_O3DRlbb69V3tZbX1blniVg28s$
 
or, via email, send a message with subject or body 'help' to
r-help-requ...@r-project.org

You can reach the person managing the list at
r-help-ow...@r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-help digest..."


Today's Topics:

   1. Re: unexpected 'else' in " else" (Richard O'Keefe)
   2. Function for Distribution Fitting (Paul Bernal)
   3. Re: Function for Distribution Fitting (JRG)
   4. Re: Function for Distribution Fitting (Bert Gunter)
   5. Re: Function for Distribution Fitting (Gabor Grothendieck)
   6. compile report error (=?UTF-8?Q?G=C3=A1bor_Malomsoki?=)
   7. Re: compile report error (Rui Barradas)
   8. Re: Function for Distribution Fitting (Ebert,Timothy Aaron)
   9. Re: compile report error (=?UTF-8?Q?G=C3=A1bor_Malomsoki?=)
  10. Best place to ask questions about non-R Base topics, ex.
  dplyr, dbplyr, etc. ? (Kelly Thompson)
  11. Re:  Best place to ask questions about non-R Base topics, ex.
  dplyr, dbplyr, etc. ? (Jeff Newmiller)
  12. Re: compile report error (=?UTF-8?Q?G=C3=A1bor_Malomsoki?=)
  13. Re:  Best place to ask questions about non-R Base topics, ex.
  dplyr, dbplyr, etc. ? (Eric Berger)
  14. Re: compile report error (Rui Barradas)
  15. Color Nodes (Jeff Reichman)
  16. Re: Color Nodes (Rui Barradas)
  17. Re: Color Nodes (Jeff Reichman)
  18. R-package imputeTS / warning messages (Paulo Barata)
  19. Re: Color Nodes (Eric Berger)

--

Message: 1
Date: Wed, 26 Oct 2022 23:03:30 +1300
From: "Richard O'Keefe" 
To: Jinsong Zhao 
Cc: "r-help@r-project.org" 
Subject: Re: [R] unexpected 'else' in " else"
Message-ID:

Content-Type: text/plain; charset="utf-8"

This is explained in books about S and R.
The first place to look is of course
> ?"if"
which says

 Note that it is a common mistake to forget to put braces ('{ ..
 }') around your statements, e.g., after 'if(..)' or 'for()'.
 In particular, you should not have a newline between '}' and
 'else' to avoid a syntax error in entering a 'if ... else'
 construct at the keyboard or via 'source'.  For that reason, one
 (somewhat extreme) attitude of defensive programming is to always
 use braces, e.g., for 'if' clauses.


The basic issue is that the top level wants to get started
on your command AS SOON AS IT HAS A COMPLETE COMMAND,
and if (...) stmt
is complete.  It's not going to hang around "Waiting for Godot"
for an 'else' that might never ever ever turn up.  So
   if (x < y) z <-
   x else z <- y
is absolutely fine, no braces needed, while
   if (x < y) z <- x
   else z <- y
will see the eager top level rush off to do your bidding
at the end of the first line and then be completely
baffled by an 'else' where it does not expect one.

It's the same reason that you break AFTER infix operators
instead of BEFORE.
   x <- y +
   z
works fine, while
   x <- y
   + z
doesn't.



On Fri, 21 Oct 2022 at 22:29, Jinsong Zhao  wrote:

> Hi there,
>
> The following code would cause R error:
>
>  > w <- 1:5
>  > r <- 1:5
>  > if (is.matrix(r))
> + r[w != 0, , drop = FALSE]
>  > else r[w != 0]
> Error: unexpected 'else' in "else"
>
> However, the code:
>  if (is.matrix(r))
>  r[w != 0, , drop = FALSE]
>  else r[w != 0]
> is extracted from stats::weighted.residuals.
>
> My question is why the code in the function does not cause error?
>
> Best,
> Jinsong
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-help__;!!NX4bS6ECB6Pv!58HVkevfq5zfBsZ-2SRH07K3Plt5jMiaOZESF0m5ISL6OEQ6tVLVvrxTtICUro1_0hb0FfINk_O3DRlbb69V3tZbX1blniVg28s$
>  
> PLEASE do read the posting guide
> 

Re: [R] R-help Digest, Vol 217, Issue 25

2021-03-25 Thread phil

Thank you, Messrs Barradas and Gross, for your very helpful advice.

Philip


Message: 21
Date: Wed, 24 Mar 2021 22:41:25 -0400
From: "Avi Gross" 
To: 
Subject: Re: [R]  Including a ggplot call with a conditional geom in a
function
Message-ID: <07e801d72120$59e5c720$0db15560$@verizon.net>
Content-Type: text/plain; charset="us-ascii"

This may not be the right place to ask about ggplot which is part of
packages but are you aware how ggplot works additively?

You can say something like:

P <- ggplot(...) ... + ...

Then later say:

P <- p + geom_...()

And so on.

So if you set al the layers you want first into a variable like p, then 
in
an if statement you selectively add in one or another layer and finally 
add

in all remaining layers before printing it, would that simply meet your
need?

Realistically, ggplot creates a data structure and the PLUS of other 
layers
updates or expands that structure but nothing happens till you print it 
and

it evaluates the data structure.

-Original Message-
From: R-help  On Behalf Of 
p...@philipsmith.ca

Sent: Wednesday, March 24, 2021 10:24 PM
To: r-help@r-project.org
Subject: [R] Including a ggplot call with a conditional geom in a 
function


How can I write an R function that contains a call to ggplot within it, 
with
one of the ggplot geom statements being conditional? In my reprex, I 
want
the plot to contain a horizontal zero line if the y values are both 
positive
and negative, and to exclude the horizontal line if all of the y values 
are

of the same sign. I tried a simple if statement, but it does not work.
Suggestions appreciated. Philip

library(rlang)
library(tidyverse)

a <- c(1:8)
b <- c(23,34,45,43,32,45,68,78)
c <- c(0.34,0.56,0.97,0.33,-0.23,-0.36,-0.11,0.17)
df <- data.frame(a,b,c)

posNeg <- function(x) {
   ifelse(sum(x>0)>0 & sum(x>0)
To: p...@philipsmith.ca, r-help@r-project.org
Subject: Re: [R]  Including a ggplot call with a conditional geom in a
function
Message-ID: 
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Hello,

In the following code, the fixed parts of the plot are drawn first,
assigning the plot to p. Then geom_hline is conditionally added to p 
and

the result returned to caller.
This may be a problem if the conditional geom needs to be in a 
specified

order in the plot. Function plotLineFunc2 adds everything in the order
of the question and is probably a better way of solving the problem.

I have also rewritten posNeg() without ifelse.

posNeg <- function(x) sum(x>0)>0 & sum(x>0)

__
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] R-help Digest, Vol 217, Issue 20

2021-03-21 Thread Bert Gunter
... or a George Box (I believe) said: The crucial "Declaration of
Independence."


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 Sat, Mar 20, 2021 at 4:25 PM John Maindonald 
wrote:

> No, it is not distribution free.  Independent random sampling is assumed.
> That is a non-trivial assumption, and one that is very often not true or
> not
> strictly true.
>
>
> John Maindonald email: john.maindon...@anu.edu.au john.maindon...@anu.edu.au>
>
>
> On 21/03/2021, at 00:00, r-help-requ...@r-project.org r-help-requ...@r-project.org> wrote:
>
> From: Jiefei Wang mailto:szwj...@gmail.com>>
> Subject: Re: [R] about a p-value < 2.2e-16
> Date: 20 March 2021 at 04:41:33 NZDT
> To: Spencer Graves  spencer.gra...@effectivedefense.org>>
> Cc: Bogdan Tanasa mailto:tan...@gmail.com>>, Vivek Das <
> vd4mm...@gmail.com>, r-help <
> r-help@r-project.org>
>
>
> Hi Spencer,
>
> Thanks for your test results, I do not know the answer as I haven't
> used wilcox.test for many years. I do not know if it is possible to compute
> the exact distribution of the Wilcoxon rank sum statistic, but I think it
> is very likely, as the document of `Wilcoxon` says:
>
> This distribution is obtained as follows. Let x and y be two random,
> independent samples of size m and n. Then the Wilcoxon rank sum statistic
> is the number of all pairs (x[i], y[j]) for which y[j] is not greater than
> x[i]. This statistic takes values between 0 and m * n, and its mean and
> variance are m * n / 2 and m * n * (m + n + 1) / 12, respectively.
>
> As a nice feature of the non-parametric statistic, it is usually
> distribution-free so you can pick any distribution you like to compute the
> same statistic. I wonder if this is the case, but I might be wrong.
>
> Cheers,
> Jiefei
>
>
>
> [[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] R-help Digest, Vol 217, Issue 20

2021-03-20 Thread John Maindonald
No, it is not distribution free.  Independent random sampling is assumed.
That is a non-trivial assumption, and one that is very often not true or not
strictly true.


John Maindonald email: 
john.maindon...@anu.edu.au


On 21/03/2021, at 00:00, 
r-help-requ...@r-project.org wrote:

From: Jiefei Wang mailto:szwj...@gmail.com>>
Subject: Re: [R] about a p-value < 2.2e-16
Date: 20 March 2021 at 04:41:33 NZDT
To: Spencer Graves 
mailto:spencer.gra...@effectivedefense.org>>
Cc: Bogdan Tanasa mailto:tan...@gmail.com>>, Vivek Das 
mailto:vd4mm...@gmail.com>>, r-help 
mailto:r-help@r-project.org>>


Hi Spencer,

Thanks for your test results, I do not know the answer as I haven't
used wilcox.test for many years. I do not know if it is possible to compute
the exact distribution of the Wilcoxon rank sum statistic, but I think it
is very likely, as the document of `Wilcoxon` says:

This distribution is obtained as follows. Let x and y be two random,
independent samples of size m and n. Then the Wilcoxon rank sum statistic
is the number of all pairs (x[i], y[j]) for which y[j] is not greater than
x[i]. This statistic takes values between 0 and m * n, and its mean and
variance are m * n / 2 and m * n * (m + n + 1) / 12, respectively.

As a nice feature of the non-parametric statistic, it is usually
distribution-free so you can pick any distribution you like to compute the
same statistic. I wonder if this is the case, but I might be wrong.

Cheers,
Jiefei



[[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] R-help Digest, Vol 212, Issue 12

2020-10-14 Thread Dan Ryan
Dear Frauke,

Thank you very much for taking the time to respond.  

You explanation was very helpful, and I now have that part figured out!

Best Wishes,

Dan

Frauke
Message: 3
Date: Mon, 12 Oct 2020 08:33:44 +0200 (CEST)
From: =?UTF-8?Q?Frauke_G=C3=BCnther?= 
To: "r-help@r-project.org" 
Cc: William Michels , "s...@posteo.org"

Subject: Re: [R]  Fwd:  Help using the exclude option in the neuralnet
package
Message-ID: <957726669.124476.1602484424...@srvmail.bips.eu>
Content-Type: text/plain; charset="utf-8"

Dear all,

the exclude and constant.weights options are used as follows:

exclude: A matrix with n rows and 3 columns will exclude n weights. The the 
first column refers to the layer, the second column to the input neuron and the 
third column to the output neuron of the weight.

constant.weights: A vector specifying the values of the weights that are 
excluded from the training process and treated as fix.

Please refer to the following example:

Not using exclude and constant.weights (all weights are trained):

> nn <- neuralnet(Species == "setosa" ~ Petal.Length + Petal.Width, 
> iris, linear.output = FALSE)
>
> nn$weights
[[1]]
[[1]][[1]]
[,1]
[1,] 6.513239
[2,] -0.815920
[3,] -5.859802
[[1]][[2]]
[,1]
[1,] -4.597934
[2,] 9.179436

Using exclude (2 weights are excluded --> NA):

> nn <- neuralnet(Species == "setosa" ~ Petal.Length + Petal.Width, 
> iris, linear.output = FALSE,
exclude = matrix(c(1,2,1, 2,2,1),byrow=T, nrow=2))
> nn$weights
[[1]]
[[1]][[1]]
[,1]
[1,] -0.2815942
[2,] NA
[3,] 0.2481212
[[1]][[2]]
[,1]
[1,] -0.6934932
[2,] NA

Using exclude and constant.weights (2 weights are excluded and treated as fix 
--> 100 and 1000, respectively):

> nn <- neuralnet(Species == "setosa" ~ Petal.Length + Petal.Width, 
> iris, linear.output = FALSE,
exclude = matrix(c(1,2,1, 2,2,1),byrow=T, nrow=2),
constant.weights=c(100,1000))
> nn$weights
[[1]]
[[1]][[1]]
[,1]
[1,] 0.554119
[2,] 100.00
[3,] 1.153611
[[1]][[2]]
[,1]
[1,] -0.3962524
[2,] 1000.000

I hope you will find this example helpful.

Sincerely,
Frauke


> William Michels mailto:w...@caa.columbia.edu > hat 
> am 10.10.2020 18:16 geschrieben:
>
>
> Forwarding: Question re "neuralnet" package on the R-Help mailing list:
>
> https://stat.ethz.ch/pipermail/r-help/2020-October/469020.html
>
> If you are so inclined, please reply to:
>
> r-help@r-project.org mailto:r-help@r-project.org 
> mailto:r-help@r-project.org >
>
> -- Forwarded message -
> From: Dan Ryan mailto:dan.r...@unbc.ca >
> Date: Fri, Oct 9, 2020 at 3:52 PM
> Subject: Re: [R] Help using the exclude option in the neuralnet package
> To: r-help@r-project.org mailto:r-help@r-project.org 
> mailto:r-help@r-project.org >
>
> Good Morning,
>
> I am using the neuralnet package in R, and am able to produce some
> basic neural nets, and use the output.
>
> I would like to exclude some of the weights and biases from the
> iteration process and fix their values.
>
> However I do not seem to be able to correctly define the exclude and
> constant.weights vectors.
>
> Question: Can someone point me to an example where exclude and
> contant.weights are used. I have search the R help archive, and
> haven't found any examples which use these on the web.
>
> Thank you in advance for any help.
>
> Sincerely
>
> Dan
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailto: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] R-help Digest, Vol 212, Issue 4

2020-10-06 Thread Avi Gross via R-help
Nice alternative for some cases but I do not get the desires result as one
long vector. I would change the last line to this:

unlist(as.vector(sapply(1:length(a), 
FUN=function(x, 
 a, 
 b) a[x]:b[x], 
a=a,
b=b)))

The indenting works better using a constant-width font, LOL.

With all these twists, including using the base R methods like uppercase
Map, the relative speed of these methods comes to mind. No doubt someone
will suggest rewriting this as yet another C function for speed.

-Original Message-
From: R-help  On Behalf Of Izmirlian, Grant
(NIH/NCI) [E] via R-help
Sent: Monday, October 5, 2020 1:06 PM
To: 'r-help@r-project.org' 
Subject: Re: [R] R-help Digest, Vol 212, Issue 4

Hi -- there are lots of replies --I have not read them all, if someone else
suggested this, sorry for duplication. This is similar to the suggestion
using mapply, but not specific to matrices. In fact it's a kludge that
applies to many settings. You 'sapply' over the index 1:2, and pass a, b as
arguments:


a <- c(1,4)
 b <- c(5,8)

sapply(1:2, FUN=function(x, a, b)a[x]:b[x], a=a,b=b)

-Original Message-
From: r-help-requ...@r-project.org 
Sent: Monday, October 05, 2020 6:04 AM
To: r-help@r-project.org
Subject: R-help Digest, Vol 212, Issue 4

Send R-help mailing list submissions to
r-help@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject or body 'help' to
r-help-requ...@r-project.org

You can reach the person managing the list at
r-help-ow...@r-project.org

When replying, please edit your Subject line so it is more specific than
"Re: Contents of R-help digest..."

__
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] R-help Digest, Vol 212, Issue 4

2020-10-05 Thread Izmirlian, Grant (NIH/NCI) [E] via R-help
Hi -- there are lots of replies --I have not read them all, if someone else 
suggested this, sorry for duplication. This is similar to the suggestion using 
mapply, but not specific to matrices. In fact it's a kludge that applies to 
many settings. You 'sapply' over the index 1:2, and pass a, b as arguments:


a <- c(1,4)
 b <- c(5,8)

sapply(1:2, FUN=function(x, a, b)a[x]:b[x], a=a,b=b)


-Original Message-
From: r-help-requ...@r-project.org  
Sent: Monday, October 05, 2020 6:04 AM
To: r-help@r-project.org
Subject: R-help Digest, Vol 212, Issue 4

Send R-help mailing list submissions to
r-help@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject or body 'help' to
r-help-requ...@r-project.org

You can reach the person managing the list at
r-help-ow...@r-project.org

When replying, please edit your Subject line so it is more specific than "Re: 
Contents of R-help digest..."

__
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] R-help Digest, Vol 206, Issue 25

2020-04-29 Thread David Duffy
I don't think anyone responded last week.

> Using the mice package, I have created multiple imputed datasets to deal
> with missing data. I am looking for an example of the R code to use in
> order to analyze the set of imputed datasets using tetrachoric correlations
> in such a way that after pooling, I will have a combined tetrachoric
> covariance-variance matrix to use as input for an exploratory factor
> analysis.

Hi Ian.

The mice package requires you to have an appropriate method to extract the 
individual simulated datasets:

The ‘mira’ object is generated by the ‘with.mids()’...It may happen that you'll 
see the messages like ‘No method for tidying an S3 object of class ...’ or 
‘Error: No glance method for objects of class ...’. The royal way to solve this 
problem is to write your own ‘glance()’ and ‘tidy()’ methods and add these to 
‘broom’ according to the specifications given in
 https://broom.tidyverse.org/articles/adding-tidiers.html>.

eg
data(gllm::lsat)
idx <- rep(1:32, lsat$Freq)
lsat2 <- lsat[idx,-6]
idx <- cbind(sample(1:1000, size=50, replace=T), sample(1:5, size=50, 
replace=T))
lsat2[idx] <- NA
library(mice)
s1 <- mice(lsat2)
pool(with(s1, exp=polychor(A,B)))
Error: No glance method for objects of class numeric

 print(with(s1, exp=polychor(A,B)))
call :
with.mids(data = s1, expr = polychor(A, B))
call1 :
mice(data = lsat3)

nmis :
 A  B  C  D  E 
 9 11 13  7 10 

analyses :
[[1]]
[1] 0.1552523

[[2]]
[1] 0.1485645

[[3]]
[1] 0.1584301

[[4]]
[1] 0.1536678

[[5]]
[1] 0.1698725

You can see that "all" you have to do is take the mean of the A-B tetrachoric 
correlations from in this case, 5, replicates, to get your corrected 
correlation.

It happens that there is a ‘glance.lavaan’ routine, and lavaan has the lavCor() 
function to estimate tetrachoric correlations and
fit structural equation models. So you can probably fit your factor model 
directly and get correct statistical tests there.

Cheers, David Duffy.

__
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] R-help Digest, Vol 203, Issue 8

2020-01-10 Thread Rui Barradas

Hello,

And there's also


#
# library(caTools)
# Author(s)
# Jarek Tuszynski 
#
# Original
trapz <- function(x, y){
idx = 2:length(x)
return(as.double( (x[idx] - x[idx-1]) %*% (y[idx] + y[idx-1]) ) / 2)
}

# Modified by me, input is x, f(x)
trapzf <- function(x, FUN) trapz(x, FUN(x))
# Call like 'integrate'
trapzf2 <- function(f, lower, upper, subdivisions = 100){
trapzf(seq(lower, upper, length.out = subdivisions), match.fun(f))
}



So I guess it's not missing, just missing in base R, like the OP said.

Hope this helps,

Rui Barradas

Às 11:20 de 09/01/20, Helmut Schütz escreveu:

Dear Hans,

r-help-requ...@r-project.org wrote on 2020-01-09 12:00:

Date: Wed, 8 Jan 2020 12:09:55 +0100
From: Hans W Borchers 
To: R help project 
Subject: [R] Which external functions are called in a package?
[Solved]

NB: `trapz`, ie.
the trapezoidal integration formula, seems to be the numerical
function to be missed the most in R base.


In R base indeed. However available in Frank Harrels Hmisc as the 
function trap.rule(x, y) for sorted values.

In plain R: function(x, y) sum(diff(x) * (y[-1] + y[-length(y)]))/2

Helmut



__
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] R-help Digest, Vol 203, Issue 8

2020-01-09 Thread Helmut Schütz

Dear Hans,

r-help-requ...@r-project.org wrote on 2020-01-09 12:00:

Date: Wed, 8 Jan 2020 12:09:55 +0100
From: Hans W Borchers 
To: R help project 
Subject: [R] Which external functions are called in a package?
[Solved]

NB: `trapz`, ie.
the trapezoidal integration formula, seems to be the numerical
function to be missed the most in R base.


In R base indeed. However available in Frank Harrels Hmisc as the 
function trap.rule(x, y) for sorted values.

In plain R: function(x, y) sum(diff(x) * (y[-1] + y[-length(y)]))/2

Helmut

--
Ing. Helmut Schütz
BEBAC – Consultancy Services for
Bioequivalence and Bioavailability Studies
Neubaugasse 36/11
1070 Vienna, Austria
W https://bebac.at/
F https://forum.bebac.at/

__
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] R-help mailing list archives

2019-06-11 Thread Marc Schwartz via R-help


> On Jun 11, 2019, at 4:03 AM, Martin Maechler  
> wrote:
> 
>> Brent via R-help 
>>on Sun, 9 Jun 2019 03:07:38 + writes:
> 
> [..]
> [..]
> [..]
> 
>> This email list's archives:
> 
>> Apologies in advance if this question has been asked and
>> answered many times already.
> 
>> But know that before posting this, in addition to a normal
>> web search, I tried to find prior discussions on this
>> email list.
> 
>> This is problematic.  The official site
>> https://stat.ethz.ch/mailman/listinfo/r-help says that the
>> only ways which partly work are the GMANE interfaces and
>> the Nabble one.
> 
> You misread what it tries to say. The first time it mentions 'archives'
> it gives you the link showing 'R-help Archives' which goes to
> 
>   https://stat.ethz.ch/pipermail/r-help/
> 
> which are the official R-help archives (on that same server stat.ethz.ch
> provided to the R community by the Math Dept. of ETH Zurich).
> They work "fine" but don't have a nice 1-click search interface.
> So you what has worked for ca 20 years
> {{ but people probably
>   mostly have not learned anymore thanks to the universally "fool
>   proof" search interface
> }}
> still works fine: Use  the site: trick,  i.e.,
> 
> where I found that adding "pipermail" is also somewhat important
> to find more mailing list answers (than R help pages which are
> also served from there).
> E.g., 
>  site:stat.ethz.ch pipermail R windows GUI scaling
> 
> finds a lot (but maybe nothing relevant to your search), notably
> with Google;
> a bit less unfortunately  with my usual search engine "Duck Duck
> Go" (which is *not* keeping track as much as Google of everything I do )
> 
> 
>> I got a Error 522 page from GMANE.
> 
> Yes, unfortunately...  Should probably remove that link from the
> R-help info page; it has gone for several years now AFAIK.
> 
> Martin Maechler
> ETH Zurich and R Core Team
> 
> 
> 
>> Nabble returned 2 hits for variations on the search terms
>> "rgui high dpi 4k"
>> http://r.789695.n4.nabble.com/Font-Size-for-View-under-Linux-td4746104.html
>>
>> http://r.789695.n4.nabble.com/Bug-report-problems-with-saving-plots-on-a-Windows-PC-with-4k-monitor-wrong-picture-size-td4752183.html
>> None are relevant here.
> 


Hi,

Just to amplify Martin's comments, if you go to the main R Project web site, 
you will find, in the left hand navigation links the following:

Search:
https://www.r-project.org/search.html

and 

Getting Help:
https://www.r-project.org/help.html

both of which eventually link to search resources such as rseek.org, which are 
dedicated to R related searches.

Using rseek.org and the "All" tab, with the same search phrase as above, though 
not quoted, led to the following two hits:

R-Devel from 2015:
https://stat.ethz.ch/pipermail/r-devel/2015-September/071732.html

A Microsoft support note:
https://support.microsoft.com/en-my/help/4091364/windows-10-fix-blurry-apps

It is not clear to me if either is helpful here in the end as I do not have a 
4K display, but at least shows alternative results using rseek.org.

Note that rseek.org, includes other sources beyond the official R e-mail list 
archives, which is why the MS note comes up. You can narrow the results by 
using the various tab options at the top of the page.

Regards,

Marc Schwartz

__
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] R-help mailing list archives

2019-06-11 Thread Martin Maechler
> Brent via R-help 
> on Sun, 9 Jun 2019 03:07:38 + writes:

 [..]
 [..]
 [..]

> This email list's archives:

> Apologies in advance if this question has been asked and
> answered many times already.

> But know that before posting this, in addition to a normal
> web search, I tried to find prior discussions on this
> email list.

> This is problematic.  The official site    
> https://stat.ethz.ch/mailman/listinfo/r-help says that the
> only ways which partly work are the GMANE interfaces and
> the Nabble one.

You misread what it tries to say. The first time it mentions 'archives'
it gives you the link showing 'R-help Archives' which goes to

   https://stat.ethz.ch/pipermail/r-help/

which are the official R-help archives (on that same server stat.ethz.ch
provided to the R community by the Math Dept. of ETH Zurich).
They work "fine" but don't have a nice 1-click search interface.
So you what has worked for ca 20 years
{{ but people probably
   mostly have not learned anymore thanks to the universally "fool
   proof" search interface
}}
still works fine: Use  the site: trick,  i.e.,

where I found that adding "pipermail" is also somewhat important
to find more mailing list answers (than R help pages which are
also served from there).
E.g., 
  site:stat.ethz.ch pipermail R windows GUI scaling

finds a lot (but maybe nothing relevant to your search), notably
with Google;
a bit less unfortunately  with my usual search engine "Duck Duck
Go" (which is *not* keeping track as much as Google of everything I do )


> I got a Error 522 page from GMANE.

Yes, unfortunately...  Should probably remove that link from the
R-help info page; it has gone for several years now AFAIK.

Martin Maechler
ETH Zurich and R Core Team



> Nabble returned 2 hits for variations on the search terms
> "rgui high dpi 4k"    
> 
http://r.789695.n4.nabble.com/Font-Size-for-View-under-Linux-td4746104.html
>    
> 
http://r.789695.n4.nabble.com/Bug-report-problems-with-saving-plots-on-a-Windows-PC-with-4k-monitor-wrong-picture-size-td4752183.html
> None are relevant here.

__
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] R-help Digest, Vol 193, Issue 16

2019-03-20 Thread Frank van Berkum
Dear Simon,

Thank you for your response! I was not able to provide you with the requested 
information at an earlier stage since I am not a full time academic / 
researcher.

An example of a bam call that may result in an error is:
bam(formula=Di ~ 1 + Gender + I(L_Dis==0) + s(DisPerc, by=as.numeric(L_Dis==2), 
bs='cr'), offset=log(Ei*Mi), family=poisson, data=dtPF, method="fREML", 
discrete=TRUE, gc.level=2);

Here, dtPF is a data.table object with 22m rows and 21 columns/variables, 
Gender is a factor variable, L_Dis is an integer variable which equals 0 if 
DisPerc is missing (manually set to 0.1), equals 1 if DisPerc==0, and equals 2 
if DisPerc>0 (ranges from 0 to 0.25).

The sessionInfo() provides the following output:
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: 
/sara/eb/Debian9/OpenBLAS/0.2.20-GCC-6.4.0-2.28/lib/libopenblas_sandybridgep-r0.2.20.so

locale:
 [1] LC_CTYPE=en_US   LC_NUMERIC=C LC_TIME=en_US
 [4] LC_COLLATE=en_US LC_MONETARY=en_USLC_MESSAGES=en_US
 [7] LC_PAPER=en_US   LC_NAME=CLC_ADDRESS=C
[10] LC_TELEPHONE=C   LC_MEASUREMENT=en_US LC_IDENTIFICATION=C

attached base packages:
[1] methods   stats graphics  grDevices utils datasets  base

other attached packages:
[1] mgcv_1.8-27   nlme_3.1-137  data.table_1.12.0

loaded via a namespace (and not attached):
[1] compiler_3.4.3  Matrix_1.2-16   tools_3.4.3 splines_3.4.3
[5] grid_3.4.3  lattice_0.20-38

Thank you for your help!

Frank


From: R-help  on behalf of 
r-help-requ...@r-project.org 
Sent: Saturday, March 16, 2019 11:00 AM
To: r-help@r-project.org
Subject: R-help Digest, Vol 193, Issue 16

Send R-help mailing list submissions to
r-help@r-project.org

To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject or body 'help' to
r-help-requ...@r-project.org

You can reach the person managing the list at
r-help-ow...@r-project.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-help digest..."


Date: Fri, 15 Mar 2019 12:31:31 +
From: Simon Wood 
To: r-help@r-project.org
Subject: Re: [R] [mgcv] Memory issues with bam() on computer cluster
Message-ID: 
Content-Type: text/plain; charset="utf-8"

Can you supply the results of sessionInfo() please, and the full bam
call that causes this.

best,

Simon (mgcv maintainer)

On 15/03/2019 09:09, Frank van Berkum wrote:
> Dear Community,
>
> In our current research we are trying to fit Generalized Additive Models to a 
> large dataset. We are using the package mgcv in R.
>
> Our dataset contains about 22 million records with less than 20 risk factors 
> for each observation, so in our case n>>p. The dataset covers the period 2006 
> until 2011, and we analyse both the complete dataset and datasets in which we 
> leave out a single year. The latter part is done to analyse robustness of the 
> results. We understand k-fold cross validation may seem more appropriate, but 
> out approach is closer to what is done in practice (how will one additional 
> year of information affect your estimates?).
>
> We use the function bam as advocated in Wood et al. (2017), and we apply the 
> following options: bam(�, discrete=TRUE, chunk.size=1, gc.level=1). We 
> run these analyses on a computer cluster (see 
> https://userinfo.surfsara.nl/systems/lisa/description for details), and the 
> job is allocated to a node within the computer cluster. A node has at least 
> 16 cores and 64Gb memory.
>
> We had expected 64Gb of memory to be sufficient for these analyses, 
> especially since the bam function is built specifically for large datasets. 
> However, when applying this function to the different datasets described 
> above with different regression specifications (different risk factors 
> included in the linear predictor), we sometimes obtain errors of the 
> following form.
>
> Error in XWyd(G$Xd, w, z, G$kd, G$ks, G$ts, G$dt, G$v, G$qc, G$drop, ar.stop, 
>  :
>
>'Calloc' could not allocate memory (22624897 of 8 bytes)
>
> Calls: fnEstimateModel_bam -> bam -> bgam.fitd -> XWyd
>
> Execution halted
>
> Warning message:
>
> system call failed: Cannot allocate memory
>
> Error in Xbd(G$Xd, coef, G$kd, G$ks, G$ts, G$dt, G$v, G$qc, G$drop) :
>
>'Calloc' could not allocate memory (18590685 of 8 bytes)
>
> Calls: fnEstimateModel_bam -> bam -> bgam.fitd -> Xbd
>
> Execution halted
>
> Warning message:
>
> system call failed: Cannot allocate memory
>
> Error: cannot allocate vector of size 1.7 Gb
>
> Timing stopped at: 2 0.556 4.831
>
> Error in system.time(oo <- .C(C_XWXd0, XWX = as.double(rep(0, (pt + nt)^2)),  
> :
>
>'Calloc' could not allocate memory (55315650 of 24 bytes)
>
> Calls: fnEstimateModel_bam -> bam -> bgam.fitd -> XWXd 

Re: [R] R help

2019-02-15 Thread S Ellison
> I am having an issue with creating a code in which i can hold information such
> as the author of a paper, the year of publication, and the title. 
This doesn't really tell me what the trouble is. But  ...

> Also would like
> to add into this data frame a logical variable which would show some
> keywords I used to find the data. 
A logical variable cannot include keywords ('cos it's a logical).
You can add a column for each keyword, though, and that could be logical.
So, for example, you could search text for keywords like "cat" and "mouse", and 
your data frame could be, say
textcatmouse
The cat ate the mouse   TRUE   TRUE
The mouse ate the cheese  FALSE  TRUE

and so on.
You can also add a text comment (see ?comment) giving the list of keywords as a 
single text value, or another attribute (see ?attr) that held a vector of 
keywords. Those would then be accessible if you passed yourt data frame to a 
function that needed the keyword list. You could even include the 'keyword' 
columns above as such an attribute; attributes can be any object. 


> I keep getting stuck on how to create
> specific characters for the table.
'fraid that's not sufficient to comment on.
Try sending an example of what you want to see; someone may be able to work out 
how to make it happen. 





***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
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] R help

2019-02-14 Thread Sarah Goslee
There's a bibtex parser for R: you could adapt that for your use,
rather than trying to reinvent the equivalent tool.

https://cran.r-project.org/web/packages/bibtex/index.html

Sarah

On Thu, Feb 14, 2019 at 5:57 PM Gouresh Kamble via R-help
 wrote:
>
> Dear to whom it may concern on the R team,
>
>
>
> I am having an issue with creating a code in which i can hold information 
> such as the author of a paper, the year of publication, and the title. Also 
> would like to add into this data frame a logical variable which would show 
> some keywords I used to find the data. I keep getting stuck on how to create 
> specific characters for the table.
>
>
>

-- 
Sarah Goslee (she/her)
http://www.numberwright.com

__
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] R help

2019-02-14 Thread Gouresh Kamble via R-help
Dear to whom it may concern on the R team, 



I am having an issue with creating a code in which i can hold information such 
as the author of a paper, the year of publication, and the title. Also would 
like to add into this data frame a logical variable which would show some 
keywords I used to find the data. I keep getting stuck on how to create 
specific characters for the table. 




Kind Regards, 
Gouresh Kamble 
__
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] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Jeff Newmiller
Indeed, if you repeat the code you provided before then the problem will not go 
away because you are not using the knowledge we have given you. You need to 
show us what you are trying differently based on the explanations provided on 
the mailing list. If you don't do this then we cannot move forward to more 
specific answers.

As a reminder:

> Execute your code line by line and solve the first error you
>encounter by examining the error message and reviewing what that line
>of code is designed to do.

On January 16, 2019 11:48:03 AM PST, N Meriam  wrote:
>Thanks for your valuable clarifications.
>I tried all the steps again but the problem remains.
>In fact,  "fviz_nbclust" is a function inside the package "factoextra".
>I run each step very carefully but the problem remains...It doesn't
>make sense because I have installed factoextra.
>
>This warning appears:
>could not find function "fviz_nbclust"
>
>On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller
> wrote:
>>
>> Concept 1: You don't install functions... you install packages that
>have functions in them. There is a function fviz_nbclust in factoextra.
>>
>> Concept 2: Once a package is installed, you do NOT have to install it
>again, e.g. every time you want to do that analysis. Making the
>installation part of your script is not advised.
>>
>> Concept 3: Typically we do use the library function with a package
>name at the beginning of every session where we want to use functions
>from that package. However, that is optional... you could also just
>invoke the function directly using
>factoextra::fviz_nbclust(...blahblah...). Having the library function
>shortens this and if the package is not installed it provides a clear
>error message that can be a reminder to the user to install the
>package.
>>
>> Execute your code line by line and solve the first error you
>encounter by examining the error message and reviewing what that line
>of code is designed to do.
>>
>> On January 16, 2019 11:00:07 AM PST, N Meriam 
>wrote:
>> >Hello,
>> >I'm struggling to install a function called "fviz_nbclus".
>> >
>> >My code is the following:
>> >pkgs <- c("factoextra",  "NbClust")
>> >install.packages(pkgs)
>> >library(factoextra)
>> >library(NbClust)
>> ># Standardize the data
>> >load("df4.rda")
>> >library(FunCluster)
>> >
>> >install.packages("fviz_nbclust")
>> >#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
>> >"gap_stat"))
>> >
>> >Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
>> >(as ‘lib’ is unspecified)
>> >Warning in install.packages :
>> >  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>> >
>> >Best,
>> >Meriam
>> >
>> >__
>> >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.

-- 
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] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread N Meriam
Thanks for your valuable clarifications.
I tried all the steps again but the problem remains.
In fact,  "fviz_nbclust" is a function inside the package "factoextra".
I run each step very carefully but the problem remains...It doesn't
make sense because I have installed factoextra.

This warning appears:
could not find function "fviz_nbclust"

On Wed, Jan 16, 2019 at 1:22 PM Jeff Newmiller  wrote:
>
> Concept 1: You don't install functions... you install packages that have 
> functions in them. There is a function fviz_nbclust in factoextra.
>
> Concept 2: Once a package is installed, you do NOT have to install it again, 
> e.g. every time you want to do that analysis. Making the installation part of 
> your script is not advised.
>
> Concept 3: Typically we do use the library function with a package name at 
> the beginning of every session where we want to use functions from that 
> package. However, that is optional... you could also just invoke the function 
> directly using factoextra::fviz_nbclust(...blahblah...). Having the library 
> function shortens this and if the package is not installed it provides a 
> clear error message that can be a reminder to the user to install the package.
>
> Execute your code line by line and solve the first error you encounter by 
> examining the error message and reviewing what that line of code is designed 
> to do.
>
> On January 16, 2019 11:00:07 AM PST, N Meriam  wrote:
> >Hello,
> >I'm struggling to install a function called "fviz_nbclus".
> >
> >My code is the following:
> >pkgs <- c("factoextra",  "NbClust")
> >install.packages(pkgs)
> >library(factoextra)
> >library(NbClust)
> ># Standardize the data
> >load("df4.rda")
> >library(FunCluster)
> >
> >install.packages("fviz_nbclust")
> >#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
> >"gap_stat"))
> >
> >Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
> >(as ‘lib’ is unspecified)
> >Warning in install.packages :
> >  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
> >
> >Best,
> >Meriam
> >
> >__
> >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.



-- 
Meriam Nefzaoui
MSc. in Plant Breeding and Genetics
Universidade Federal Rural de Pernambuco (UFRPE) - Recife, Brazil

__
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] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Jeff Newmiller
Concept 1: You don't install functions... you install packages that have 
functions in them. There is a function fviz_nbclust in factoextra.

Concept 2: Once a package is installed, you do NOT have to install it again, 
e.g. every time you want to do that analysis. Making the installation part of 
your script is not advised.

Concept 3: Typically we do use the library function with a package name at the 
beginning of every session where we want to use functions from that package. 
However, that is optional... you could also just invoke the function directly 
using factoextra::fviz_nbclust(...blahblah...). Having the library function 
shortens this and if the package is not installed it provides a clear error 
message that can be a reminder to the user to install the package.

Execute your code line by line and solve the first error you encounter by 
examining the error message and reviewing what that line of code is designed to 
do.

On January 16, 2019 11:00:07 AM PST, N Meriam  wrote:
>Hello,
>I'm struggling to install a function called "fviz_nbclus".
>
>My code is the following:
>pkgs <- c("factoextra",  "NbClust")
>install.packages(pkgs)
>library(factoextra)
>library(NbClust)
># Standardize the data
>load("df4.rda")
>library(FunCluster)
>
>install.packages("fviz_nbclust")
>#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss",
>"gap_stat"))
>
>Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
>(as ‘lib’ is unspecified)
>Warning in install.packages :
>  package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>
>Best,
>Meriam
>
>__
>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] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread Sarah Goslee
Hi,

fviz_nbclust is a function within the package factoextra. Once you
have installed the package and loaded it, you do not need to
explicitly install the function.

You probably also don't need FunCluster - I think you may be confusing
that package with the FUNcluster argument to the fviz_nbclust
function.

Do take a look at
?fviz_nbclust
for help and a working example.

library(factoextra)
library(NbClust)
# Standardize the data
load("df4.rda")
fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))

Sarah

On Wed, Jan 16, 2019 at 2:00 PM N Meriam  wrote:
>
> Hello,
> I'm struggling to install a function called "fviz_nbclus".
>
> My code is the following:
> pkgs <- c("factoextra",  "NbClust")
> install.packages(pkgs)
> library(factoextra)
> library(NbClust)
> # Standardize the data
> load("df4.rda")
> library(FunCluster)
>
> install.packages("fviz_nbclust")
> #fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))
>
> Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
> (as ‘lib’ is unspecified)
> Warning in install.packages :
>   package ‘fviz_nbclust’ is not available (for R version 3.5.2)
>
> Best,
> Meriam
>
> __
> 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.



-- 
Sarah Goslee (she/her)
http://www.numberwright.com

__
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] R help: fviz_nbclust’ is not available (for R version 3.5.2)

2019-01-16 Thread N Meriam
Hello,
I'm struggling to install a function called "fviz_nbclus".

My code is the following:
pkgs <- c("factoextra",  "NbClust")
install.packages(pkgs)
library(factoextra)
library(NbClust)
# Standardize the data
load("df4.rda")
library(FunCluster)

install.packages("fviz_nbclust")
#fviz_nbclust(df4, FUNcluster, method = c("silhouette", "wss", "gap_stat"))

Installing package into ‘C:/Users/DELL/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘fviz_nbclust’ is not available (for R version 3.5.2)

Best,
Meriam

__
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] R help: circular dendrogram

2019-01-08 Thread N Meriam
Dear all,

I generated a circular dendrogram with R (see attached). I have a
total of 360 landraces.
What I want to do next is generate a different color for each cluster
and also generate colors to show the country/region.
I don't know if it's also possible to put a code number (associated
with each landrace) in front of each ramification.
I want to have an explicit dendrogram.


Rplot01.pdf
Description: Adobe PDF document
__
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] R-help Digest, Vol 185, Issue 1

2018-07-03 Thread Nina Schönfelder
Dear Luke,

it true that the number is not immediately displayed in the 
GMM-regression output using the plm package. To get the number of 
instruments (incl. exogenous variables and time dummies) you have to type:

   k <- model    # so that k is the pgmm-estimation output (an 
object of class c("pgmm","panelmodel")
       ninst <- ncol(k$W[[1]])    # the number of instruments is simply 
count as the number of columns in the matrix of instruments

Best regards,

Nina

--

*Dr. Nina Schönfelder*

*Nationaler Open-Access-Kontaktpunkt OA2020-DE*
Universität Bielefeld
Universitätsbibliothek
Universitätsstr. 25
D-33615 Bielefeld

Phone: +49 (0) 521/106-2546
E-mail: nina.schoenfel...@uni-bielefeld.de
Homepage: https://oa2020-de.org/
Twitter: @oa2020de
Facebook: https://www.facebook.com/oa2020de/

Am 01.07.2018 um 12:00 schrieb r-help-requ...@r-project.org:
> Message: 1
> Date: Sat, 30 Jun 2018 11:03:06 +0200
> From: =?UTF-8?b?xYF1a2FzeiBQacSZdGFr?=
> To:r-help@r-project.org
> Subject: [R] Question
> Message-ID: 
> Content-Type: text/plain; charset="utf-8"
>
>
> Hi, My name is Luke and I come from Poland. I have one question, maybe very 
> simple, but I can not resolve it. In dynamic panel data (GMM estimator) after 
> running the model, I recieve a AR test and Sargan test, but the "number of 
> instruments" are not displayed. In Stata and Gretl this informatios is given, 
> in R no. My question is, how to obtain the number of instruments?.
> Thank you for helping.
> Luke
>
>

[[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] R-help Digest, Vol 183, Issue 13

2018-05-13 Thread Thomas Levine
Ilio Fornasero writes:
> Hello.
> 
> I am trying to find a way to retrieve data from Harvard Dataverse website.
> I usually don't have problem in web-scraping data but the problem here is 
> that there are a bunch of data formats such as .tab,  .7z and so and I just 
> can't find a way to retrieve the data I am interested in woth an unique 
> solution.
> Any hint?

.tab does not identify a file format. It might be in a read.csv format
or a read.fwf format.

No 7z decompressor seems to exist in CRAN, (I checked `findFn('7z')`.)
so you could use system/system2: `system2('7z', c('e', ...)), or I think
7z.exe on Windows. You would need to install p7zip and read the manual
(`man 7z` on a Unix-like system).

Please send an example.

__
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] R help

2018-03-31 Thread Ted Harding
 A. On Sat, 2018-03-31 at 15:45 +0200, Henri Moolman wrote:
> Could you please provide help with something from R that I find rather
> puzzling? In the small program below x[1]=1, .  .  .  , x[5]=5. R also
> finds that x[1]<=5 is TRUE. Yet when you attempt to execute while, R does
> not seem to recognize the condition. Any thoughts on why this happens?
> 
> Regards
> 
> Henri Moolman
> 
> > x=c(1,2,3,4,5)
> > x[1]
> [1] 1
> > i=1
> > x[1]<=5
> [1] TRUE
> > while(x[i]<=5){
> + i=i+1
> + }
> Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed

If you run the following you should understand why (the only
change is to include "print(i)" in the loop, so you can see
what is happening):

  x=c(1,2,3,4,5)
  x[1]
# [1] 1
  i=1
  x[1]<=5
# [1] TRUE
  while(x[i]<=5){
  i = i+1 ; print(i)
  }
# [1] 3
# [1] 4
# [1] 5
# [1] 6
# Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed

So everything is fine so long as i <= 5 (i.e. x[i] <= 5),
but then the loop sets i = 6. and then:

  i
# [1] 6
  x[i]
# [1] NA
  x[i] <= 5
# [1] NA

Helpful?
Best wishes,
Ted.

__
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] R help

2018-03-31 Thread Rui Barradas

Hello,

Maybe you want

while(x[i] < 5)

not <=

Hope this helps,

Rui Barradas

On 3/31/2018 2:45 PM, Henri Moolman wrote:

Could you please provide help with something from R that I find rather
puzzling? In the small program below x[1]=1, .  .  .  , x[5]=5. R also
finds that x[1]<=5 is TRUE. Yet when you attempt to execute while, R does
not seem to recognize the condition. Any thoughts on why this happens?

Regards

Henri Moolman


x=c(1,2,3,4,5)
x[1]

[1] 1

i=1
x[1]<=5

[1] TRUE

while(x[i]<=5){

+ i=i+1
+ }
Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed

[[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] R help

2018-03-31 Thread Mathew Guilfoyle
When i increments to 6 (during the fifth iteration) the subsequent test of 
x[i]<=5 will produce an error since x has only five elements.

> On 31 Mar 2018, at 14:45, Henri Moolman  wrote:
> 
> Could you please provide help with something from R that I find rather
> puzzling? In the small program below x[1]=1, .  .  .  , x[5]=5. R also
> finds that x[1]<=5 is TRUE. Yet when you attempt to execute while, R does
> not seem to recognize the condition. Any thoughts on why this happens?
> 
> Regards
> 
> Henri Moolman
> 
>> x=c(1,2,3,4,5)
>> x[1]
> [1] 1
>> i=1
>> x[1]<=5
> [1] TRUE
>> while(x[i]<=5){
> + i=i+1
> + }
> Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed
> 
>   [[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] R help

2018-03-31 Thread Thomas Mailund
The condition is true all the way until you index outside the vector...

Cheers

On 31 Mar 2018, 17.29 +0200, Henri Moolman , wrote:
> Could you please provide help with something from R that I find rather
> puzzling? In the small program below x[1]=1, . . . , x[5]=5. R also
> finds that x[1]<=5 is TRUE. Yet when you attempt to execute while, R does
> not seem to recognize the condition. Any thoughts on why this happens?
>
> Regards
>
> Henri Moolman
>
> > x=c(1,2,3,4,5)
> > x[1]
> [1] 1
> > i=1
> > x[1]<=5
> [1] TRUE
> > while(x[i]<=5){
> + i=i+1
> + }
> Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed
>
> [[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] R help

2018-03-31 Thread Henri Moolman
Could you please provide help with something from R that I find rather
puzzling? In the small program below x[1]=1, .  .  .  , x[5]=5. R also
finds that x[1]<=5 is TRUE. Yet when you attempt to execute while, R does
not seem to recognize the condition. Any thoughts on why this happens?

Regards

Henri Moolman

> x=c(1,2,3,4,5)
> x[1]
[1] 1
> i=1
> x[1]<=5
[1] TRUE
> while(x[i]<=5){
+ i=i+1
+ }
Error in while (x[i] <= 5) { : missing value where TRUE/FALSE needed

[[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] R-help: ActivPALProcessing

2017-12-01 Thread Thralls, Katie
Hi,

I am having trouble with the function process.AP  in the ActivPALProcessing 
package. Based on the detailed instruction attached by the author, it is my 
understanding that process.AP will use the information provided in the log of 
subjects to batch process AP events files saved in the working directory.  
Results of the batch processing will be summarized in three files: 1) Sleep 
Wake Wear Table, 2) Results Table and 3) Means Table.

However, I have followed the directions in the attachment but have only 
received a few outcomes (I copied and pasted what came out from my code below.) 
I have checked and rechecked my files to be sure their formatting is correct 
and I am not sure what else to try. I e-mailed the author about a month ago but 
have not heard anything either. Let me know if you have some recommendations on 
how I can move forward.

Thanks!
Katie Thralls
9254139791



CODE:

install.packages("activpalProcessing")
library("activpalProcessing")

  list.files("~/Dropbox/R_code/AP_Directory/")
directory <- identifyDirectory("~/Dropbox/R_code/AP_Directory/")
setwd("~/Dropbox/R_code/AP_Directory/")
  list.files()
  #Here I open "log.subjects.csv" in a text editor and a return at the end of 
the last (only) data row. Then resave as csv. Then the error go away. See:
  read.csv("log.subjects.csv")
read.table("log.subjects.csv")
read.csv("SB_KT_1.csv")
process.AP(directory,name.of.log.subjects="log.subjects",name.of.log.bed=log.bed,name.of.log.on.off=log.on.off)
#no errors



Output in R Console:
> process.AP(directory,name.of.log.subjects="log.subjects",name.of.log.bed=log.bed,name.of.log.on.off=log.on.off)
[1] 1
[1] "1"
[1] "SB"

__
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] R-help

2017-11-09 Thread MacQueen, Don
A trip to the Spatial Task View on CRAN might be in order. The RandomFields 
package comes to mind.

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 11/9/17, 12:37 AM, "R-help on behalf of PIKAL Petr" 
<r-help-boun...@r-project.org on behalf of petr.pi...@precheza.cz> wrote:

Hi

it smells like a homework, this list has no homework policy.

Anyway, maybe the sample approach could be used.

Generate x,y coordinates - ?expand.grid
sample n centers - ?sample
select all points within defined area - ?point.in.polygon, package sp
select desired number of points - ?sample

Cheers
Petr

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of john 
lukore
> Sent: Thursday, November 9, 2017 4:40 AM
> To: r-help@r-project.org
> Subject: [R] R-help
>
> Generate a clustered pattern in [0; 1]2 as follows:
>
> (a) Generate nc, say 20, independent cluster centres (which can be called
> parents) that are distributed i.i.d. uniformly in the unit square;
>
>  (b) then n daughters are assigned i.i.d. uniformly to these parents and 
such
> that each daughter is located i.i.d. uniformly in a disk of radius r =
> 0:1 centred at her parent, under the periodic boundary conditions (i.e. 
the
> square = a torus).
>
>
> My attempt so far is:
>
>
> set.seed(1) library(spatstat)
>
>  n_parent <- 2
>
>  n_daughter <- 4
>
> r = 0.1
>
> cnt <- n
>
> W <- disc(radius=3, centre=c(0,0)) i <- 1
>
>  while(i <= n_daughter){
>
> d_x <- runif(1)
>
> d_y <- runif(1)
>
> if (d_x ^2+d_y^2 <r) {
>
>  i = i+1}}
>
>
> #need a condition here such that (d_x,d_y) lies in B(0,r)
>
>  #where B(0,r) is a ball of center origin and of radius r
>
> In above we should obtain one ball with n_daughters. Next step is to 
generate
> parent centers and distribute the n_daughters in the ball into n_parents.
>
>   [[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.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou 
určeny pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi 
či zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření 
smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za 
společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn 
nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto 
emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich 
existence je adresátovi či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its 
sender. Delete the contents of this e-mail with all attachments and its copies 
from your system.
If you are not the intended recipient of this e-mail, you are not 
authorized to use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage 
caused by modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and 

Re: [R] R-help

2017-11-09 Thread PIKAL Petr
Hi

it smells like a homework, this list has no homework policy.

Anyway, maybe the sample approach could be used.

Generate x,y coordinates - ?expand.grid
sample n centers - ?sample
select all points within defined area - ?point.in.polygon, package sp
select desired number of points - ?sample

Cheers
Petr

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of john lukore
> Sent: Thursday, November 9, 2017 4:40 AM
> To: r-help@r-project.org
> Subject: [R] R-help
>
> Generate a clustered pattern in [0; 1]2 as follows:
>
> (a) Generate nc, say 20, independent cluster centres (which can be called
> parents) that are distributed i.i.d. uniformly in the unit square;
>
>  (b) then n daughters are assigned i.i.d. uniformly to these parents and such
> that each daughter is located i.i.d. uniformly in a disk of radius r =
> 0:1 centred at her parent, under the periodic boundary conditions (i.e. the
> square = a torus).
>
>
> My attempt so far is:
>
>
> set.seed(1) library(spatstat)
>
>  n_parent <- 2
>
>  n_daughter <- 4
>
> r = 0.1
>
> cnt <- n
>
> W <- disc(radius=3, centre=c(0,0)) i <- 1
>
>  while(i <= n_daughter){
>
> d_x <- runif(1)
>
> d_y <- runif(1)
>
> if (d_x ^2+d_y^2 <r) {
>
>  i = i+1}}
>
>
> #need a condition here such that (d_x,d_y) lies in B(0,r)
>
>  #where B(0,r) is a ball of center origin and of radius r
>
> In above we should obtain one ball with n_daughters. Next step is to generate
> parent centers and distribute the n_daughters in the ball into n_parents.
>
>   [[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.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to th

[R] R-help

2017-11-08 Thread john lukore
Generate a clustered pattern in [0; 1]2 as follows:

(a) Generate nc, say 20, independent cluster centres (which can be called
parents) that are distributed i.i.d. uniformly in the unit square;

 (b) then n daughters are assigned i.i.d. uniformly to these parents and
such that each daughter is located i.i.d. uniformly in a disk of radius r =
0:1 centred at her parent, under the periodic boundary conditions (i.e. the
square = a torus).


My attempt so far is:


set.seed(1) library(spatstat)

 n_parent <- 2

 n_daughter <- 4

r = 0.1

cnt <- n

W <- disc(radius=3, centre=c(0,0)) i <- 1

 while(i <= n_daughter){

d_x <- runif(1)

d_y <- runif(1)

if (d_x ^2+d_y^2 

Re: [R] R-help Digest, Vol 171, Issue 20

2017-05-29 Thread David Winsemius

> On May 28, 2017, at 11:53 PM, Brigitte Mangin  wrote:
> 
> Thanks Ron,
> 
> In fact, I want to make a model choice using different fixed structures and 
> using the results of:
> Gurka MJ (2006) Selecting the best linear mixed model under reml. The 
> American Statistician 60(1):19{26,
> the best criterium uses the reml likelihood.
> 
> I asked the ASREML-r developpers and they answered that their results were 
> checked against GENSTAT.
> 
> I think it is not really a good think for the R community to compute a REML 
> likelihood that is probably not the REML likelihood.

Is it your understanding that REML values should be different somehow than 
other likelihoods with respect to the fact that you should only be comparing 
_differences_ in model likelihoods calculated on the same data? The value of a 
likelihood is only specified up to a constant (as Thierry Onkelinx already 
pointed out.)

I can get different deviances (-2*log(likelihood) in glm poisson models by just 
grouping data elements and modeling counts. But varying models will have the 
same differences in deviance regardless of grouping or not.

Looking at this copy of that citation It appears to me that differences 
(comparing full to reduced) in various criteria for models is what is under 
discussion:

http://users.jyu.fi/~hemipu/itms/Gurka%202006,%20TAS,%20REML.pdf

You should show some results rather than letting this discussion remain so 
vague.

-- 
David.


> 
> Brigitte
> 
> 
> 
> Brigitte Mangin, INRA, LIPM, CS 52627, 31326 CASTANET-TOLOSAN
> tel: 33 + (0)5 61 28 54 58
> 
> 
> De : Crump, Ron 
> Envoyé : mardi 23 mai 2017 10:29
> À : r-help@r-project.org; Brigitte Mangin
> Objet : Re: R-help Digest, Vol 171, Issue 20
> 
> Hi Brigitte,
> 
>> Did somebody know why asreml does not provide the same REML loglikehood
>> as coxme, lme4 or lmne.
> 
> I don't know the answer to this, but I'd guess it is either to do with the
> use of the average information REML algorithm or asreml-r is for some
> reason ending up with a different subset of the data.
> 
>> If it was just a constant value between the two models (with or without
>> the fixed effect) it would not be important. But it is not.
>> I checked that the variance component estimators were equal.
> 
> I'm still not clear that it is important (if the data subset analysed is
> the same). You would only use the REML likelihoods to compare models with
> different random effects and the same fixed effect structure (is there
> another use for the REML likelihood other than that?), so then it is
> really a question of whether for a given pair of random effect models and
> the same data the likelihood ratio test statistic  changes across analysis
> methods. Unless for some reason you are comparing two random effect models
> fitted with different routines (one of which is asreml-r).
> 
> Ron.
> 
> 
> __
> 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.

David Winsemius
Alameda, CA, USA

__
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] R-help Digest, Vol 171, Issue 20

2017-05-29 Thread Brigitte Mangin
Thanks Ron,

In fact, I want to make a model choice using different fixed structures and 
using the results of:
Gurka MJ (2006) Selecting the best linear mixed model under reml. The American 
Statistician 60(1):19{26,
the best criterium uses the reml likelihood.

I asked the ASREML-r developpers and they answered that their results were 
checked against GENSTAT.

I think it is not really a good think for the R community to compute a REML 
likelihood that is probably not the REML likelihood.

Brigitte



Brigitte Mangin, INRA, LIPM, CS 52627, 31326 CASTANET-TOLOSAN
tel: 33 + (0)5 61 28 54 58


De : Crump, Ron 
Envoyé : mardi 23 mai 2017 10:29
À : r-help@r-project.org; Brigitte Mangin
Objet : Re: R-help Digest, Vol 171, Issue 20

Hi Brigitte,

>Did somebody know why asreml does not provide the same REML loglikehood
>as coxme, lme4 or lmne.

I don't know the answer to this, but I'd guess it is either to do with the
use of the average information REML algorithm or asreml-r is for some
reason ending up with a different subset of the data.

>If it was just a constant value between the two models (with or without
>the fixed effect) it would not be important. But it is not.
>I checked that the variance component estimators were equal.

I'm still not clear that it is important (if the data subset analysed is
the same). You would only use the REML likelihoods to compare models with
different random effects and the same fixed effect structure (is there
another use for the REML likelihood other than that?), so then it is
really a question of whether for a given pair of random effect models and
the same data the likelihood ratio test statistic  changes across analysis
methods. Unless for some reason you are comparing two random effect models
fitted with different routines (one of which is asreml-r).

Ron.


__
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] R-help Digest, Vol 171, Issue 20

2017-05-23 Thread Crump, Ron
Hi Brigitte,

>Did somebody know why asreml does not provide the same REML loglikehood
>as coxme, lme4 or lmne.

I don't know the answer to this, but I'd guess it is either to do with the
use of the average information REML algorithm or asreml-r is for some
reason ending up with a different subset of the data.

>If it was just a constant value between the two models (with or without
>the fixed effect) it would not be important. But it is not.
>I checked that the variance component estimators were equal.

I'm still not clear that it is important (if the data subset analysed is
the same). You would only use the REML likelihoods to compare models with
different random effects and the same fixed effect structure (is there
another use for the REML likelihood other than that?), so then it is
really a question of whether for a given pair of random effect models and
the same data the likelihood ratio test statistic  changes across analysis
methods. Unless for some reason you are comparing two random effect models
fitted with different routines (one of which is asreml-r).

Ron.

__
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] R-help Digest, Vol 170, Issue 29

2017-05-01 Thread Adrian Trapletti
> Message: 1
> Date: Fri, 28 Apr 2017 11:07:40 +
> From: T.Riedle 
> To: "R-help@r-project.org" 
> Subject: [R] Augmented Dickey Fuller test
> Message-ID: <1493377701072.16...@kent.ac.uk>
> Content-Type: text/plain; charset="UTF-8"
>
> Dear all,
>
> I am trying to run an ADF test using the adf.test() function in the tseries 
> package and the ur.df() function in the urca package. The results I get 
> contrast sharply. Whilst the adf.test() indicates stationarity which is in 
> line with the corresponding graph, the ur.df() indicates non-stationarity.
>

In a simple example I can't reproduce your finding. The test statistic
of adf.test() and ur.df() are identical:

> library(urca)
> library(tseries)
>
> set.seed(1)
>
> x <- rnorm(1000)  # no unit-root
> adf.test(x)

Augmented Dickey-Fuller Test

data:  x
Dickey-Fuller = -9.9291, Lag order = 9, p-value = 0.01
alternative hypothesis: stationary

Warning message:
In adf.test(x) : p-value smaller than printed p-value
> ur.df(x, lags=trunc((length(x)-1)^(1/3)), type="trend")

###
# Augmented Dickey-Fuller Test Unit Root / Cointegration Test #
###

The value of the test statistic is: -9.9291 32.869 49.2953

>
> y <- diffinv(x)   # contains a unit-root
> adf.test(y)

Augmented Dickey-Fuller Test

data:  y
Dickey-Fuller = -2.5115, Lag order = 9, p-value = 0.3618
alternative hypothesis: stationary

> ur.df(y, lags=trunc((length(y)-1)^(1/3)),  type="trend")

###
# Augmented Dickey-Fuller Test Unit Root / Cointegration Test #
###

The value of the test statistic is: -2.5115 2.4203 3.5281

>
>
> Why does this happen? Could anybody explain the adf.test() function in more 
> detail? How does adf.test() select the number of lags is it AIC or BIC and 
> how does it take an intercept and/or a trend into account?

?adf.test

Details

The general regression equation which incorporates a constant and a
linear trend is used and the t-statistic for a first order
autoregressive coefficient equals one is computed. The number of lags
used in the regression is k. The default value of
trunc((length(x)-1)^(1/3)) corresponds to the suggested upper bound on
the rate at which the number of lags, k, should be made to grow with
the sample size for the general ARMA(p,q) setup.

References

A. Banerjee, J. J. Dolado, J. W. Galbraith, and D. F. Hendry (1993):
Cointegration, Error Correction, and the Econometric Analysis of
Non-Stationary Data, Oxford University Press, Oxford.
S. E. Said and D. A. Dickey (1984): Testing for Unit Roots in
Autoregressive-Moving Average Models of Unknown Order. Biometrika 71,
599–607.

>
>
>
> Help is greatly appreciated.
>
>
>
> Thanks in advance.
>
> [[alternative HTML version deleted]]
>

Best regards

Adrian

--
Adrian Trapletti

Steinstrasse 9b, 8610 Uster, Switzerland
P +41 44 994 56 30  |  M +41 79 103 71 31
adr...@trapletti.org  |  www.trapletti.org

__
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] R help

2017-04-17 Thread Jeff Newmiller
I am assuming that you are referring to your emails from last October and last 
month regarding nlme.

A) Read the Posting Guide, which mentions things like the fact that you should 
set your email program to send plain text when posting on this mailing list , 
and that there is a dedicated R-sig-mixed-models mailing list where questions 
about nlme would be more on topic. (The plain text thing is important to avoid 
us receiving a corrupted version of what you sent, so it is important if we are 
to understand you.)

B) Don't reply to an existing message on the list with a completely different 
question... start a fresh email with an informative subject line and all of the 
replies will show up together in many email programs and in the archives. 
Hijacked email threads tend to get overlooked, which is not in your best 
interest. 

C) Make sure your example is reproducible. See for example [1] or [2] or [3] 
(or all three).

D) A course in linear regression should address when it is reasonable to remove 
terms, but it is beyond the scope of this list to go into that. Removing the 
intercept due to large p-values is hardly ever justified. Mixed models of the 
complexity you are trying to use typically require a lot more data than you 
showed last month to give significant results. You should probably consult with 
a local statistician on your experimental design.

[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

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

On April 17, 2017 8:28:56 PM PDT, Santiago Bueno  wrote:
>I need help with R, and although I have posted my questions, no one
>seems
>to care. Can some one coach me in formulating a correct question?
>
>Regards,
>
>Santiago
>
>   [[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] R help

2017-04-17 Thread David L Carlson
The only recent question that I can see you posted (Mar 22) was tagged onto an 
existing thread so it is possible people assumed you were answering the 
question raised by the original poster.

Do not use html - learn how to send emails as plain text.

If you have a question, start a new thread, do not add it as a reply to an 
existing question.

And the usual, post a reproducible example with data and code. Your last 
question did that. Try posting again, in plain text and creating a new subject 
line. Use dput() to send your data to the list. Just listing it with print can 
leave out important information.


David L. Carlson
Department of Anthropology
Texas A University


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Santiago Bueno
Sent: Monday, April 17, 2017 10:29 PM
To: R-help@r-project.org
Subject: [R] R help

I need help with R, and although I have posted my questions, no one seems
to care. Can some one coach me in formulating a correct question?

Regards,

Santiago

[[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] R help

2017-04-17 Thread Santiago Bueno
I need help with R, and although I have posted my questions, no one seems
to care. Can some one coach me in formulating a correct question?

Regards,

Santiago

[[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] R help

2016-11-17 Thread David L Carlson
This should work. First create some reproducible data:

> set.seed(42)
> temp.matrix <- matrix(rnorm(255*13), 255, 13)

Then you need to send each row to t.test() using apply() extracting the 
statistic with [[1]]:

> result <- apply(temp.matrix, 1, function(x) (t.test(x[3:7], x[8:12], 
> paired=TRUE)[[1]]))
> str(result)
 num [1:255] -0.195 0.307 1.214 2.221 0.633 ...
> quantile(result)
 0% 25% 50% 75%100% 
-3.39194814 -0.80146023  0.02383907  0.71836716  5.88806695

-
David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77840-4352

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Vincenzo 
Prestigiacomo
Sent: Wednesday, November 16, 2016 2:07 PM
To: r-help@r-project.org
Subject: [R] R help

Hello everybody,

I am a student at Unibas and I am trying to run a two sample t-test on a matrix 
which is a
255*13 matrix (see attachment). I want to run the t-test, row-wise, with the
columns 3:7 being a part of the first group and columns
8-12 being a part of the second group.

I tried running something like (temp.matrix being my 255*13
matrix)

t.test(temp.matrix[,3:7],temp.matrix[,8:12],paired=TRUE)

or somthing like

as.numeric(t.test(temp.matrix[,3:7],temp.matrix[,8:12],paired=TRUE)[[1]])
so as to only capture the t-value alone and

and I get a result for the whole matrix instead of a row-wise
result.

I really hope you can help me

Thanks

Vincenzo

__
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] R help

2016-11-17 Thread Vincenzo Prestigiacomo
Hello everybody,

I am a student at Unibas and I am trying to run a two sample t-test on a matrix 
which is a
255*13 matrix (see attachment). I want to run the t-test, row-wise, with the
columns 3:7 being a part of the first group and columns
8-12 being a part of the second group.

I tried running something like (temp.matrix being my 255*13
matrix)

t.test(temp.matrix[,3:7],temp.matrix[,8:12],paired=TRUE)

or somthing like

as.numeric(t.test(temp.matrix[,3:7],temp.matrix[,8:12],paired=TRUE)[[1]])
so as to only capture the t-value alone and

and I get a result for the whole matrix instead of a row-wise
result.

I really hope you can help me

Thanks

Vincenzo
ID  GeneCtrl_1  Ctrl_2  Ctlr_3  Ctrl_4  Ctrl_5  Treat_1 Treat_2 Treat_3 
Treat_4 Treat_5 miRNA
1600012H06Rik   6848806 4.0530974.6824184.992589
5.2445844.7742764.7094814.96773 4.778008
5.0408374.790709miR-200a-3p
1700019N19Rik   6874079 1.5933321.2921031.512545
1.7155671.4763071.3880661.6197591.338901
1.4679291.466803miR-155-5p
1700025G04Rik   6763059 5.3704316.1023044.828034
6.0536435.1830334.4030514.9265124.656887
5.0191054.548957miR-200a-3p
1810011O10Rik   6981091 6.5479376.3470246.441714
6.4179657.06705 5.2885636.07901 5.7530485.442022
5.084001miR-155-5p
2310035C23Rik   6752068 3.8256243.7358073.54262 4.261669
3.7605463.3441923.7242534.2181884.576074
4.083278miR-155-5p
2310057M21Rik   6971606 2.6566563.5118412.687459
3.3711143.2518173.0423733.1974783.104968
3.0435443.163914miR-200a-3p
2510009E07Rik   6844530 5.8003256.42577 5.7668  5.730662
5.7004245.4000555.4611575.3422795.421712
5.526397miR-155-5p
2510009E07Rik   6844530 5.8003256.42577 5.7668  5.730662
5.7004245.4000555.4611575.3422795.421712
5.526397miR-200a-3p
3110002H16Rik   6858895 4.5479344.3388574.307914
4.4408864.32409 4.2611364.2955644.268925
4.3809614.205863miR-155-5p
3830406C13Rik   6816967 4.5456674.5994584.1321034.38886 
4.41772 4.0838433.9970914.4440164.674428
4.479012miR-200a-3p
4921524J17Rik   6983927 5.8212866.0312735.723837
6.1645415.9965355.7629245.26152 5.78468 6.034521
5.654569miR-200a-3p
4930452B06Rik   6822485 2.0797482.0341662.023635
1.7727462.0267041.7146151.8749651.916288
2.02017 1.695061miR-200a-3p
4932411E22Rik   6790674 1.8551681.8130211.805293
1.9419481.8800741.73792 2.0076261.6473541.63846 
1.954501miR-155-5p
4933411K20Rik   6975889 4.9120634.8503174.548501
5.3097045.0524584.5560084.4412035.146813
5.1688245.134651miR-200a-3p
5730596B20Rik   6946238 1.8688831.6084581.839854
1.8423161.9693931.9628211.6295922.093951
1.6433911.757382ÊmiR-122-5p
Acsl4   7019867 7.7084117.5102397.5051047.897287
7.6105797.3854387.6151337.66394 7.403194
7.461257miR-200a-3p
Agtrap  6926872 2.2826342.7755662.33726 2.917997
2.2988242.3116361.7520511.9398632.115742
1.979919miR-155-5p
Ak2 6917270 8.3206678.3638158.3230757.235466
8.5084848.7633138.86618 8.3980028.130665
8.197979miR-200a-3p
Aloxe3  6781988 1.8415441.76754 1.9393531.821221
1.9543361.6739031.8562711.9820491.74662 
1.879063miR-200a-3p
Ankrd13c6902789 4.5007544.6058054.391511
5.2549014.7735274.5101  4.5947594.795172
4.9297444.779805ÊmiR-122-5p
Ano66832923 4.4225195.1811654.1194084.742452
4.6821913.4060013.4506123.7842644.143068
3.494661miR-200a-3p
Ap3d1   6775392 7.1396997.1729137.1479127.587961
7.0669466.8607117.0602787.1431496.91033 
7.095939miR-155-5p
Apbb2   6938797 5.0384125.1881434.7794644.839489
4.8655934.670611

Re: [R] R-help Digest, Vol 164, Issue 4

2016-10-04 Thread Kamil Bartoń

Hi Caitie,
whatever it is you want to achieve, you seem to be doing it in a very complicated way. The code you 
gave appears to be for producing a model selection table, yet you say you're trying to do model 
averaging.


If you want a model selection table, why not use the one `dredge` produces (with evaluate=TRUE, you 
can add R^2 via argument 'extra')?
If you actually mean model averaging, there is `model.avg` that can be used directly on `dredge`'s 
output.


cheers,
k



W dniu 2016-10-04 o 12:00, r-help-requ...@r-project.org pisze:

Message: 10
Date: Mon, 3 Oct 2016 05:47:11 +
From: Caitie Kuempel 
To: "r-help@r-project.org" 
Subject: [R] Error in aictab with CLM model "function not yet defined"
Message-ID: 
Content-Type: text/plain; charset="UTF-8"

Hi R help,

I am trying to do some AIC model averaging on a CLM model in R and keep getting 
the error:

Error in aictab.default(cand.set = Cand.model0, modnames = Modnames0,  :
Function not yet defined for this object class


The MuMIn package says that the functions should work for clm and clmm models 
so I'm not sure if I'm missing something or if there is an extra step?  Any 
help or examples would be appreciated.

My model (m1) works fine- which I fit using the clm() function from the package 
ordinal.  Then I run the following:

dred<-dredge(m1,rank="AICc",trace=TRUE,evaluate=FALSE)
Cand.model0<-list()
r2val<-rep(0,length(dred)) # r-square values
for(i in 1:length(dred))
{
  print(length(dred)-i)
  Cand.model0[[i]]<-clm(as.character(dred[[i]])[2],data=datt2,REML=FALSE)
  #r2val[i]<-summary(Cand.model0[[i]])$r.squared
}

Modnames0 <- paste("mod", 1:length(Cand.model0), sep = " ")
t0<-aictab(cand.set=Cand.model0, modnames=Modnames0, sort = TRUE, second.ord = 
TRUE,nobs = NULL)
Error in aictab.default(cand.set = Cand.model0, modnames = Modnames0,  :
Function not yet defined for this object class

Thanks for your time.

Best,

Caitie

[[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] R Help: System Identification for First order delay and dead time with TF model

2016-09-23 Thread Eduardo M. A. M. Mendes
Hi 

This is a continuous time system.  Are you willing to discretize the model?  

Regards 

Ed

Enviado do meu iPhone

> Em 23 de set de 2016, às 06:15, Yoshikazu Noguchi  
> escreveu:
> 
> Hello,
> 
> 
> 
> May I ask your help?
> 
> 
> 
> I would like to do System Identification using time series data which has
> transport delay. 
> 
> First of all, I would like to identify the following parameters (K, Tau, TD)
> for SISO case in the following Laplace domain equation: 
> 
> K, Tau, TD:   ymodel = (K/(Tau*s +1)) * exp(-TD*s) 
> 
> I have time series data, y (Process output) and U (process input). 
> 
> 
> 
> Object function: Min ( (y-ymodel)^2) 
> 
> 
> 
> I failed to find the right package in R for this issue? Could you please
> tell me which package I should use to solve this issue?
> 
> 
> 
> Thanks. 
> 
> 
> 
> Y. Noguchi
> 
> 
>[[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] R Help: System Identification for First order delay and dead time with TF model

2016-09-23 Thread Yoshikazu Noguchi
Hello,

 

May I ask your help?

 

I would like to do System Identification using time series data which has
transport delay. 

First of all, I would like to identify the following parameters (K, Tau, TD)
for SISO case in the following Laplace domain equation: 

K, Tau, TD:   ymodel = (K/(Tau*s +1)) * exp(-TD*s) 

I have time series data, y (Process output) and U (process input). 

 

Object function: Min ( (y-ymodel)^2) 

 

I failed to find the right package in R for this issue? Could you please
tell me which package I should use to solve this issue?

 

Thanks. 

 

Y. Noguchi


[[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] R help

2016-08-07 Thread Jim Lemon
Hi Vladimir,
This may fix the NA problem:

vdat<-read.table(text="numberoftweet,tweet,locations,badwords
1,My cat is asleep,London,glum
2,My cat is flying,Paris,dashed
3,My cat is dancing,Berlin,mopey
4,My cat is singing,Rome,ill
5,My cat is reading,Budapest,sad
6,My cat is eating,Amsterdam,annoyed
7,My cat is hiding,Copenhagen,crazy
8,My cat is fluffy,Vilnius,terrified
9,My cat is annoyed,Athens,sick
10,My cat is exercising,Ankara,mortified
11,My cat is dreaming,Kracow,irked
12,My cat is mopey,Vienna,uneasy
13,My cat is glum,Brussels,upset
14,My cat is swinging,Madrid,
15,My cat is crazy,Ljubljana,",
sep=",",header=TRUE,stringsAsFactors=FALSE)

vdat$badwords[!nchar(vdat$badwords)]<-NA

badwords<-paste(vdat$badwords[!is.na(vdat$badwords)],collapse="|")

names(unlist(sapply(vdat$tweet,grep,pattern=badwords)))

Jim


On Sun, Aug 7, 2016 at 6:43 PM, Вова Грабарник  wrote:
> Hi Jim!
>
> That is exactly what I mean. Your example does the job I was looking for.
> If I refer to your example, my badwords column is not completed for all
> rows, like yours. For example it has only 10 values, but there are much more
> rows. When I try to introduce NA for blanks and write
> badwords<-paste(vdat$badwords,collapse="|")
> it collapses all values and writes smth like: word|word|NA|NA
> and if I dont introduce NAs when reading data, the outcome is still like:
> word|word|word|word
> and when I try to
> names(unlist(sapply(vdat$tweet,grep,pattern=badwords))) there is a mistake.
> I had this question before but do you know by any chance how to separate
> just those words in a column badwords and not include NA's or blanks.
>
> Thank you,
> Vladimir
>
> 2016-08-07 0:19 GMT+01:00 Jim Lemon :
>>
>> Hi Vladimir,
>> Do you want something like this?
>>
>> vdat<-read.table(text="numberoftweet,tweet,locations,badwords
>> 1,My cat is asleep,London,glum
>> 2,My cat is flying,Paris,dashed
>> 3,My cat is dancing,Berlin,mopey
>> 4,My cat is singing,Rome,ill
>> 5,My cat is reading,Budapest,sad
>> 6,My cat is eating,Amsterdam,annoyed
>> 7,My cat is hiding,Copenhagen,crazy
>> 8,My cat is fluffy,Vilnius,terrified
>> 9,My cat is annoyed,Athens,sick
>> 10,My cat is exercising,Ankara,mortified
>> 11,My cat is dreaming,Kracow,irked
>> 12,My cat is mopey,Vienna,uneasy
>> 13,My cat is glum,Brussels,upset",
>> sep=",",header=TRUE,stringsAsFactors=FALSE)
>>
>> badwords<-paste(vdat$badwords,collapse="|")
>>
>> names(unlist(sapply(vdat$tweet,grep,pattern=badwords)))
>>
>> Jim
>>
>>
>> On Sat, Aug 6, 2016 at 12:07 AM, Вова Грабарник 
>> wrote:
>> > Dear R command,
>> >
>> > I was wondering if I could ask you recommendations on my problem if that
>> > is
>> > fine with you.
>> > Basically, I have a data frame with 5 columns and 10 000 tweets
>> > recorded(rows). Those columns are: numberofatweet(number), tweet (actual
>> > textual tweet), locations(from where tweet sent), badwords(words that
>> > should not be used on twitter, that is just a column irrespective the
>> > number of a tweet and it contains only 80 rows with one word recorded in
>> > one cell.
>> > My question is whether it is possible to select only the rows which
>> > would
>> > contain such tweets, where in column "tweet"(actual text) there was one
>> > of
>> > those words from badwords column present. I tried to use grep and grepl,
>> > but nothing seems to be working.
>> >
>> > Thank you in advance,
>> > Vladimir
>> >
>> > [[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] R help

2016-08-06 Thread Jim Lemon
Hi Vladimir,
Do you want something like this?

vdat<-read.table(text="numberoftweet,tweet,locations,badwords
1,My cat is asleep,London,glum
2,My cat is flying,Paris,dashed
3,My cat is dancing,Berlin,mopey
4,My cat is singing,Rome,ill
5,My cat is reading,Budapest,sad
6,My cat is eating,Amsterdam,annoyed
7,My cat is hiding,Copenhagen,crazy
8,My cat is fluffy,Vilnius,terrified
9,My cat is annoyed,Athens,sick
10,My cat is exercising,Ankara,mortified
11,My cat is dreaming,Kracow,irked
12,My cat is mopey,Vienna,uneasy
13,My cat is glum,Brussels,upset",
sep=",",header=TRUE,stringsAsFactors=FALSE)

badwords<-paste(vdat$badwords,collapse="|")

names(unlist(sapply(vdat$tweet,grep,pattern=badwords)))

Jim


On Sat, Aug 6, 2016 at 12:07 AM, Вова Грабарник  wrote:
> Dear R command,
>
> I was wondering if I could ask you recommendations on my problem if that is
> fine with you.
> Basically, I have a data frame with 5 columns and 10 000 tweets
> recorded(rows). Those columns are: numberofatweet(number), tweet (actual
> textual tweet), locations(from where tweet sent), badwords(words that
> should not be used on twitter, that is just a column irrespective the
> number of a tweet and it contains only 80 rows with one word recorded in
> one cell.
> My question is whether it is possible to select only the rows which would
> contain such tweets, where in column "tweet"(actual text) there was one of
> those words from badwords column present. I tried to use grep and grepl,
> but nothing seems to be working.
>
> Thank you in advance,
> Vladimir
>
> [[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] R help

2016-08-05 Thread Ulrik Stervbo
I'm not quite sure if this is what you are looking for:

example.df <- data.frame(words= c("A T", "Z H", "B E", "C P H"), badwords =
c("A|I|J|H|K|L"))

# Extract the column with bad words
badwords <- example.df$badwords
badwords <- as.character(badwords[1])

# Subset the data.frame
subset(example.df, grepl(badwords, words))

As I understand your email the badwords column contains all bad words in
each cell, so I assume they are separated somehow. In my example I use |
because it used to signify OR in grep. Since all elements of the bad word
column are equal I just get the first element, make sure it is a character,
and use grepl to subset the entire data.frame

HTH
Ulrik

On Fri, 5 Aug 2016 at 17:19  wrote:

> Hello,
>
> Please use ?dput to post a data example. Use something like the
> following, where 'dat' is the name of your data.frame.
>
> dput(head(dat, 30))  # paste the output of this in a mail
>
> Hope this helps,
>
> Rui Barradas
>
>
> Citando Вова Грабарник :
>
> > Dear R command,
> >
> > I was wondering if I could ask you recommendations on my problem if that
> is
> > fine with you.
> > Basically, I have a data frame with 5 columns and 10 000 tweets
> > recorded(rows). Those columns are: numberofatweet(number), tweet (actual
> > textual tweet), locations(from where tweet sent), badwords(words that
> > should not be used on twitter, that is just a column irrespective the
> > number of a tweet and it contains only 80 rows with one word recorded in
> > one cell.
> > My question is whether it is possible to select only the rows which would
> > contain such tweets, where in column "tweet"(actual text) there was one
> of
> > those words from badwords column present. I tried to use grep and grepl,
> > but nothing seems to be working.
> >
> > Thank you in advance,
> > Vladimir
> >
> > [[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.htmland 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.

[[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] R help

2016-08-05 Thread ruipbarradas
Hello,

Please use ?dput to post a data example. Use something like the  
following, where 'dat' is the name of your data.frame.

dput(head(dat, 30))  # paste the output of this in a mail

Hope this helps,

Rui Barradas
 

Citando Вова Грабарник :

> Dear R command,
>
> I was wondering if I could ask you recommendations on my problem if that is
> fine with you.
> Basically, I have a data frame with 5 columns and 10 000 tweets
> recorded(rows). Those columns are: numberofatweet(number), tweet (actual
> textual tweet), locations(from where tweet sent), badwords(words that
> should not be used on twitter, that is just a column irrespective the
> number of a tweet and it contains only 80 rows with one word recorded in
> one cell.
> My question is whether it is possible to select only the rows which would
> contain such tweets, where in column "tweet"(actual text) there was one of
> those words from badwords column present. I tried to use grep and grepl,
> but nothing seems to be working.
>
> Thank you in advance,
> Vladimir
>
>         [[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.htmland 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] R help

2016-08-05 Thread Вова Грабарник
Dear R command,

I was wondering if I could ask you recommendations on my problem if that is
fine with you.
Basically, I have a data frame with 5 columns and 10 000 tweets
recorded(rows). Those columns are: numberofatweet(number), tweet (actual
textual tweet), locations(from where tweet sent), badwords(words that
should not be used on twitter, that is just a column irrespective the
number of a tweet and it contains only 80 rows with one word recorded in
one cell.
My question is whether it is possible to select only the rows which would
contain such tweets, where in column "tweet"(actual text) there was one of
those words from badwords column present. I tried to use grep and grepl,
but nothing seems to be working.

Thank you in advance,
Vladimir

[[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] R help needed

2016-06-23 Thread Marc Schwartz

> On Jun 23, 2016, at 9:50 AM, Sana Fatima  wrote:
> 
> Hello everyone,
> I am trying to create an shiny app that could be used for ~ 700 different
> user names and passwords. Each username and password would lead to a
> different set of data being pulled in, however the tabs and fields with in
> the app will be the same. Just that different username would display
> different data.I have the basic app running but would appreciate help with
> the program for the login/password part.
> 
> I have tried incorporating the example code(
> http://shiny.rstudio.com/articles/permissions.html) to my program ( see
> portion of my code below). However, when I ran the app, it gives me a blank
> screen for this tab. This is because the user = NULL but i don't get an
> option to enter the username and password information. Where and how do we
> get the login form at the beginning of the application? Is there a way to
> have the login in form and the application linked together so that when the
> application is run it automatically takes u to the login page where user
> can enter their info and see the info accordingly. Would really appreciate
> your help on this. Thanks in advance



> -- 
> Syeda Sana Fatima


Hi,

Shiny is a third party application that has its own dedicated support vehicles 
at:

  http://shiny.rstudio.com/help/

You should leverage those resources, as it is off-topic for R-Help.

Regards,

Marc Schwartz

__
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] R help needed

2016-06-23 Thread Sana Fatima
 Hello everyone,
I am trying to create an shiny app that could be used for ~ 700 different
user names and passwords. Each username and password would lead to a
different set of data being pulled in, however the tabs and fields with in
the app will be the same. Just that different username would display
different data.I have the basic app running but would appreciate help with
the program for the login/password part.

I have tried incorporating the example code(
http://shiny.rstudio.com/articles/permissions.html) to my program ( see
portion of my code below). However, when I ran the app, it gives me a blank
screen for this tab. This is because the user = NULL but i don't get an
option to enter the username and password information. Where and how do we
get the login form at the beginning of the application? Is there a way to
have the login in form and the application linked together so that when the
application is run it automatically takes u to the login page where user
can enter their info and see the info accordingly. Would really appreciate
your help on this. Thanks in advance

server <- function(input, output, session) {

user <- reactive({
session$user
})


table <- formattable(tab1, list(
"NumberServed" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$NumberServed_prev,'green','orange')), font.weight = "bold"),
x ~ icontext(ifelse(x < tab1$NumberServed_pr_goal,
"arrow-down",ifelse(x>tab1$NumberServed_pr_goal,'arrow-up','')),x)),
"NumberExited" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$NumberExited_prev,'green','orange')), font.weight = "bold"),
x ~ icontext(ifelse(x < tab1$NumberExited_pr_goal,
"arrow-down",ifelse(x>tab1$NumberExited_pr_goal,'arrow-up','')),x)),

"PercentWithBarriers" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$PercentWithBarriers_prev,'green','orange')), font.weight =
"bold"),
x ~ icontext(ifelse(x < tab1$PercentWithBarriers_pr_goal,
"arrow-down",ifelse(x>tab1$PercentWithBarriers_pr_goal,'arrow-up','')),x)),

"EmploymentQ2" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$EmploymentQ2_prev,'green','orange')), font.weight = "bold"),
x ~ icontext(ifelse(x < tab1$EmploymentQ2_pr_goal,
"arrow-down",ifelse(x>tab1$EmploymentQ2_pr_goal,'arrow-up','')),x)),

"EmploymentQ4" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$EmploymentQ4_prev,'green','orange')), font.weight = "bold"),
x ~ icontext(ifelse(x < tab1$EmploymentQ4_pr_goal,
"arrow-down",ifelse(x>tab1$EmploymentQ4_pr_goal,'arrow-up','')),x)),
"WagesQ2" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$WagesQ2_prev,'green','orange')), font.weight = "bold"),
x ~ icontext(ifelse(x < tab1$WagesQ2_pr_goal,
"arrow-down",ifelse(x>tab1$WagesQ2_pr_goal,'arrow-up','')),x)),
"CredentialRate" = formatter(
"span",
style = x ~ style(color = ifelse(xtab1$CredentialRate_prev,'green','orange')), font.weight = "bold"),
x ~ icontext(ifelse(x < tab1$CredentialRate_pr_goal,
"arrow-down",ifelse(x>tab1$CredentialRate_pr_goal,'arrow-up','')),x))

))

table$WagesQ2<-currency(table$WagesQ2,symbol = "$", digits = 0)
table$NumberServed<-accounting(table$NumberServed,digits=0)
table$NumberExited<-accounting(table$NumberExited,digits=0)
table$PercentWithBarriers<-percent(table$PercentWithBarriers,digits=2)
table$EmploymentQ2<-percent(table$EmploymentQ2,digits=2)
table$EmploymentQ4<-percent(table$EmploymentQ4,digits=2)
table$CredentialRate<-percent(table$CredentialRate,digits=2)
table$NumberServed_prev=NULL
table$NumberExited_prev=NULL
table$PercentWithBarriers_prev=NULL
table$EmploymentQ2_prev=NULL
table$EmploymentQ4_prev=NULL
table$WagesQ2_prev=NULL
table$CredentialRate_prev=NULL
table$NumberServed_pr_goal=NULL
table$NumberExited_pr_goal=NULL
table$PercentWithBarriers_pr_goal=NULL
table$EmploymentQ2_pr_goal=NULL
table$EmploymentQ4_pr_goal=NULL
table$WagesQ2_pr_goal=NULL
table$CredentialRate_pr_goal=NULL

myData <- reactive({
if (isManager()){
# If a manager, show everything.
return(table)
} else{
# If a regular salesperson, only show their own sales.
return(table[table$dist == user(),])
}
})


isManager <- reactive({
if (user() == "manager"){
return(TRUE)
} else{
return(FALSE)
}
})

output$results1 <- renderFormattable({
if(is.null(user())){return()}
myData()
})
)

}

-- 
Syeda Sana Fatima

[[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] R help contingency table

2016-06-20 Thread Jim Lemon
Hi Lucie,
You can visualize this using the sizetree function (plotrix). You
supply a data frame of the individual choice sequences.

# form a data frame of "random" choices
coltrans<-data.frame(choice1=sample(c("High","Medium","Low"),100,TRUE),
 choice2=sample(c("High","Medium","Low"),100,TRUE))
sizetree(coltrans,main="Random color choice transitions")
# test the two way table of transitions for independence
chisq.test(table(coltrans))
# now try a data frame of "habitual" choices
coltrans2<-data.frame(choice1=rep(c("High","Medium","Low"),c(33,33,34)),
 choice2=c(sample(c("High","Medium","Low"),33,TRUE,prob=c(0.6,0.2,0.2)),
 sample(c("High","Medium","Low"),33,TRUE,prob=c(0.2,0.6,0.2)),
 sample(c("High","Medium","Low"),34,TRUE,prob=c(0.2,0.2,0.6
sizetree(coltrans2,main="Habitual color choice transitions")
# test the table again
chisq.test(table(coltrans2))

This may be what you want.

Jim


On Mon, Jun 20, 2016 at 12:09 PM, Lucie Dupond  wrote:
> Hello,
> I'm sorry if my question is really basic, but I'm having some troubles with 
> the statistics for my thesis, and especially the khi square test and 
> contingency tables.
>
> For what I understood, there are two "kinds" of khisquare test, that are 
> quite similar :
> - Homogeneity, when we have one variable and we want to compare it with a 
> theorical distribution
> - Independence test, when we have 2 variable and we want to see if they are 
> linked
>
> -- -
>
> I'm working on color transitions, with 3 possible factors : « High » , « 
> Medium » and « Low »
> I want to know if an individual will go preferably from a color « High » to 
> another color « High », more than from a color « High » to a color « Medium » 
> (for example)
>
> I have this table :
>
> trans1<-c(51,17,27,12,21,13,37,15,60)
> transitions1<-matrix(trans1, nrow=3, ncol=3, byrow=T)
> rownames(transitions1) <- c("High"," Medium", "Low")
> colnames(transitions1) <- c("High"," Medium", "Low")
>
> The first colomn is showing the first color, and the second is showing the 
> second color of the transition
>
> It looks like I'm in the case of an Independence test, in order to see if the 
> variable "second color" is linked to the "first color".
>
> So I'm making the test :
>
> chisq.test(transitions1)
>
>
> (If I understood well, the test on the matrix is the independence  test, and 
> the test on the vector trans1 is the homogeneity test ?)
>
> The result is significatif, it means that some transitions are prefered.
>
> My problem is that I have other transition tables like this one (with other 
> individuals or other conditions)
> For example, I also have this one :
>
>
> trans2<-c(13,7,8,5,16,18,11,8,17)
> transitions2<-matrix(trans2, nrow=3, ncol=3, byrow=T)
> rownames(transitions2) <- c("High","Low", "Stick")
> colnames(transitions2) <- c("High","Low", "Stick")
>
> I want to know if the "prefered" transitions in the table 1 are the same in 
> the table 2.
> But if I try a khisquare test on those two matrix, R only takes the first one.
>
> How can I compare those tables
> Maybe with another test ?
>
> Thanks in advance !
>
> Kind regards
>
> Lucie S.
>
> [[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] R help contingency table

2016-06-20 Thread Lucie Dupond
Thank you for your answer !

I'm sorry, i've made a mistake in the second matrix, they should have the same 
row/column labels, I just used another label vector by mistake.

My supervisor doesn't have a solution for this, and neither have every one I 
asked around me.

Thanks for your solution, but I'm afraid that I will loose the interaction 
between the variable "first color" and "second color" if I convert the matrix 
into a vector.


Thank you for your help




De : David L Carlson <dcarl...@tamu.edu>
Envoy� : lundi 20 juin 2016 21:06
� : Lucie Dupond; r-help@r-project.org
Objet : RE: R help contingency table

You should consult with your adviser or someone at your institution who has 
more experience in statistical analysis than you do. You want to compare the 
matrices, but the row/column labels are different so you may be comparing 
completely different categories.

Technically, you need to convert the two matrices into a single matrix. You can 
do that by converting each into a vector with the c() function. BUT this will 
compare High with High, Medium with Low, and Low with Stick which seems 
inadvisable.

> rbind(c(transitions1), c(transitions2))
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,]   51   12   37   17   21   15   27   13   60
[2,]   135   117   1688   18   17
> chisq.test(rbind(c(transitions1), c(transitions2)))

Pearson's Chi-squared test

data:  rbind(c(transitions1), c(transitions2))
X-squared = 22.411, df = 8, p-value = 0.004208

Warning message:
In chisq.test(rbind(c(transitions1), c(transitions2))) :
  Chi-squared approximation may be incorrect

-
David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77840-4352

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Lucie Dupond
Sent: Sunday, June 19, 2016 9:10 PM
To: r-help@r-project.org
Subject: [R] R help contingency table

Hello,
I'm sorry if my question is really basic, but I'm having some troubles with the 
statistics for my thesis, and especially the khi square test and contingency 
tables.

For what I understood, there are two "kinds" of khisquare test, that are quite 
similar :
- Homogeneity, when we have one variable and we want to compare it with a 
theorical distribution
- Independence test, when we have 2 variable and we want to see if they are 
linked

-- -

I'm working on color transitions, with 3 possible factors : ? High ? , ? Medium 
? and ? Low ?
I want to know if an individual will go preferably from a color ? High ? to 
another color ? High ?, more than from a color ? High ? to a color ? Medium ? 
(for example)

I have this table :

trans1<-c(51,17,27,12,21,13,37,15,60)
transitions1<-matrix(trans1, nrow=3, ncol=3, byrow=T)
rownames(transitions1) <- c("High"," Medium", "Low")
colnames(transitions1) <- c("High"," Medium", "Low")

The first colomn is showing the first color, and the second is showing the 
second color of the transition

It looks like I'm in the case of an Independence test, in order to see if the 
variable "second color" is linked to the "first color".

So I'm making the test :

chisq.test(transitions1)


(If I understood well, the test on the matrix is the independence  test, and 
the test on the vector trans1 is the homogeneity test ?)

The result is significatif, it means that some transitions are prefered.

My problem is that I have other transition tables like this one (with other 
individuals or other conditions)
For example, I also have this one :


trans2<-c(13,7,8,5,16,18,11,8,17)
transitions2<-matrix(trans2, nrow=3, ncol=3, byrow=T)
rownames(transitions2) <- c("High","Low", "Stick")
colnames(transitions2) <- c("High","Low", "Stick")

I want to know if the "prefered" transitions in the table 1 are the same in the 
table 2.
But if I try a khisquare test on those two matrix, R only takes the first one.

How can I compare those tables
Maybe with another test ?

Thanks in advance !

Kind regards

Lucie S.

[[alternative HTML version deleted]]


[[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] R help contingency table

2016-06-20 Thread David L Carlson
You should consult with your adviser or someone at your institution who has 
more experience in statistical analysis than you do. You want to compare the 
matrices, but the row/column labels are different so you may be comparing 
completely different categories.

Technically, you need to convert the two matrices into a single matrix. You can 
do that by converting each into a vector with the c() function. BUT this will 
compare High with High, Medium with Low, and Low with Stick which seems 
inadvisable. 

> rbind(c(transitions1), c(transitions2))
 [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
[1,]   51   12   37   17   21   15   27   13   60
[2,]   135   117   1688   18   17
> chisq.test(rbind(c(transitions1), c(transitions2)))

Pearson's Chi-squared test

data:  rbind(c(transitions1), c(transitions2))
X-squared = 22.411, df = 8, p-value = 0.004208

Warning message:
In chisq.test(rbind(c(transitions1), c(transitions2))) :
  Chi-squared approximation may be incorrect

-
David L Carlson
Department of Anthropology
Texas A University
College Station, TX 77840-4352

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Lucie Dupond
Sent: Sunday, June 19, 2016 9:10 PM
To: r-help@r-project.org
Subject: [R] R help contingency table

Hello,
I'm sorry if my question is really basic, but I'm having some troubles with the 
statistics for my thesis, and especially the khi square test and contingency 
tables.

For what I understood, there are two "kinds" of khisquare test, that are quite 
similar :
- Homogeneity, when we have one variable and we want to compare it with a 
theorical distribution
- Independence test, when we have 2 variable and we want to see if they are 
linked

-- -

I'm working on color transitions, with 3 possible factors : � High � , � Medium 
� and � Low �
I want to know if an individual will go preferably from a color � High � to 
another color � High �, more than from a color � High � to a color � Medium � 
(for example)

I have this table :

trans1<-c(51,17,27,12,21,13,37,15,60)
transitions1<-matrix(trans1, nrow=3, ncol=3, byrow=T)
rownames(transitions1) <- c("High"," Medium", "Low")
colnames(transitions1) <- c("High"," Medium", "Low")

The first colomn is showing the first color, and the second is showing the 
second color of the transition

It looks like I'm in the case of an Independence test, in order to see if the 
variable "second color" is linked to the "first color".

So I'm making the test :

chisq.test(transitions1)


(If I understood well, the test on the matrix is the independence  test, and 
the test on the vector trans1 is the homogeneity test ?)

The result is significatif, it means that some transitions are prefered.

My problem is that I have other transition tables like this one (with other 
individuals or other conditions)
For example, I also have this one :


trans2<-c(13,7,8,5,16,18,11,8,17)
transitions2<-matrix(trans2, nrow=3, ncol=3, byrow=T)
rownames(transitions2) <- c("High","Low", "Stick")
colnames(transitions2) <- c("High","Low", "Stick")

I want to know if the "prefered" transitions in the table 1 are the same in the 
table 2.
But if I try a khisquare test on those two matrix, R only takes the first one.

How can I compare those tables
Maybe with another test ?

Thanks in advance !

Kind regards

Lucie S.

[[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] R help contingency table

2016-06-20 Thread S Ellison
> The first colomn is showing the first color, and the second is showing the
> second color of the transition
Are you sure?
transitions1 is a 3x3 matrix; it has three columns, not two. 

Could it be that the columns are colour 2 following initial condition given by 
row, or vice versa?

[not that that will help _me_ answer your question, but it may help someone 
else].

S Ellison



***
This email and any attachments are confidential. Any use, copying or
disclosure other than by the intended recipient is unauthorised. If 
you have received this message in error, please notify the sender 
immediately via +44(0)20 8943 7000 or notify postmas...@lgcgroup.com 
and delete this message and any copies from your computer and network. 
LGC Limited. Registered in England 2991879. 
Registered office: Queens Road, Teddington, Middlesex, TW11 0LY, UK
__
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] R help contingency table

2016-06-20 Thread Lucie Dupond
Hello,
I'm sorry if my question is really basic, but I'm having some troubles with the 
statistics for my thesis, and especially the khi square test and contingency 
tables.

For what I understood, there are two "kinds" of khisquare test, that are quite 
similar :
- Homogeneity, when we have one variable and we want to compare it with a 
theorical distribution
- Independence test, when we have 2 variable and we want to see if they are 
linked

-- -

I'm working on color transitions, with 3 possible factors : � High � , � Medium 
� and � Low �
I want to know if an individual will go preferably from a color � High � to 
another color � High �, more than from a color � High � to a color � Medium � 
(for example)

I have this table :

trans1<-c(51,17,27,12,21,13,37,15,60)
transitions1<-matrix(trans1, nrow=3, ncol=3, byrow=T)
rownames(transitions1) <- c("High"," Medium", "Low")
colnames(transitions1) <- c("High"," Medium", "Low")

The first colomn is showing the first color, and the second is showing the 
second color of the transition

It looks like I'm in the case of an Independence test, in order to see if the 
variable "second color" is linked to the "first color".

So I'm making the test :

chisq.test(transitions1)


(If I understood well, the test on the matrix is the independence  test, and 
the test on the vector trans1 is the homogeneity test ?)

The result is significatif, it means that some transitions are prefered.

My problem is that I have other transition tables like this one (with other 
individuals or other conditions)
For example, I also have this one :


trans2<-c(13,7,8,5,16,18,11,8,17)
transitions2<-matrix(trans2, nrow=3, ncol=3, byrow=T)
rownames(transitions2) <- c("High","Low", "Stick")
colnames(transitions2) <- c("High","Low", "Stick")

I want to know if the "prefered" transitions in the table 1 are the same in the 
table 2.
But if I try a khisquare test on those two matrix, R only takes the first one.

How can I compare those tables
Maybe with another test ?

Thanks in advance !

Kind regards

Lucie S.

[[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] R-help Digest, Vol 160, Issue 8

2016-06-08 Thread David Howell
I am having trouble running aplpack on my Mac. It will run on my PC, but 
the Mac gives an error message. Below is the result that I obtained.  It 
seems to install fine--see below--but I can't load the library.



> install.packages("aplpack")
trying URL 
'http://cran.rstudio.com/bin/macosx/contrib/3.1/aplpack_1.3.0.tgz'

Content type 'application/x-gzip' length 3157548 bytes (3.0 Mb)
opened URL
==
downloaded 3.0 Mb


The downloaded binary packages are in
/var/folders/6m/t4wvnh9x39500z_rh3p5jlk0gp/T//Rtmp26I5Ej/downloaded_packages

> library(aplpack)
Loading required package: tcltk
xcrun: error: invalid active developer path 
(/Library/Developer/CommandLineTools), missing xcrun at: 
/Library/Developer/CommandLineTools/usr/bin/xcrun


It looks as if it has a problem with tcltk. I can install tcltk2, but 
when I try to install tcltk it tells me "package not found.) Is that the 
problem that aplpack is having when it tries to load the library?


Any suggestions?

__
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] R help- fit distribution "fitdistr"

2016-05-26 Thread Bert Gunter
Inline.

On Thursday, May 26, 2016, Jessica Wang <25695...@qq.com> wrote:

> Hello, I just start using R. I want to use “fitdistr” to fit distribution
> of the data. Then how can I verify if the data really fit the distribution?
> Thanks [data is attached]
>
> You can't. There are many ways to judge/quantify the **quality** of the
fit, but your question indicates a complete misunderstanding of basic
statistical concepts (imo of course) . I suggest you spend time with a
local statistical resource, take some courses, do some reading, etc.

Cheers,
Bert


> res<-fitdistr(data$Report.delay, "Poisson")
>
> h<-hist(data$Report.delay)
>
> xfit<-floor(seq(0, 250, 50))
>
> yfit<-dpois(xfit,res[[1]][1])
>
> yfit<-yfit*diff(h$mids[1:2])*length(xfit)
>
> lines(xfit, yfit, col="blue", lwd=2)
> __
> 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.



-- 
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 )

[[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] R help- fit distribution "fitdistr"

2016-05-25 Thread Jessica Wang
Hello, I just start using R. I want to use ??fitdistr?? to fit distribution of 
the data. Then how can I verify if the data really fit the distribution? Thanks 
[data is attached]
 
res<-fitdistr(data$Report.delay, "Poisson") 
 
h<-hist(data$Report.delay) 
 
xfit<-floor(seq(0, 250, 50)) 
 
yfit<-dpois(xfit,res[[1]][1]) 
 
yfit<-yfit*diff(h$mids[1:2])*length(xfit) 
 
lines(xfit, yfit, col="blue", lwd=2)
__
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] R help - Web Scraping of Google News using R

2016-05-24 Thread boB Rudis
What you are doing wrong is both trying yourself and asking others to
violate Google's Terms of Service and (amongst other things) get your
IP banned along with anyone who aids you (or worse). Please don't.
Just because something can be done does not mean it should be done.

On Tue, May 24, 2016 at 11:21 AM, Kumar Gauraw  wrote:
> Hello Experts,
>
> I am trying to scrap data from Google news for a particular topic using XML
> and Curl Package of R. I am able to extract the summary part of the news
> through *XPath* but in a similar way, I am trying to extract title and
> Links of news which is not working.Please note this work is just for POC
> purpose and I would make maximum of 500 requests per day so that Google TOS
> remains intact.
>
>
> library(XML)
>
> library(RCurl)
>
> getGoogleURL <- function(search.term, domain = '.co.in', quotes=TRUE)
>
> {
>
>   search.term <- gsub(' ', '%20', search.term)
>
>   if(quotes) search.term <- paste('%22', search.term, '%22', sep='')
>
>   getGoogleURL <- paste('http://www.google', domain,
> '/search?hl=en=in=nws=0=',search.term, sep='')
>
> }
>
> search.term <- "IPL 2016"
>
> quotes <- "FALSE"
>
> search.url <- getGoogleURL(search.term=search.term, quotes=quotes)
>
> getGoogleSummary <- function(google.url) {
>
>   doc <- getURL(google.url, httpheader = c("User-Agent" = "R(2.10.0)"))
>
>   html <- htmlTreeParse(doc, useInternalNodes = TRUE, error=function(...){})
>
>   nodes <- getNodeSet(html, "//div[@class='st']")
>
>   return(sapply(nodes, function(x) x <- xmlValue(x)))
>
> }
>
> *#Problem is with this part of code*
>
> getGoogleTitle <- function(google.url) {
>
>   doc <- getURL(google.url, httpheader = c("User-Agent" = "R(2.10.0)"))
>
>   html <- htmlTreeParse(doc, useInternalNodes = TRUE, error=function(...){})
>
>  * nodes <- getNodeSet(html, "//a[@class='l _HId']")*
>
>   return(sapply(nodes, function(x) x <- xmlValue(x)))
>
> }
>
> Kindly help me to understand where I am getting wrong so that I can rectify
> the code and get the correct output.
>
> Thank you.
>
> With Regards,
> Kumar Gauraw
>
> [[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] R help - Web Scraping of Google News using R

2016-05-24 Thread Kumar Gauraw
Hello Experts,

I am trying to scrap data from Google news for a particular topic using XML
and Curl Package of R. I am able to extract the summary part of the news
through *XPath* but in a similar way, I am trying to extract title and
Links of news which is not working.Please note this work is just for POC
purpose and I would make maximum of 500 requests per day so that Google TOS
remains intact.


library(XML)

library(RCurl)

getGoogleURL <- function(search.term, domain = '.co.in', quotes=TRUE)

{

  search.term <- gsub(' ', '%20', search.term)

  if(quotes) search.term <- paste('%22', search.term, '%22', sep='')

  getGoogleURL <- paste('http://www.google', domain,
'/search?hl=en=in=nws=0=',search.term, sep='')

}

search.term <- "IPL 2016"

quotes <- "FALSE"

search.url <- getGoogleURL(search.term=search.term, quotes=quotes)

getGoogleSummary <- function(google.url) {

  doc <- getURL(google.url, httpheader = c("User-Agent" = "R(2.10.0)"))

  html <- htmlTreeParse(doc, useInternalNodes = TRUE, error=function(...){})

  nodes <- getNodeSet(html, "//div[@class='st']")

  return(sapply(nodes, function(x) x <- xmlValue(x)))

}

*#Problem is with this part of code*

getGoogleTitle <- function(google.url) {

  doc <- getURL(google.url, httpheader = c("User-Agent" = "R(2.10.0)"))

  html <- htmlTreeParse(doc, useInternalNodes = TRUE, error=function(...){})

 * nodes <- getNodeSet(html, "//a[@class='l _HId']")*

  return(sapply(nodes, function(x) x <- xmlValue(x)))

}

Kindly help me to understand where I am getting wrong so that I can rectify
the code and get the correct output.

Thank you.

With Regards,
Kumar Gauraw

[[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] [R ] help in if else in connect the simulation in normal and gamma distribution.

2016-04-07 Thread tan sj
I am new in R. I have to conduct simulation study on the robustness of 2 sample 
tests on several combination of factors (sample sizes ,variance and 
distribution).


I have been completed write a code in normal distribution, and now i wish to 
add if -else in the code so that the code can simulated result for gamma 
distribution also.

But i am stucking again as how can i connect both of them by using if -else?

Can anyone just give me a brief idea on it ?


(i am sorry if this is no related )This is additional question,for gamma, since 
the mean and variance are dependent on each other, so as i assume the null 
hypothesis is TRUE, then do I need to minus the sample mean and add the overall 
mean as well ?in order to make sure that the null hypothesis is TRUE...


Thanks in advance and i am sorry if this is a silly question 


[[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] R-help Digest, Vol 157, Issue 25

2016-03-24 Thread Boris Steipe
If the number of values are always the same, the proposed strategies will work 
for you. If they are not the same, you need a completely different approach. 
Most importantly, you will need to figure out which columns correspond to 
missing values. Is it always the last ones that are dropped? If not, then you 
have a problem because the values will be misaligned and you can't fix that 
unless you know what values to expect.

Proper imputation depends on the semantics of the data, there are no (sensible) 
general rules. You need to consider whether the values are missing at random, 
or whether there is a higher probability for smaller values to be missing etc. 
That will determine whether you should be imputing from row-averages, column 
averages, averages over a defined subset - or perhaps better than averages: 
replacing with random observed values. This _really_ depends on the data and 
the objectives of your analysis.

B.


On Mar 24, 2016, at 7:16 AM, Burhan ul haq  wrote:

> Thanks to Boris Steipe, Jim Lemon and  Ivan Calandra for replying.
> 
> I messed up while copying, there are equal number of values for each
> country.
> 
> @ Ivan,
> 
> In case there were different number of values, and we wanted to fill in with
> 1) NA, or
> 2)  "average of the rest of values"
> 
> in the missing values, how would we "impute" such data.
> 
> 
> Thanks again /
> 
>   [[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] R-help Digest, Vol 157, Issue 25

2016-03-24 Thread Burhan ul haq
Thanks to Boris Steipe, Jim Lemon and  Ivan Calandra for replying.

I messed up while copying, there are equal number of values for each
country.

@ Ivan,

In case there were different number of values, and we wanted to fill in with
1) NA, or
2)  "average of the rest of values"

in the missing values, how would we "impute" such data.


Thanks again /

[[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] R help

2016-01-31 Thread കുഞ്ഞായി kunjaai
Hai Anukriti Gupta,

While sending mail to mailing list, please change the subject  from "R
Help" to more specific one..(eg: R Regression error..)  Because we all can
refer your mail and the solution in future  by checking the mail subject




On Sat, Jan 30, 2016 at 9:55 PM, Boris Steipe 
 wrote:

> I think the error message is pretty clear. Your calculations are
> attempting to allocate more memory than you have available. As to what is
> causing your code to do this, only someone familiar with your code could
> possibly tell.
>
> B.
> (Read the posting guide, please - and don't post in HTML :-)
>
>
> On Jan 30, 2016, at 1:44 AM, Anukriti Gupta 
> wrote:
>
> > Hi
> >
> > I am running a ordinal logistic regression, however its giving me an
> error
> > like
> >
> > Error: cannot allocate vector of size 58.8 GbIn addition: Warning
> > messages:1: In rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)2: In
> > rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)3: In
> > rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)4: In
> > rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)
> >
> >
> > I am using a 64 bit laptop. I ma not sure what is causing this kind of
> issue
> >
> > Regards
> >
> > Anukriti Gupta
> > Analyst (Financial Crime Compliance), HSBC
> > M: +91 88820 45065
> > LinkedIn 
> >
> >   [[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.
>



-- 
DILEEPKUMAR. R
J R F, IIT DELHI

On Sat, Jan 30, 2016 at 9:55 PM, Boris Steipe 
wrote:

> I think the error message is pretty clear. Your calculations are
> attempting to allocate more memory than you have available. As to what is
> causing your code to do this, only someone familiar with your code could
> possibly tell.
>
> B.
> (Read the posting guide, please - and don't post in HTML :-)
>
>
> On Jan 30, 2016, at 1:44 AM, Anukriti Gupta 
> wrote:
>
> > Hi
> >
> > I am running a ordinal logistic regression, however its giving me an
> error
> > like
> >
> > Error: cannot allocate vector of size 58.8 GbIn addition: Warning
> > messages:1: In rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)2: In
> > rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)3: In
> > rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)4: In
> > rep.int(c(1, numeric(n)), n - 1L) :
> >  Reached total allocation of 8057Mb: see help(memory.size)
> >
> >
> > I am using a 64 bit laptop. I ma not sure what is causing this kind of
> issue
> >
> > Regards
> >
> > Anukriti Gupta
> > Analyst (Financial Crime Compliance), HSBC
> > M: +91 88820 45065
> > LinkedIn 
> >
> >   [[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.
>



-- 
DILEEPKUMAR. R
J R F, IIT DELHI

[[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] R help

2016-01-30 Thread Boris Steipe
I think the error message is pretty clear. Your calculations are attempting to 
allocate more memory than you have available. As to what is causing your code 
to do this, only someone familiar with your code could possibly tell.

B.
(Read the posting guide, please - and don't post in HTML :-)


On Jan 30, 2016, at 1:44 AM, Anukriti Gupta  wrote:

> Hi
> 
> I am running a ordinal logistic regression, however its giving me an error
> like
> 
> Error: cannot allocate vector of size 58.8 GbIn addition: Warning
> messages:1: In rep.int(c(1, numeric(n)), n - 1L) :
>  Reached total allocation of 8057Mb: see help(memory.size)2: In
> rep.int(c(1, numeric(n)), n - 1L) :
>  Reached total allocation of 8057Mb: see help(memory.size)3: In
> rep.int(c(1, numeric(n)), n - 1L) :
>  Reached total allocation of 8057Mb: see help(memory.size)4: In
> rep.int(c(1, numeric(n)), n - 1L) :
>  Reached total allocation of 8057Mb: see help(memory.size)
> 
> 
> I am using a 64 bit laptop. I ma not sure what is causing this kind of issue
> 
> Regards
> 
> Anukriti Gupta
> Analyst (Financial Crime Compliance), HSBC
> M: +91 88820 45065
> LinkedIn 
> 
>   [[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] R help

2016-01-30 Thread Anukriti Gupta
Hi

I am running a ordinal logistic regression, however its giving me an error
like

Error: cannot allocate vector of size 58.8 GbIn addition: Warning
messages:1: In rep.int(c(1, numeric(n)), n - 1L) :
  Reached total allocation of 8057Mb: see help(memory.size)2: In
rep.int(c(1, numeric(n)), n - 1L) :
  Reached total allocation of 8057Mb: see help(memory.size)3: In
rep.int(c(1, numeric(n)), n - 1L) :
  Reached total allocation of 8057Mb: see help(memory.size)4: In
rep.int(c(1, numeric(n)), n - 1L) :
  Reached total allocation of 8057Mb: see help(memory.size)


I am using a 64 bit laptop. I ma not sure what is causing this kind of issue

Regards

Anukriti Gupta
Analyst (Financial Crime Compliance), HSBC
M: +91 88820 45065
LinkedIn 

[[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] R-help with markovchain package and sensitivity analysis

2016-01-27 Thread Kristin Bornstein
Hi - I'm currently trying to work with a markov chain transition matrix
developed using the markovchain package (it's a 42x42 matrix model).  I've
got the matrix up and running smoothly with no problems.
However, I'm trying to run some sensitivity analyses and distribution
analyses on the model, and I'm having some trouble.  I thought that using
latin hypercube sampling (package 'lhs') and/or partial rank correlation
coefficients (package 'sensitivity', PRCC) would be a good route to go, but
I'm having trouble implementing them with the markov chain I already have
programmed.
Does anyone have any experience running these kinds of analyses and have
any advice?  Specifically how to implement them on a markov model?

Thanks in advance for any help.

[[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] R-help mailing list activity / R-not-help?

2016-01-26 Thread Duncan Murdoch

On 26/01/2016 6:30 AM, S Ellison wrote:

Yet, the trend I've seen is one of increasing **R-not-help**, in that there are
many posts, often by new R users who get replies that not infrequently range
from just mildly off-putting to actively hostile:


Slightly surprised that in a debate postulated on increasing 'meanness', no-one 
has yet pointed to Trey Causey's analysis of R-help's alleged meanness at

http://badhessian.org/2013/04/has-r-help-gotten-meaner-over-time-and-what-does-mancur-olson-have-to-say-about-it/

Up to 2013, it was apparently getting _less_ 'mean', not more.


I don't remember reading that article when it first appeared.  It's 
interesting, and mostly well done.  I'd only argue about one conclusion:


He attributes the increase of his category 2 (not a response) to 
dominance near the end of the period as due to a lot of questions going 
unanswered, but gives no apparent evidence for that.  I think anyone who 
has participated in this group for a long time would recognize that very 
few questions go unanswered; only the ones that are so badly posed that 
nobody can figure out what to say.


What is far more common is that discussion on threads goes off on a 
tangent that has nothing to do with questions or answers.  There are 
also threads like this one that contain no questions or answers, and are 
just full of hot air.


Thanks for posting the link.

Duncan Murdoch

__
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] R-help mailing list activity / R-not-help?

2016-01-26 Thread S Ellison
> Yet, the trend I've seen is one of increasing **R-not-help**, in that there 
> are
> many posts, often by new R users who get replies that not infrequently range
> from just mildly off-putting to actively hostile:

Slightly surprised that in a debate postulated on increasing 'meanness', no-one 
has yet pointed to Trey Causey's analysis of R-help's alleged meanness at 

http://badhessian.org/2013/04/has-r-help-gotten-meaner-over-time-and-what-does-mancur-olson-have-to-say-about-it/

Up to 2013, it was apparently getting _less_ 'mean', not more.


S Ellison




***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Hasan Diwan
There exists a fine line between being unintentionally rude, but helpful
and purposely putting someone down. -- H

On 25 January 2016 at 12:07, Duncan Murdoch 
wrote:

> On 25/01/2016 2:45 PM, Oliver Keyes wrote:
>
>> I disagree, and would argue that fails to take a systemic view of this
>> kind of behaviour.
>>
>> If individual commentators are acerbic and are only privately
>> reprimanded, from the perspective of everyone else it looks like the
>> acerbic reply was A-OK. Someone said something unnecessarily hostile
>> and the response was...nada. That creates an environment where there
>> are no clear examples of what crosses a line and no clear expectation
>> that moderation is even a thing that happens. Indeed, I was shocked to
>> discover this list _was_ moderated precisely because all I see is
>> people being mean and nothing much else happening.
>>
>
> Why would you bother to read it if that's all you see?  I think there are
> examples of posts here which are not at all helpful, and others which are
> rude, but the majority are actually helpful (even some of the rude ones).
>
> Duncan Murdoch
>
>
> __
> 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.
>



-- 
OpenPGP: https://hasan.d8u.us/gpg.key
Sent from my mobile device
Envoyé de mon portable

[[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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Duncan Murdoch

On 25/01/2016 2:45 PM, Oliver Keyes wrote:

I disagree, and would argue that fails to take a systemic view of this
kind of behaviour.

If individual commentators are acerbic and are only privately
reprimanded, from the perspective of everyone else it looks like the
acerbic reply was A-OK. Someone said something unnecessarily hostile
and the response was...nada. That creates an environment where there
are no clear examples of what crosses a line and no clear expectation
that moderation is even a thing that happens. Indeed, I was shocked to
discover this list _was_ moderated precisely because all I see is
people being mean and nothing much else happening.


Why would you bother to read it if that's all you see?  I think there 
are examples of posts here which are not at all helpful, and others 
which are rude, but the majority are actually helpful (even some of the 
rude ones).


Duncan Murdoch

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Fowler, Mark
Two concerns with implementing this philosophy.


1.   Determining whether a question is indeed seeking an answer to a 
homework exercise. Certainly if I think a question is short-cutting a basic 
homework task I ignore it. But I don't waste an email berating the alleged 
student.

2.   The validity of the barrier. At what point (maybe graduate levels? Nth 
year?) do we regard questions inspired by an educational system to be 
appropriate? Academia was still using mainframes when I graduated so I don't 
have much notion of expectations today.


I'm just musing that we might be farther ahead simply opting for no response 
than adding another email to the queue. It also gets around needing to feel I 
know the answers to 1 and 2.

From: John Sorkin [mailto:jsor...@grecc.umaryland.edu]
Sent: January 25, 2016 1:36 PM
To: ted.hard...@wlandres.net
Cc: Fowler, Mark; dupo...@nancy.inra.fr; r-help@r-project.org; frien...@yorku.ca
Subject: Re: [R] R-help mailing list activity / R-not-help?

When we read acerbic replies we should remind the poster to reply in a more 
moderate tone. On the other hand  noting that the list is not intended to be a 
source of answers to home work questions is 100% appropriate. This philosophy 
is intended both to keep the list from being flooded with questions and to make 
sure that no student has an unfair advantage.
John


John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics

University of Maryland School of Medicine Division of Gerontology and Geriatric 
Medicine

Baltimore VA Medical Center

10 North Greene Street

GRECC (BT/18/GR)

Baltimore, MD 21201-1524

(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to 
faxing)

On Jan 25, 2016, at 12:17 PM, Ted Harding 
<ted.hard...@wlandres.net<mailto:ted.hard...@wlandres.net>> wrote:
My feelings exactly! (And since quite some time ago).
Ted.

On 25-Jan-2016 12:23:16 Fowler, Mark wrote:

I'm glad to see the issue of negative feedback addressed. I can especially
relate to the 'cringe' feeling when reading some authoritarian backhand to a
new user. We do see a number of obviously inappropriate or overly lazy
postings, but I encounter far more postings where I don't feel competent to
judge their merit. It might be better to simply disregard a posting one does
not like for some reason. It might also be worthwhile to actively counter
negative feedback when we experience that 'cringing' moment. I'm not thinking
to foster contention, but simply to provide some tangible reassurance to new
users, and not just the ones invoking the negative feedback, that a
particular respondent may not represent the perspective of the list.

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
Friendly
Sent: January 24, 2016 5:43 PM
To: Jean-Luc Dupouey; r-help@r-project.org<mailto:r-help@r-project.org>
Subject: Re: [R] R-help mailing list activity / R-not-help?


On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
Dear members,

Not a technical question:
But one worth raising...

The number of threads in this mailing list, following a long period of
increase, has been regularly and strongly decreasing since 2010,
passing from more than 40K threads to less than 11K threads last year.
The trend is similar for most of the "ancient" mailing lists of the
R-project.
[snip ...]

I hope it is the wright place to ask this question. Thanks in advance,


In addition to the other replies, there is another trend I've seen that has
actively worked to suppress discussion on R-help and move it elsewhere. The
general things:
- R-help was too unwieldy and so it was a good idea to hive-off specialized
topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
- Many people posted badly-formed questions to R-help, and so it was a good
idea to develop and refer to the posting guide to mitigate the number of
purely junk postings.


Yet, the trend I've seen is one of increasing **R-not-help**, in that there
are many posts, often by new R users who get replies that not infrequently
range from just mildly off-putting to actively hostile:

- Is this homework? We don't do homework (sometimes false alarms, where the
OP has to reply to say it is not)
- Didn't you bother to do your homework, RTFM, or Google?
- This is off-topic because XXX (e.g., it is not strictly an R programming
question).
- You asked about doing XXX, but this is a stupid thing to want to do.
- Don't ask here; you need to talk to a statistical consultant.

I find this sad in a public mailing list sent to all R-help subscribers and I
sometimes cringe when I read replies to people who were actually trying to
get help with some R-related problem, but expressed it badly, didn't know
exactly what to ask for, or how to format it, or somehow motivated a
frequent-replier to publicly dis the OP.

On the other hand, I still see a spirit of great generosity among some people
who frequently reply 

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Oliver Keyes
+1. And frankly I would like to suggest that there is another obvious
solution here; pairing a set of guidelines around expected user
behaviour with removing people from the mailing list, or moderating
them, if they do not think that creating a non-toxic environment is
good.

On 25 January 2016 at 07:23, Fowler, Mark <mark.fow...@dfo-mpo.gc.ca> wrote:
> I'm glad to see the issue of negative feedback addressed. I can especially 
> relate to the 'cringe' feeling when reading some authoritarian backhand to a 
> new user. We do see a number of obviously inappropriate or overly lazy 
> postings, but I encounter far more postings where I don't feel competent to 
> judge their merit. It might be better to simply disregard a posting one does 
> not like for some reason. It might also be worthwhile to actively counter 
> negative feedback when we experience that 'cringing' moment. I'm not thinking 
> to foster contention, but simply to provide some tangible reassurance to new 
> users, and not just the ones invoking the negative feedback, that a 
> particular respondent may not represent the perspective of the list.
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael 
> Friendly
> Sent: January 24, 2016 5:43 PM
> To: Jean-Luc Dupouey; r-help@r-project.org
> Subject: Re: [R] R-help mailing list activity / R-not-help?
>
>
> On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
>> Dear members,
>>
>> Not a technical question:
> But one worth raising...
>>
>> The number of threads in this mailing list, following a long period of
>> increase, has been regularly and strongly decreasing since 2010,
>> passing from more than 40K threads to less than 11K threads last year.
>> The trend is similar for most of the "ancient" mailing lists of the 
>> R-project.
> [snip ...]
>>
>> I hope it is the wright place to ask this question. Thanks in advance,
>>
>
> In addition to the other replies, there is another trend I've seen that has 
> actively worked to suppress discussion on R-help and move it elsewhere. The 
> general things:
> - R-help was too unwieldy and so it was a good idea to hive-off specialized 
> topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
> - Many people posted badly-formed questions to R-help, and so it was a good 
> idea to develop and refer to the posting guide to mitigate the number of 
> purely junk postings.
>
> 
> Yet, the trend I've seen is one of increasing **R-not-help**, in that there 
> are many posts, often by new R users who get replies that not infrequently 
> range from just mildly off-putting to actively hostile:
>
> - Is this homework? We don't do homework (sometimes false alarms, where the 
> OP has to reply to say it is not)
> - Didn't you bother to do your homework, RTFM, or Google?
> - This is off-topic because XXX (e.g., it is not strictly an R programming 
> question).
> - You asked about doing XXX, but this is a stupid thing to want to do.
> - Don't ask here; you need to talk to a statistical consultant.
>
> I find this sad in a public mailing list sent to all R-help subscribers and I 
> sometimes cringe when I read replies to people who were actually trying to 
> get help with some R-related problem, but expressed it badly, didn't know 
> exactly what to ask for, or how to format it, or somehow motivated a 
> frequent-replier to publicly dis the OP.
>
> On the other hand, I still see a spirit of great generosity among some people 
> who frequently reply to R-help, taking a possibly badly posed or 
> ill-formatted question, and going to some lengths to provide a a helpful 
> answer of some sort.  I applaud those who take the time and effort to do this.
>
> I use R in a number of my courses, and used to advise students to post to 
> R-help for general programming questions (not just homework) they couldn't 
> solve. I don't do this any more, because several of them reported a negative 
> experience.
>
> In contrast, in the Stackexchange model, there are numerous sublists 
> cross-classified by their tags.  If I have a specific knitr, ggplot2, LaTeX, 
> or statistical modeling question, I'm now more likely to post it there, and 
> the worst that can happen is that no one "upvotes" it or someone (helpfully) 
> marks it as a duplicate of a similar question.
> But comments there are not propagated to all subscribers, and those who reply 
> helpfully, can see their solutions accepted or not, or commented on in that 
> specific topic.
>
> Perhaps one solution would be to create a new "R-not-help" list where, as in 
> a Monty Python skit, people could be directed there to be insulted and all 
> these unhelpful replies c

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Fowler, Mark
I'm glad to see the issue of negative feedback addressed. I can especially 
relate to the 'cringe' feeling when reading some authoritarian backhand to a 
new user. We do see a number of obviously inappropriate or overly lazy 
postings, but I encounter far more postings where I don't feel competent to 
judge their merit. It might be better to simply disregard a posting one does 
not like for some reason. It might also be worthwhile to actively counter 
negative feedback when we experience that 'cringing' moment. I'm not thinking 
to foster contention, but simply to provide some tangible reassurance to new 
users, and not just the ones invoking the negative feedback, that a particular 
respondent may not represent the perspective of the list.

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael Friendly
Sent: January 24, 2016 5:43 PM
To: Jean-Luc Dupouey; r-help@r-project.org
Subject: Re: [R] R-help mailing list activity / R-not-help?


On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
> Dear members,
>
> Not a technical question:
But one worth raising...
>
> The number of threads in this mailing list, following a long period of 
> increase, has been regularly and strongly decreasing since 2010, 
> passing from more than 40K threads to less than 11K threads last year. 
> The trend is similar for most of the "ancient" mailing lists of the R-project.
[snip ...]
>
> I hope it is the wright place to ask this question. Thanks in advance,
>

In addition to the other replies, there is another trend I've seen that has 
actively worked to suppress discussion on R-help and move it elsewhere. The 
general things:
- R-help was too unwieldy and so it was a good idea to hive-off specialized 
topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
- Many people posted badly-formed questions to R-help, and so it was a good 
idea to develop and refer to the posting guide to mitigate the number of purely 
junk postings.


Yet, the trend I've seen is one of increasing **R-not-help**, in that there are 
many posts, often by new R users who get replies that not infrequently range 
from just mildly off-putting to actively hostile:

- Is this homework? We don't do homework (sometimes false alarms, where the OP 
has to reply to say it is not)
- Didn't you bother to do your homework, RTFM, or Google?
- This is off-topic because XXX (e.g., it is not strictly an R programming 
question).
- You asked about doing XXX, but this is a stupid thing to want to do.
- Don't ask here; you need to talk to a statistical consultant.

I find this sad in a public mailing list sent to all R-help subscribers and I 
sometimes cringe when I read replies to people who were actually trying to get 
help with some R-related problem, but expressed it badly, didn't know exactly 
what to ask for, or how to format it, or somehow motivated a frequent-replier 
to publicly dis the OP.

On the other hand, I still see a spirit of great generosity among some people 
who frequently reply to R-help, taking a possibly badly posed or ill-formatted 
question, and going to some lengths to provide a a helpful answer of some sort. 
 I applaud those who take the time and effort to do this.

I use R in a number of my courses, and used to advise students to post to 
R-help for general programming questions (not just homework) they couldn't 
solve. I don't do this any more, because several of them reported a negative 
experience.

In contrast, in the Stackexchange model, there are numerous sublists 
cross-classified by their tags.  If I have a specific knitr, ggplot2, LaTeX, or 
statistical modeling question, I'm now more likely to post it there, and the 
worst that can happen is that no one "upvotes" it or someone (helpfully) marks 
it as a duplicate of a similar question.
But comments there are not propagated to all subscribers, and those who reply 
helpfully, can see their solutions accepted or not, or commented on in that 
specific topic.

Perhaps one solution would be to create a new "R-not-help" list where, as in a 
Monty Python skit, people could be directed there to be insulted and all these 
unhelpful replies could be sent.

A milder alternative is to encourage some R-help subscribers to click the 
"Don't send" or "Save" button and think better of their replies.


-- 
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Ted Harding
My feelings exactly! (And since quite some time ago).
Ted.

On 25-Jan-2016 12:23:16 Fowler, Mark wrote:
> I'm glad to see the issue of negative feedback addressed. I can especially
> relate to the 'cringe' feeling when reading some authoritarian backhand to a
> new user. We do see a number of obviously inappropriate or overly lazy
> postings, but I encounter far more postings where I don't feel competent to
> judge their merit. It might be better to simply disregard a posting one does
> not like for some reason. It might also be worthwhile to actively counter
> negative feedback when we experience that 'cringing' moment. I'm not thinking
> to foster contention, but simply to provide some tangible reassurance to new
> users, and not just the ones invoking the negative feedback, that a
> particular respondent may not represent the perspective of the list.
> 
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
> Friendly
> Sent: January 24, 2016 5:43 PM
> To: Jean-Luc Dupouey; r-help@r-project.org
> Subject: Re: [R] R-help mailing list activity / R-not-help?
> 
> 
> On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
>> Dear members,
>>
>> Not a technical question:
> But one worth raising...
>>
>> The number of threads in this mailing list, following a long period of 
>> increase, has been regularly and strongly decreasing since 2010, 
>> passing from more than 40K threads to less than 11K threads last year. 
>> The trend is similar for most of the "ancient" mailing lists of the
>> R-project.
> [snip ...]
>>
>> I hope it is the wright place to ask this question. Thanks in advance,
>>
> 
> In addition to the other replies, there is another trend I've seen that has
> actively worked to suppress discussion on R-help and move it elsewhere. The
> general things:
> - R-help was too unwieldy and so it was a good idea to hive-off specialized
> topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
> - Many people posted badly-formed questions to R-help, and so it was a good
> idea to develop and refer to the posting guide to mitigate the number of
> purely junk postings.
> 
> 
> Yet, the trend I've seen is one of increasing **R-not-help**, in that there
> are many posts, often by new R users who get replies that not infrequently
> range from just mildly off-putting to actively hostile:
> 
> - Is this homework? We don't do homework (sometimes false alarms, where the
> OP has to reply to say it is not)
> - Didn't you bother to do your homework, RTFM, or Google?
> - This is off-topic because XXX (e.g., it is not strictly an R programming
> question).
> - You asked about doing XXX, but this is a stupid thing to want to do.
> - Don't ask here; you need to talk to a statistical consultant.
> 
> I find this sad in a public mailing list sent to all R-help subscribers and I
> sometimes cringe when I read replies to people who were actually trying to
> get help with some R-related problem, but expressed it badly, didn't know
> exactly what to ask for, or how to format it, or somehow motivated a
> frequent-replier to publicly dis the OP.
> 
> On the other hand, I still see a spirit of great generosity among some people
> who frequently reply to R-help, taking a possibly badly posed or
> ill-formatted question, and going to some lengths to provide a a helpful
> answer of some sort.  I applaud those who take the time and effort to do
> this.
> 
> I use R in a number of my courses, and used to advise students to post to
> R-help for general programming questions (not just homework) they couldn't
> solve. I don't do this any more, because several of them reported a negative
> experience.
> 
> In contrast, in the Stackexchange model, there are numerous sublists
> cross-classified by their tags.  If I have a specific knitr, ggplot2, LaTeX,
> or statistical modeling question, I'm now more likely to post it there, and
> the worst that can happen is that no one "upvotes" it or someone (helpfully)
> marks it as a duplicate of a similar question.
> But comments there are not propagated to all subscribers, and those who reply
> helpfully, can see their solutions accepted or not, or commented on in that
> specific topic.
> 
> Perhaps one solution would be to create a new "R-not-help" list where, as in
> a Monty Python skit, people could be directed there to be insulted and all
> these unhelpful replies could be sent.
> 
> A milder alternative is to encourage some R-help subscribers to click the
> "Don't send" or "Save" button and think better of their replies.
> 
> 
> -- 
> Michael Friendly Email: friendly AT yorku DOT ca
&

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Duncan Murdoch

On 25/01/2016 12:35 PM, John Sorkin wrote:

When we read acerbic replies we should remind the poster to reply in a more 
moderate tone.
As long as you do this in private, not on the list, I wouldn't object.  
(I'd hope I wouldn't even know about it.)  Doing it on the list is more 
likely to lead to flame wars than to improved behaviour.


As others have suggested, if you think someone has been mistreated, then 
the public remedy should be to treat them well by giving a better answer 
yourself.


Duncan Murdoch


  On the other hand  noting that the list is not intended to be a source of 
answers to home work questions is 100% appropriate. This philosophy is intended 
both to keep the list from being flooded with questions and to make sure that 
no student has an unfair advantage.
John

> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and 
Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)


> On Jan 25, 2016, at 12:17 PM, Ted Harding <ted.hard...@wlandres.net> wrote:
>
> My feelings exactly! (And since quite some time ago).
> Ted.
>
>> On 25-Jan-2016 12:23:16 Fowler, Mark wrote:
>> I'm glad to see the issue of negative feedback addressed. I can especially
>> relate to the 'cringe' feeling when reading some authoritarian backhand to a
>> new user. We do see a number of obviously inappropriate or overly lazy
>> postings, but I encounter far more postings where I don't feel competent to
>> judge their merit. It might be better to simply disregard a posting one does
>> not like for some reason. It might also be worthwhile to actively counter
>> negative feedback when we experience that 'cringing' moment. I'm not thinking
>> to foster contention, but simply to provide some tangible reassurance to new
>> users, and not just the ones invoking the negative feedback, that a
>> particular respondent may not represent the perspective of the list.
>>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
>> Friendly
>> Sent: January 24, 2016 5:43 PM
>> To: Jean-Luc Dupouey; r-help@r-project.org
>> Subject: Re: [R] R-help mailing list activity / R-not-help?
>>
>>
>>> On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
>>> Dear members,
>>>
>>> Not a technical question:
>> But one worth raising...
>>>
>>> The number of threads in this mailing list, following a long period of
>>> increase, has been regularly and strongly decreasing since 2010,
>>> passing from more than 40K threads to less than 11K threads last year.
>>> The trend is similar for most of the "ancient" mailing lists of the
>>> R-project.
>> [snip ...]
>>>
>>> I hope it is the wright place to ask this question. Thanks in advance,
>>
>> In addition to the other replies, there is another trend I've seen that has
>> actively worked to suppress discussion on R-help and move it elsewhere. The
>> general things:
>> - R-help was too unwieldy and so it was a good idea to hive-off specialized
>> topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
>> - Many people posted badly-formed questions to R-help, and so it was a good
>> idea to develop and refer to the posting guide to mitigate the number of
>> purely junk postings.
>>
>> 
>> Yet, the trend I've seen is one of increasing **R-not-help**, in that there
>> are many posts, often by new R users who get replies that not infrequently
>> range from just mildly off-putting to actively hostile:
>>
>> - Is this homework? We don't do homework (sometimes false alarms, where the
>> OP has to reply to say it is not)
>> - Didn't you bother to do your homework, RTFM, or Google?
>> - This is off-topic because XXX (e.g., it is not strictly an R programming
>> question).
>> - You asked about doing XXX, but this is a stupid thing to want to do.
>> - Don't ask here; you need to talk to a statistical consultant.
>>
>> I find this sad in a public mailing list sent to all R-help subscribers and I
>> sometimes cringe when I read replies to people who were actually trying to
>> get help with some R-related problem, but expressed it badly, didn't know
>> exactly what to ask for, or how to format it, or somehow motivated a
>> frequent-replier to publicly dis the OP.
>>
>> On the other hand, I still see a spirit of great generosity amo

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread John Sorkin
When we read acerbic replies we should remind the poster to reply in a more 
moderate tone. On the other hand  noting that the list is not intended to be a 
source of answers to home work questions is 100% appropriate. This philosophy 
is intended both to keep the list from being flooded with questions and to make 
sure that no student has an unfair advantage.
John 

> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and 
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to faxing)


> On Jan 25, 2016, at 12:17 PM, Ted Harding <ted.hard...@wlandres.net> wrote:
> 
> My feelings exactly! (And since quite some time ago).
> Ted.
> 
>> On 25-Jan-2016 12:23:16 Fowler, Mark wrote:
>> I'm glad to see the issue of negative feedback addressed. I can especially
>> relate to the 'cringe' feeling when reading some authoritarian backhand to a
>> new user. We do see a number of obviously inappropriate or overly lazy
>> postings, but I encounter far more postings where I don't feel competent to
>> judge their merit. It might be better to simply disregard a posting one does
>> not like for some reason. It might also be worthwhile to actively counter
>> negative feedback when we experience that 'cringing' moment. I'm not thinking
>> to foster contention, but simply to provide some tangible reassurance to new
>> users, and not just the ones invoking the negative feedback, that a
>> particular respondent may not represent the perspective of the list.
>> 
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
>> Friendly
>> Sent: January 24, 2016 5:43 PM
>> To: Jean-Luc Dupouey; r-help@r-project.org
>> Subject: Re: [R] R-help mailing list activity / R-not-help?
>> 
>> 
>>> On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
>>> Dear members,
>>> 
>>> Not a technical question:
>> But one worth raising...
>>> 
>>> The number of threads in this mailing list, following a long period of 
>>> increase, has been regularly and strongly decreasing since 2010, 
>>> passing from more than 40K threads to less than 11K threads last year. 
>>> The trend is similar for most of the "ancient" mailing lists of the
>>> R-project.
>> [snip ...]
>>> 
>>> I hope it is the wright place to ask this question. Thanks in advance,
>> 
>> In addition to the other replies, there is another trend I've seen that has
>> actively worked to suppress discussion on R-help and move it elsewhere. The
>> general things:
>> - R-help was too unwieldy and so it was a good idea to hive-off specialized
>> topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
>> - Many people posted badly-formed questions to R-help, and so it was a good
>> idea to develop and refer to the posting guide to mitigate the number of
>> purely junk postings.
>> 
>> 
>> Yet, the trend I've seen is one of increasing **R-not-help**, in that there
>> are many posts, often by new R users who get replies that not infrequently
>> range from just mildly off-putting to actively hostile:
>> 
>> - Is this homework? We don't do homework (sometimes false alarms, where the
>> OP has to reply to say it is not)
>> - Didn't you bother to do your homework, RTFM, or Google?
>> - This is off-topic because XXX (e.g., it is not strictly an R programming
>> question).
>> - You asked about doing XXX, but this is a stupid thing to want to do.
>> - Don't ask here; you need to talk to a statistical consultant.
>> 
>> I find this sad in a public mailing list sent to all R-help subscribers and I
>> sometimes cringe when I read replies to people who were actually trying to
>> get help with some R-related problem, but expressed it badly, didn't know
>> exactly what to ask for, or how to format it, or somehow motivated a
>> frequent-replier to publicly dis the OP.
>> 
>> On the other hand, I still see a spirit of great generosity among some people
>> who frequently reply to R-help, taking a possibly badly posed or
>> ill-formatted question, and going to some lengths to provide a a helpful
>> answer of some sort.  I applaud those who take the time and effort to do
>> this.
>> 
>> I use R in a number of my courses, and used to advise students to post to
>> R-help for general programming questions (not jus

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread jwd
On Mon, 25 Jan 2016 12:33:12 -0800
Hasan Diwan  wrote:

> There exists a fine line between being unintentionally rude, but
> helpful and purposely putting someone down. -- H

The line is really not "fine" at all since it lies in that word
"purposely."  Also, you've associated "helpful" with unintentional
rudeness.  The distinction you've drawn is clear.

JWDougherty

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Hasan Diwan
On 25 January 2016 at 13:13, Duncan Murdoch 
wrote:

> On 25/01/2016 3:33 PM, Hasan Diwan wrote:
>
>> There exists a fine line between being unintentionally rude, but helpful
>> and purposely putting someone down. -- H
>>
>
> I'm afraid I don't think your point is relevant.  I didn't claim all the
> people who were rude did it unintentionally.  However,  I don't know anyone
> on the list who is always rude and never helpful. Oliver claimed almost
> everyone is like that.


> I actually agree with a weaker version of John's proposal (which I cut out
> of my reply to Oliver).  I can imagine a public reprimand from one of the
> moderators would be appropriate.  It would never be appropriate from
> general list members; that's what leads to flame wars.
>
> I'm not a moderator, so I would not publicly "remind the poster to reply
> in a more moderate tone", and neither should you (unless you're a
> moderator).  It would be much better if one or both of us posted a more
> helpful response when we saw a rude, unhelpful one.


I'm not one to attack others in general, and have developed thick skin, so
a lot of what others find rude, I will ignore and get on with things. That
said, if someone does tell me that e.g. "Hasan is being offensive because
of $x, $y or $z", I'll apologise and get on with my life. Most of the time,
when people find me offensive, it's because I treat others how I wish to be
treated and the rhetoric just doesn't offend me. -- H

>
>
> Duncan Murdoch
>
>
>
>
>> On 25 January 2016 at 12:07, Duncan Murdoch 
>> wrote:
>>
>> > On 25/01/2016 2:45 PM, Oliver Keyes wrote:
>> >
>> >> I disagree, and would argue that fails to take a systemic view of this
>> >> kind of behaviour.
>> >>
>> >> If individual commentators are acerbic and are only privately
>> >> reprimanded, from the perspective of everyone else it looks like the
>> >> acerbic reply was A-OK. Someone said something unnecessarily hostile
>> >> and the response was...nada. That creates an environment where there
>> >> are no clear examples of what crosses a line and no clear expectation
>> >> that moderation is even a thing that happens. Indeed, I was shocked to
>> >> discover this list _was_ moderated precisely because all I see is
>> >> people being mean and nothing much else happening.
>> >>
>> >
>> > Why would you bother to read it if that's all you see?  I think there
>> are
>> > examples of posts here which are not at all helpful, and others which
>> are
>> > rude, but the majority are actually helpful (even some of the rude
>> ones).
>> >
>> > Duncan Murdoch
>> >
>> >
>> > __
>> > 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.
>> >
>>
>>
>>
>>
>


-- 
OpenPGP: https://hasan.d8u.us/gpg.key
Sent from my mobile device
Envoyé de mon portable

[[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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Oliver Keyes
Sorry, poor phrasing on my part; on the occasions where someone is
rude, all I see is...

I agree the public cautioning should be done by moderators, yes.

On 25 January 2016 at 16:13, Duncan Murdoch  wrote:
> On 25/01/2016 3:33 PM, Hasan Diwan wrote:
>>
>> There exists a fine line between being unintentionally rude, but helpful
>> and purposely putting someone down. -- H
>
>
> I'm afraid I don't think your point is relevant.  I didn't claim all the
> people who were rude did it unintentionally.  However,  I don't know anyone
> on the list who is always rude and never helpful. Oliver claimed almost
> everyone is like that.
>
> I actually agree with a weaker version of John's proposal (which I cut out
> of my reply to Oliver).  I can imagine a public reprimand from one of the
> moderators would be appropriate.  It would never be appropriate from general
> list members; that's what leads to flame wars.
>
> I'm not a moderator, so I would not publicly "remind the poster to reply in
> a more moderate tone", and neither should you (unless you're a moderator).
> It would be much better if one or both of us posted a more helpful response
> when we saw a rude, unhelpful one.
>
> Duncan Murdoch
>
>
>>
>> On 25 January 2016 at 12:07, Duncan Murdoch 
>> wrote:
>>
>> > On 25/01/2016 2:45 PM, Oliver Keyes wrote:
>> >
>> >> I disagree, and would argue that fails to take a systemic view of this
>> >> kind of behaviour.
>> >>
>> >> If individual commentators are acerbic and are only privately
>> >> reprimanded, from the perspective of everyone else it looks like the
>> >> acerbic reply was A-OK. Someone said something unnecessarily hostile
>> >> and the response was...nada. That creates an environment where there
>> >> are no clear examples of what crosses a line and no clear expectation
>> >> that moderation is even a thing that happens. Indeed, I was shocked to
>> >> discover this list _was_ moderated precisely because all I see is
>> >> people being mean and nothing much else happening.
>> >>
>> >
>> > Why would you bother to read it if that's all you see?  I think there
>> > are
>> > examples of posts here which are not at all helpful, and others which
>> > are
>> > rude, but the majority are actually helpful (even some of the rude
>> > ones).
>> >
>> > Duncan Murdoch
>> >
>> >
>> > __
>> > 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.



-- 
Oliver Keyes
Count Logula
Wikimedia Foundation

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Duncan Murdoch

On 25/01/2016 3:33 PM, Hasan Diwan wrote:

There exists a fine line between being unintentionally rude, but helpful
and purposely putting someone down. -- H


I'm afraid I don't think your point is relevant.  I didn't claim all the 
people who were rude did it unintentionally.  However,  I don't know 
anyone on the list who is always rude and never helpful. Oliver claimed 
almost everyone is like that.


I actually agree with a weaker version of John's proposal (which I cut 
out of my reply to Oliver).  I can imagine a public reprimand from one 
of the moderators would be appropriate.  It would never be appropriate 
from general list members; that's what leads to flame wars.


I'm not a moderator, so I would not publicly "remind the poster to reply 
in a more moderate tone", and neither should you (unless you're a 
moderator).  It would be much better if one or both of us posted a more 
helpful response when we saw a rude, unhelpful one.


Duncan Murdoch




On 25 January 2016 at 12:07, Duncan Murdoch 
wrote:

> On 25/01/2016 2:45 PM, Oliver Keyes wrote:
>
>> I disagree, and would argue that fails to take a systemic view of this
>> kind of behaviour.
>>
>> If individual commentators are acerbic and are only privately
>> reprimanded, from the perspective of everyone else it looks like the
>> acerbic reply was A-OK. Someone said something unnecessarily hostile
>> and the response was...nada. That creates an environment where there
>> are no clear examples of what crosses a line and no clear expectation
>> that moderation is even a thing that happens. Indeed, I was shocked to
>> discover this list _was_ moderated precisely because all I see is
>> people being mean and nothing much else happening.
>>
>
> Why would you bother to read it if that's all you see?  I think there are
> examples of posts here which are not at all helpful, and others which are
> rude, but the majority are actually helpful (even some of the rude ones).
>
> Duncan Murdoch
>
>
> __
> 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] R-help mailing list activity / R-not-help?

2016-01-25 Thread jwd
On Mon, 25 Jan 2016 11:06:35 -0500
Oliver Keyes  wrote:

> +1. And frankly I would like to suggest that there is another obvious
> solution here; pairing a set of guidelines around expected user
> behaviour with removing people from the mailing list, or moderating
> them, if they do not think that creating a non-toxic environment is
> good.
> 

The problem is defining a "toxic environment."  One person can find all
kinds of offense and rudness in something where another would
be appreciating a short, concise response, such as a suggestion to "read
the manual." "Toxic" is personal and one can find it wherever one
looks, if so minded. I suspect that if one perceives rudeness, one
ought to check and see that we haven't left our sensibilities out in
the traffic pattern where they are bound to be trampled.

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread Peter Alspach
I think this would be re-defining the role of the moderators for list, which is 
essentially to filter out spam.  Only new members are subject to this 
moderation, and if a message is genuine then their moderator flag is cleared 
(i.e., they are no longer subject to moderation).  Thus the list isn't 
moderated in the 'usual' sense.

That said, I have occasionally asked a new poster to reword their question (or 
simply add a subject line) and explained that this helps ensure they get a good 
answer, and not a rude one.  Mostly people seem to appreciate that.

Peter Alspach
(one of the 'moderators')

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Oliver Keyes
Sent: Tuesday, 26 January 2016 10:23 a.m.
To: Duncan Murdoch <murdoch.dun...@gmail.com>
Cc: r-help <r-help@r-project.org>
Subject: Re: [R] R-help mailing list activity / R-not-help?

Sorry, poor phrasing on my part; on the occasions where someone is rude, all I 
see is...

I agree the public cautioning should be done by moderators, yes.

On 25 January 2016 at 16:13, Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
> On 25/01/2016 3:33 PM, Hasan Diwan wrote:
>>
>> There exists a fine line between being unintentionally rude, but 
>> helpful and purposely putting someone down. -- H
>
>
> I'm afraid I don't think your point is relevant.  I didn't claim all 
> the people who were rude did it unintentionally.  However,  I don't 
> know anyone on the list who is always rude and never helpful. Oliver 
> claimed almost everyone is like that.
>
> I actually agree with a weaker version of John's proposal (which I cut 
> out of my reply to Oliver).  I can imagine a public reprimand from one 
> of the moderators would be appropriate.  It would never be appropriate 
> from general list members; that's what leads to flame wars.
>
> I'm not a moderator, so I would not publicly "remind the poster to 
> reply in a more moderate tone", and neither should you (unless you're a 
> moderator).
> It would be much better if one or both of us posted a more helpful 
> response when we saw a rude, unhelpful one.
>
> Duncan Murdoch
>
>
>>
>> On 25 January 2016 at 12:07, Duncan Murdoch 
>> <murdoch.dun...@gmail.com>
>> wrote:
>>
>> > On 25/01/2016 2:45 PM, Oliver Keyes wrote:
>> >
>> >> I disagree, and would argue that fails to take a systemic view of 
>> >> this kind of behaviour.
>> >>
>> >> If individual commentators are acerbic and are only privately 
>> >> reprimanded, from the perspective of everyone else it looks like 
>> >> the acerbic reply was A-OK. Someone said something unnecessarily 
>> >> hostile and the response was...nada. That creates an environment 
>> >> where there are no clear examples of what crosses a line and no 
>> >> clear expectation that moderation is even a thing that happens. 
>> >> Indeed, I was shocked to discover this list _was_ moderated 
>> >> precisely because all I see is people being mean and nothing much else 
>> >> happening.
>> >>
>> >
>> > Why would you bother to read it if that's all you see?  I think 
>> > there are examples of posts here which are not at all helpful, and 
>> > others which are rude, but the majority are actually helpful (even 
>> > some of the rude ones).
>> >
>> > Duncan Murdoch
>> >
>> >
>> > __
>> > 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.



--
Oliver Keyes
Count Logula
Wikimedia Foundation

__
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.
The contents of this e-mail are confidential and may be ...{{dropped:14}}

__
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] R-help mailing list activity / R-not-help?

2016-01-25 Thread John Sorkin
I submit it is up to list members to maintain civility. If we politely point 
out. off-line, to people who post questionable posts what they are doing, I am 
sure their behavior will quickly change.John 


John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric 
Medicine
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing) 

>>> Peter Alspach <peter.alsp...@plantandfood.co.nz> 01/25/16 5:33 PM >>>
I think this would be re-defining the role of the moderators for list, which is 
essentially to filter out spam.  Only new members are subject to this 
moderation, and if a message is genuine then their moderator flag is cleared 
(i.e., they are no longer subject to moderation).  Thus the list isn't 
moderated in the 'usual' sense.

That said, I have occasionally asked a new poster to reword their question (or 
simply add a subject line) and explained that this helps ensure they get a good 
answer, and not a rude one.  Mostly people seem to appreciate that.

Peter Alspach
(one of the 'moderators')

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Oliver Keyes
Sent: Tuesday, 26 January 2016 10:23 a.m.
To: Duncan Murdoch <murdoch.dun...@gmail.com>
Cc: r-help <r-help@r-project.org>
Subject: Re: [R] R-help mailing list activity / R-not-help?

Sorry, poor phrasing on my part; on the occasions where someone is rude, all I 
see is...

I agree the public cautioning should be done by moderators, yes.

On 25 January 2016 at 16:13, Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
> On 25/01/2016 3:33 PM, Hasan Diwan wrote:
>>
>> There exists a fine line between being unintentionally rude, but 
>> helpful and purposely putting someone down. -- H
>
>
> I'm afraid I don't think your point is relevant.  I didn't claim all 
> the people who were rude did it unintentionally.  However,  I don't 
> know anyone on the list who is always rude and never helpful. Oliver 
> claimed almost everyone is like that.
>
> I actually agree with a weaker version of John's proposal (which I cut 
> out of my reply to Oliver).  I can imagine a public reprimand from one 
> of the moderators would be appropriate.  It would never be appropriate 
> from general list members; that's what leads to flame wars.
>
> I'm not a moderator, so I would not publicly "remind the poster to 
> reply in a more moderate tone", and neither should you (unless you're a 
> moderator).
> It would be much better if one or both of us posted a more helpful 
> response when we saw a rude, unhelpful one.
>
> Duncan Murdoch
>
>
>>
>> On 25 January 2016 at 12:07, Duncan Murdoch 
>> <murdoch.dun...@gmail.com>
>> wrote:
>>
>> > On 25/01/2016 2:45 PM, Oliver Keyes wrote:
>> >
>> >> I disagree, and would argue that fails to take a systemic view of 
>> >> this kind of behaviour.
>> >>
>> >> If individual commentators are acerbic and are only privately 
>> >> reprimanded, from the perspective of everyone else it looks like 
>> >> the acerbic reply was A-OK. Someone said something unnecessarily 
>> >> hostile and the response was...nada. That creates an environment 
>> >> where there are no clear examples of what crosses a line and no 
>> >> clear expectation that moderation is even a thing that happens. 
>> >> Indeed, I was shocked to discover this list _was_ moderated 
>> >> precisely because all I see is people being mean and nothing much else 
>> >> happening.
>> >>
>> >
>> > Why would you bother to read it if that's all you see?  I think 
>> > there are examples of posts here which are not at all helpful, and 
>> > others which are rude, but the majority are actually helpful (even 
>> > some of the rude ones).
>> >
>> > Duncan Murdoch
>> >
>> >
>> > __
>> > 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 
&

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Oliver Keyes
I disagree, and would argue that fails to take a systemic view of this
kind of behaviour.

If individual commentators are acerbic and are only privately
reprimanded, from the perspective of everyone else it looks like the
acerbic reply was A-OK. Someone said something unnecessarily hostile
and the response was...nada. That creates an environment where there
are no clear examples of what crosses a line and no clear expectation
that moderation is even a thing that happens. Indeed, I was shocked to
discover this list _was_ moderated precisely because all I see is
people being mean and nothing much else happening.

I would much rather a system where there is some sort of public
notice. It doesn't have to be identifying. Just "after a couple of
replies that did not follow our guidelines I have put some members of
this list on moderation, meaning that they must have their posts
cleared before being sent out. A reminder that we have certain
standards here and etc etc etc"

On 25 January 2016 at 12:50, Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
> On 25/01/2016 12:35 PM, John Sorkin wrote:
>>
>> When we read acerbic replies we should remind the poster to reply in a
>> more moderate tone.
>
> As long as you do this in private, not on the list, I wouldn't object.  (I'd
> hope I wouldn't even know about it.)  Doing it on the list is more likely to
> lead to flame wars than to improved behaviour.
>
> As others have suggested, if you think someone has been mistreated, then the
> public remedy should be to treat them well by giving a better answer
> yourself.
>
> Duncan Murdoch
>
>>   On the other hand  noting that the list is not intended to be a source
>> of answers to home work questions is 100% appropriate. This philosophy is
>> intended both to keep the list from being flooded with questions and to make
>> sure that no student has an unfair advantage.
>> John
>>
>> > John David Sorkin M.D., Ph.D.
>> > Professor of Medicine
>> > Chief, Biostatistics and Informatics
>> > University of Maryland School of Medicine Division of Gerontology and
>> > Geriatric Medicine
>> > Baltimore VA Medical Center
>> > 10 North Greene Street
>> > GRECC (BT/18/GR)
>> > Baltimore, MD 21201-1524
>> > (Phone) 410-605-7119
>> > (Fax) 410-605-7913 (Please call phone number above prior to faxing)
>>
>>
>> > On Jan 25, 2016, at 12:17 PM, Ted Harding <ted.hard...@wlandres.net>
>> > wrote:
>> >
>> > My feelings exactly! (And since quite some time ago).
>> > Ted.
>> >
>> >> On 25-Jan-2016 12:23:16 Fowler, Mark wrote:
>> >> I'm glad to see the issue of negative feedback addressed. I can
>> >> especially
>> >> relate to the 'cringe' feeling when reading some authoritarian backhand
>> >> to a
>> >> new user. We do see a number of obviously inappropriate or overly lazy
>> >> postings, but I encounter far more postings where I don't feel
>> >> competent to
>> >> judge their merit. It might be better to simply disregard a posting one
>> >> does
>> >> not like for some reason. It might also be worthwhile to actively
>> >> counter
>> >> negative feedback when we experience that 'cringing' moment. I'm not
>> >> thinking
>> >> to foster contention, but simply to provide some tangible reassurance
>> >> to new
>> >> users, and not just the ones invoking the negative feedback, that a
>> >> particular respondent may not represent the perspective of the list.
>> >>
>> >> -Original Message-
>> >> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael
>> >> Friendly
>> >> Sent: January 24, 2016 5:43 PM
>> >> To: Jean-Luc Dupouey; r-help@r-project.org
>> >> Subject: Re: [R] R-help mailing list activity / R-not-help?
>> >>
>> >>
>> >>> On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:
>> >>> Dear members,
>> >>>
>> >>> Not a technical question:
>> >> But one worth raising...
>> >>>
>> >>> The number of threads in this mailing list, following a long period of
>> >>> increase, has been regularly and strongly decreasing since 2010,
>> >>> passing from more than 40K threads to less than 11K threads last year.
>> >>> The trend is similar for most of the "ancient" mailing lists of the
>> >>> R-project.
>> >> [snip ...]
>> >>>
>> >>> I hope it 

Re: [R] R-help mailing list activity / R-not-help?

2016-01-25 Thread Kevin E. Thorpe

On 01/25/2016 11:06 AM, Oliver Keyes wrote:

+1. And frankly I would like to suggest that there is another obvious
solution here; pairing a set of guidelines around expected user
behaviour with removing people from the mailing list, or moderating
them, if they do not think that creating a non-toxic environment is
good.



These guidelines DO exist. It is called the posting guide. 
Unfortunately, it is clear that some people cannot be bothered to read 
that. Is that an excuse to be mistreated? By no means.


If you, or anyone else has a good way to encourage new users to read and 
use the guidelines, I think we would love to hear it.



On 25 January 2016 at 07:23, Fowler, Mark <mark.fow...@dfo-mpo.gc.ca> wrote:

I'm glad to see the issue of negative feedback addressed. I can especially 
relate to the 'cringe' feeling when reading some authoritarian backhand to a 
new user. We do see a number of obviously inappropriate or overly lazy 
postings, but I encounter far more postings where I don't feel competent to 
judge their merit. It might be better to simply disregard a posting one does 
not like for some reason. It might also be worthwhile to actively counter 
negative feedback when we experience that 'cringing' moment. I'm not thinking 
to foster contention, but simply to provide some tangible reassurance to new 
users, and not just the ones invoking the negative feedback, that a particular 
respondent may not represent the perspective of the list.

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Michael Friendly
Sent: January 24, 2016 5:43 PM
To: Jean-Luc Dupouey; r-help@r-project.org
Subject: Re: [R] R-help mailing list activity / R-not-help?


On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:

Dear members,

Not a technical question:

But one worth raising...


The number of threads in this mailing list, following a long period of
increase, has been regularly and strongly decreasing since 2010,
passing from more than 40K threads to less than 11K threads last year.
The trend is similar for most of the "ancient" mailing lists of the R-project.

[snip ...]


I hope it is the wright place to ask this question. Thanks in advance,



In addition to the other replies, there is another trend I've seen that has 
actively worked to suppress discussion on R-help and move it elsewhere. The 
general things:
- R-help was too unwieldy and so it was a good idea to hive-off specialized 
topics to various sub lists, R-SIG-Mac, R-SIG-Geo, etc.
- Many people posted badly-formed questions to R-help, and so it was a good 
idea to develop and refer to the posting guide to mitigate the number of purely 
junk postings.


Yet, the trend I've seen is one of increasing **R-not-help**, in that there are 
many posts, often by new R users who get replies that not infrequently range 
from just mildly off-putting to actively hostile:

- Is this homework? We don't do homework (sometimes false alarms, where the OP 
has to reply to say it is not)
- Didn't you bother to do your homework, RTFM, or Google?
- This is off-topic because XXX (e.g., it is not strictly an R programming 
question).
- You asked about doing XXX, but this is a stupid thing to want to do.
- Don't ask here; you need to talk to a statistical consultant.

I find this sad in a public mailing list sent to all R-help subscribers and I 
sometimes cringe when I read replies to people who were actually trying to get 
help with some R-related problem, but expressed it badly, didn't know exactly 
what to ask for, or how to format it, or somehow motivated a frequent-replier 
to publicly dis the OP.

On the other hand, I still see a spirit of great generosity among some people 
who frequently reply to R-help, taking a possibly badly posed or ill-formatted 
question, and going to some lengths to provide a a helpful answer of some sort. 
 I applaud those who take the time and effort to do this.

I use R in a number of my courses, and used to advise students to post to 
R-help for general programming questions (not just homework) they couldn't 
solve. I don't do this any more, because several of them reported a negative 
experience.

In contrast, in the Stackexchange model, there are numerous sublists cross-classified by 
their tags.  If I have a specific knitr, ggplot2, LaTeX, or statistical modeling 
question, I'm now more likely to post it there, and the worst that can happen is that no 
one "upvotes" it or someone (helpfully) marks it as a duplicate of a similar 
question.
But comments there are not propagated to all subscribers, and those who reply 
helpfully, can see their solutions accepted or not, or commented on in that 
specific topic.

Perhaps one solution would be to create a new "R-not-help" list where, as in a 
Monty Python skit, people could be directed there to be insulted and all these unhelpful 
replies could be sent.

A milder alternative is to encourage some R-help subscribers to clic

Re: [R] R-help mailing list activity / R-not-help?

2016-01-24 Thread Robert Sherry
I think this mailing list is wonderful and it has helped me a lot. In 
fact, I am not sure I would be using R today if it was not for this

list.

Bob

On 1/24/2016 4:42 PM, Michael Friendly wrote:


On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:

Dear members,

Not a technical question:

But one worth raising...


The number of threads in this mailing list, following a long period of
increase, has been regularly and strongly decreasing since 2010, passing
from more than 40K threads to less than 11K threads last year. The trend
is similar for most of the "ancient" mailing lists of the R-project.

[snip ...]


I hope it is the wright place to ask this question. Thanks in advance,



In addition to the other replies, there is another trend I've seen that
has actively worked to suppress discussion on R-help and move it 
elsewhere. The general things:
- R-help was too unwieldy and so it was a good idea to hive-off 
specialized topics to various sub lists, R-SIG-Mac, R-SIG-Geo,

etc.
- Many people posted badly-formed questions to R-help, and so it
was a good idea to develop and refer to the posting guide to mitigate
the number of purely junk postings.


Yet, the trend I've seen is one of increasing **R-not-help**, in that 
there are many posts, often by new R users who get replies that not

infrequently range from just mildly off-putting to actively hostile:

- Is this homework? We don't do homework (sometimes false alarms,
where the OP has to reply to say it is not)
- Didn't you bother to do your homework, RTFM, or Google?
- This is off-topic because XXX (e.g., it is not strictly an R 
programming question).

- You asked about doing XXX, but this is a stupid thing
to want to do.
- Don't ask here; you need to talk to a statistical consultant.

I find this sad in a public mailing list sent to all R-help subscribers
and I sometimes cringe
when I read replies to people who were actually trying to get
help with some R-related problem, but expressed it badly, didn't
know exactly what to ask for, or how to format it,
or somehow motivated a frequent-replier to publicly dis the OP.

On the other hand, I still see a spirit of great generosity among some
people who frequently reply to R-help, taking a possibly badly posed
or ill-formatted question, and going to some lengths to provide a
a helpful answer of some sort.  I applaud those who take the time
and effort to do this.

I use R in a number of my courses, and used to advise students to
post to R-help for general programming questions (not just homework) 
they couldn't solve. I don't do this any more, because several of them

reported a negative experience.

In contrast, in the Stackexchange model, there are numerous sublists
cross-classified by their tags.  If I have a specific knitr, ggplot2, 
LaTeX, or statistical modeling question, I'm now more likely to post 
it there, and the worst that can happen is that no one "upvotes" it

or someone (helpfully) marks it as a duplicate of a similar question.
But comments there are not propagated to all subscribers,
and those who reply helpfully, can see their solutions accepted or not,
or commented on in that specific topic.

Perhaps one solution would be to create a new "R-not-help" list where,
as in a Monty Python skit, people could be directed there to be 
insulted and all these unhelpful replies could be sent.


A milder alternative is to encourage some R-help subscribers to click 
the "Don't send" or "Save" button and think better of their replies.





__
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] R-help mailing list activity / R-not-help?

2016-01-24 Thread Michael Friendly


On 1/23/2016 7:28 AM, Jean-Luc Dupouey wrote:

Dear members,

Not a technical question:

But one worth raising...


The number of threads in this mailing list, following a long period of
increase, has been regularly and strongly decreasing since 2010, passing
from more than 40K threads to less than 11K threads last year. The trend
is similar for most of the "ancient" mailing lists of the R-project.

[snip ...]


I hope it is the wright place to ask this question. Thanks in advance,



In addition to the other replies, there is another trend I've seen that
has actively worked to suppress discussion on R-help and move it 
elsewhere. The general things:
- R-help was too unwieldy and so it was a good idea to hive-off 
specialized topics to various sub lists, R-SIG-Mac, R-SIG-Geo,

etc.
- Many people posted badly-formed questions to R-help, and so it
was a good idea to develop and refer to the posting guide to mitigate
the number of purely junk postings.


Yet, the trend I've seen is one of increasing **R-not-help**, in that 
there are many posts, often by new R users who get replies that not

infrequently range from just mildly off-putting to actively hostile:

- Is this homework? We don't do homework (sometimes false alarms,
where the OP has to reply to say it is not)
- Didn't you bother to do your homework, RTFM, or Google?
- This is off-topic because XXX (e.g., it is not strictly an R 
programming question).

- You asked about doing XXX, but this is a stupid thing
to want to do.
- Don't ask here; you need to talk to a statistical consultant.

I find this sad in a public mailing list sent to all R-help subscribers
and I sometimes cringe
when I read replies to people who were actually trying to get
help with some R-related problem, but expressed it badly, didn't
know exactly what to ask for, or how to format it,
or somehow motivated a frequent-replier to publicly dis the OP.

On the other hand, I still see a spirit of great generosity among some
people who frequently reply to R-help, taking a possibly badly posed
or ill-formatted question, and going to some lengths to provide a
a helpful answer of some sort.  I applaud those who take the time
and effort to do this.

I use R in a number of my courses, and used to advise students to
post to R-help for general programming questions (not just homework) 
they couldn't solve. I don't do this any more, because several of them

reported a negative experience.

In contrast, in the Stackexchange model, there are numerous sublists
cross-classified by their tags.  If I have a specific knitr, ggplot2, 
LaTeX, or statistical modeling question, I'm now more likely to post it 
there, and the worst that can happen is that no one "upvotes" it

or someone (helpfully) marks it as a duplicate of a similar question.
But comments there are not propagated to all subscribers,
and those who reply helpfully, can see their solutions accepted or not,
or commented on in that specific topic.

Perhaps one solution would be to create a new "R-not-help" list where,
as in a Monty Python skit, people could be directed there to be insulted 
and all these unhelpful replies could be sent.


A milder alternative is to encourage some R-help subscribers to click 
the "Don't send" or "Save" button and think better of their replies.



--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept. & Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

__
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] R-help mailing list activity

2016-01-23 Thread Rich Shepard

On Sat, 23 Jan 2016, Duncan Murdoch wrote:

I don't see duplication as counterproductive -- some people like one style, 
some like the other, both will find answers.


Duncan,

  There's another factor to add to your list. Mail lists, such as r-help and
the various SIGs _push_ messages to subscribers' mail boxes. Check your mail
and the threads can be followed. From the subscriber's perspective it's
passive.

  Web fora require subscribers to _pull_ messages by pointing their browser
to that URL, logging in, finding the appropriate forum, and viewing threads.

From the subscriber's perspective it's active.


  I'm one of the former types of participant. I subscribe to multiple mail
lists and review new messages several times a day when time permits or I
have another reason to do so. I'm rarely on a web forum because it requires
much more time away from business than does a mail list.

Just another perspective,

Rich

__
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] R-help mailing list activity

2016-01-23 Thread Thomas Petzoldt

Hi,

from my perspective as R user and package maintainer I would consider 
the normalization of the r-help mailing list a good sign. r-help is 
still a good place for general questions, while more specific 
discussions moved to the r-sig-... mailing lists.


Maybe a slight reduction can also be a motivation for more people to 
step in again answering questions.


Thomas

Am 23.01.2016 um 13:28 schrieb Jean-Luc Dupouey:

Dear members,

Not a technical question:

The number of threads in this mailing list, following a long period of
increase, has been regularly and strongly decreasing since 2010, passing
from more than 40K threads to less than 11K threads last year. The trend
is similar for most of the "ancient" mailing lists of the R-project. I
cannot imagine the total number of R-related inquiries on the Internet
decreased. It means that contributors have gone elsewhere. Indeed, in
the meantime, the number of R posts on stackoverflow passed from 2K to
100K between 2009 and 2015. Thus my question: what are the
specificities, the plus and minus of the R-project mailing lists, in
comparison with other lists, and especially in comparison with
stackoverflow? A lot of threads are duplicated on both lists, which
seems to me a little bit counterproductive.

I hope it is the wright place to ask this question. Thanks in advance,

Jean-Luc Dupouey

__
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] R-help mailing list activity

2016-01-23 Thread Duncan Murdoch

On 23/01/2016 7:28 AM, Jean-Luc Dupouey wrote:

Dear members,

Not a technical question:

The number of threads in this mailing list, following a long period of
increase, has been regularly and strongly decreasing since 2010, passing
from more than 40K threads to less than 11K threads last year. The trend
is similar for most of the "ancient" mailing lists of the R-project. I
cannot imagine the total number of R-related inquiries on the Internet
decreased. It means that contributors have gone elsewhere. Indeed, in
the meantime, the number of R posts on stackoverflow passed from 2K to
100K between 2009 and 2015. Thus my question: what are the
specificities, the plus and minus of the R-project mailing lists, in
comparison with other lists, and especially in comparison with
stackoverflow? A lot of threads are duplicated on both lists, which
seems to me a little bit counterproductive.


I don't see duplication as counterproductive -- some people like one 
style, some like the other, both will find answers.


However, I think there is less duplication than you might think in many 
areas.  Mailing lists are preferable when the people who are good at 
answering your questions use the mailing lists; Stackoverflow is 
preferable when the good answers are there.


I generally prefer the mailing lists, though I occasionally participate 
on Stackoverflow.  The reasons I prefer them:


 1. Permanence.  If Stackoverflow shuts down tomorrow, all posts there 
will likely disappear.  There are several locations that archive the 
mailing list posts. I have local copies of a few thousand posts on my 
own laptop.


 2. Familiarity.  I've been using the mailing lists for 20 years, and 
its easier to continue than to change.  If you're more familiar with the 
Stackoverflow process, you'll probably prefer that.


 3. Simplicity.  This may be a repeat of 2, but the Stackoverflow 
distinction between answers and comments, it's gamification (badges, 
special privileges to high scorers, etc.) just seems unnecessarily ornate.


 4. Interaction.  The mailing lists are a series of conversations, 
whereas Stackoverflow is more like Wikipedia, i.e. a joint project to 
which you can contribute.  (Maybe there are conversations on 
Stackoverflow as well, but I'm not a big enough user to know about them.)


If I look at my own recent record, I tend to answer far more questions 
on the mailing lists, but ask more on Stackoverflow.  I think this is 
due to my original point:  the experts in the topics I'm asking about 
are more likely to be there than here.


Duncan Murdoch

P.S. Your statistics are a little misleading:  you counted threads in 
one R mailing list in one year, and cumulative questions in all R topics 
over 7 years in Stackoverflow, so the difference in traffic isn't as 
large as your numbers look at first glance.  However, I think it is true 
that the mailing list traffic declined and Stackoverflow increased over 
that period.


__
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] R-help mailing list activity

2016-01-23 Thread Jean-Luc Dupouey

Dear members,

Not a technical question:

The number of threads in this mailing list, following a long period of 
increase, has been regularly and strongly decreasing since 2010, passing 
from more than 40K threads to less than 11K threads last year. The trend 
is similar for most of the "ancient" mailing lists of the R-project. I 
cannot imagine the total number of R-related inquiries on the Internet 
decreased. It means that contributors have gone elsewhere. Indeed, in 
the meantime, the number of R posts on stackoverflow passed from 2K to 
100K between 2009 and 2015. Thus my question: what are the 
specificities, the plus and minus of the R-project mailing lists, in 
comparison with other lists, and especially in comparison with 
stackoverflow? A lot of threads are duplicated on both lists, which 
seems to me a little bit counterproductive.


I hope it is the wright place to ask this question. Thanks in advance,

Jean-Luc Dupouey

__
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] R-help mailing list activity

2016-01-23 Thread Duncan Murdoch

One additional point:

On 23/01/2016 8:33 AM, Duncan Murdoch wrote:


distinction between answers and comments, it's gamification (badges,


One advantage of Stackoverflow is that you can go back and correct silly 
errors (like misspelling "its").


Duncan Murdoch

__
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] R-Help

2015-12-14 Thread Bello A rasheed via R-help
Dear R users 

Kindly help me on how run this code because there is error when ever i run it.
It give me an error at Error: lent >= 1 is not TRUE 
Error: object 'hubPsi' not found
Error in cbind(b = b, A = A, B = B, V = A/B^2, e = B^2/A, gamma. = b/B,  :   
dims [product 3] do not match the length of object [21] Thank you in 
advance
R-CODE
Hf0 <- function(x, c=1.35) pmax2(-c,pmin2(x,c))

Hf <- new("functionX",Hf0)

stopifnot(validObject(Hf)) # ok !


 

 
### psiFunc() examples## classical {trivial, notinteresting}:

F1 <- function(x) rep.int(1,length(x))

cPsi <- psiFunc(rho = function(x)x^2 / 2, psi = function(x) x,

    wgt = F1, Dpsi = F1,

    Erho = function(x) rep.int(1/2,length(x)),

    Epsi2 = F1, EDpsi = F1)


 
### MASS  -- ?rlm --- has

##

##- psi.huber   (u, k = 1.345, deriv =0)

##- psi.hampel  (u, a = 2, b = 4, c =8, deriv = 0)

##- psi.bisquare(u, c = 4.685, deriv = 0)

##  where deriv = 0 :  psi(x)/xi.e.  'wgt'


 
## MM has more in psi-funs.R (seeabove)

## Reproduce Table 1, p.138 of Hampel,Rousseeuw, Ronchetti, Stahel (1986):
b <- c(seq(0, 3, by = 0.1), 4, 5,Inf)

A <- hubPsi@Epsi2(b)

B <- hubPsi@EDpsi(b)


 
options(width = 100, digits = 7)


 
cbind(b = b, A = A, B = B, V = A/B^2, e= B^2/A,

 gamma. = b/B, k. = 1 + b^2/A, lambda. = 1/B)


 
(hubPsi2 <- chgDefaults(hubPsi, k =2)) # works too!

 Bello Abdulkadir RasheedPh.D candidate ( mathematics/statistics)
Department of mathematical Science/ faculty of Science
University Technology Malaysia
81310 UTM, Johor Bahru, Johor, Malaysia
IC. NO. 201204M10026
Matric No. PS113124
HP. No.  0060149144837E-mail: arasheedbe...@yahoo.com
supervisor- Assoc. Prof. Robiah Binti Adnan
[[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] R-help mailing list

2015-12-03 Thread Sarah Goslee
You need to start with a basic understanding of how R works. Here are
a couple of sources that might help you get started:
http://www.burns-stat.com/documents/tutorials/impatient-r/
http://cyclismo.org/tutorial/R/

Sarah

On Thu, Dec 3, 2015 at 4:51 PM, Saba Sehrish via R-help
 wrote:
> Hi
>
>
>
> I am a PhD student and I want to learn how to run Linear regression with 
> Lag-5 on R through "For Loop". Please find the details below:
>
>
>
> 1-I need guidance about Coding/ Programming for Simple Linear 
> Regression with Lag-5 on R.
>
> 2-   I have time series data of “Daily Returns” of 15 stocks and I 
> want to see how each stock’sreturn is connected to all other stocks’ returns. 
> This means, I have to runregression as follows:
>
>
>
> a) Impact of Stock 1’s return on return of Stock 2. 
> Impact of Stock 1’s return onreturn of Stock 3. Impact of Stock 1’s return on 
> return of Stock 4 ……… tillreturn of Stock 15.b) Then, 
> Impact of Stock 2’s return on return of Stock 1. Impact of Stock 2’sreturn on 
> return of Stock 3. Impact of Stock 2’s return on return of Stock 4……… till 
> return of Stock 15. And this will continue till Stock 15, one after another.  
>   c)  As the the process will have to be repeated, therefore 
> instead of manual coding everytime, “For Loop” is required.
>
>
>
>
> I shall bereally grateful for a detailed reply.
>
>
>
> Thanks.
>
>
>
> Regards
>
> Saba Sehrish
>

__
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] R-help mailing list

2015-12-03 Thread Saba Sehrish via R-help
Hi


 
I am a PhD student and I want to learn how to run Linear regression with Lag-5 
on R through "For Loop". Please find the details below:


 
1-            I need guidance about Coding/ Programming for Simple Linear 
Regression with Lag-5 on R.

2-   I have time series data of “Daily Returns” of 15 stocks and I want 
to see how each stock’sreturn is connected to all other stocks’ returns. This 
means, I have to runregression as follows:


 
                    a) Impact of Stock 1’s return on return of Stock 2. Impact 
of Stock 1’s return onreturn of Stock 3. Impact of Stock 1’s return on return 
of Stock 4 ……… tillreturn of Stock 15.                    b) Then, Impact of 
Stock 2’s return on return of Stock 1. Impact of Stock 2’sreturn on return of 
Stock 3. Impact of Stock 2’s return on return of Stock 4……… till return of 
Stock 15. And this will continue till Stock 15, one after another.              
      c)  As the the process will have to be repeated, therefore instead of 
manual coding everytime, “For Loop” is required. 



 
I shall bereally grateful for a detailed reply.


 
Thanks.


 
Regards

Saba Sehrish


[[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] R-help Digest, Vol 154, Issue 1

2015-12-01 Thread 13351275265
I  have  the  same  question  about  the  following  strings:
 sub("^([0-9]*).*$", "\\1", fields)
could  you  explain them  in  detail .
I  would  lookforward  to  yourwonderful  reply.
2015-12-01 

13351275265 



发件人:r-help-requ...@r-project.org
发送时间:2015-12-01 19:00
主题:R-help Digest, Vol 154, Issue 1
收件人:"r-help"
抄送:

Send R-help mailing list submissions to 
r-help@r-project.org 

To subscribe or unsubscribe via the World Wide Web, visit 
https://stat.ethz.ch/mailman/listinfo/r-help 
or, via email, send a message with subject or body 'help' to 
r-help-requ...@r-project.org 

You can reach the person managing the list at 
r-help-ow...@r-project.org 

When replying, please edit your Subject line so it is more specific 
than "Re: Contents of R-help digest..." 


Today's Topics: 

   1. Re: Extracting part of alpha numeric string 
  (phgrosj...@sciviews.org) 
   2. Re: Extracting part of alpha numeric string (Abhinaba Roy) 
   3. Re: Error in 'Contrasts<-' while using GBM. (peter dalgaard) 
   4. Re: Extracting part of alpha numeric string (S Ellison) 
   5. Re: Extracting part of alpha numeric string 
  (phgrosj...@sciviews.org) 
   6. PCA plot of variable names only (debra ragland) 
   7. Re: PCA plot of variable names only (Boris Steipe) 
   8. Re: PCA plot of variable names only (S Ellison) 
   9. Re: PCA plot of variable names only (Boris Steipe) 
  10. Re: Extracting part of alpha numeric string (Berend Hasselman) 
  11. Re: PCA plot of variable names only (David L Carlson) 
  12. Re: PCA plot of variable names only (debra ragland) 
  13. General copula model with heterogeneous marginals 
  (Justin Balthrop) 
  14. Re: rjags cannot find JAGS-4.0.0 (Martyn Plummer) 
  15. summation equation whose numerator has subscript (Sherouk Moawad) 
  16. Re: summation equation whose numerator has subscript 
  (Jeff Newmiller) 
  17. Re: summation equation whose numerator has subscript 
  (David Winsemius) 
  18. Graphing a subset of data (Alexandra Hua) 
  19. Re: Graphing a subset of data (David Winsemius) 
  20. filled circle with a black line on the rim in pch function 
  (Christine Lee) 
  21. Re: filled circle with a black line on the rim in pch 
  function (Jim Lemon) 
  22. ???  filled circle with a black line on the rim in pch 
  function (Christine Lee) 
  23. Re: Graphing a subset of data (Jim Lemon) 
  24. Metanalysis in R using MAVIS (Ernesto Villarino) 


-- 

Message: 1 
Date: Mon, 30 Nov 2015 12:17:52 +0100 
From: phgrosj...@sciviews.org 
To: Abhinaba Roy  
Cc: r-help  
Subject: Re: [R] Extracting part of alpha numeric string 
Message-ID: <524a0581-c4de-4c41-a8c9-d4f7c4090...@sciviews.org> 
Content-Type: text/plain; charset=us-ascii 

fields <- c("2154333b-3208-4519-8b76-acaef5b5a479", 
"980958a0-103b-4ba9-afaf-27b2f5c24e69", 
"00966654-0dea-4899-b8cf-26e8300b262d") 
sub("^([0-9]*).*$", "\\1", fields) 

Best, 

Philippe Grosjean 

> On 30 Nov 2015, at 11:39, Abhinaba Roy  wrote: 
>  
> Hi, 
>  
> I have a field with alpha numeric codes like, 
>  
> 2154333b-3208-4519-8b76-acaef5b5a479 980958a0-103b-4ba9-afaf-27b2f5c24e69 
> 00966654-0dea-4899-b8cf-26e8300b262d 
> I want a derived field which will contain ONLY the numeric part before the 
> first alphabet and the first '-', 
>  
> for example the derived field from the sample above will give me 
>  
> 2154333 
> 980958 
> 00966654 
>  
> How can this be achieved in R? 
>  
> P.S. I do not have much knowledge on regex. It would be of great help if 
> you could suggest some reading for beginners. 
>  
> Thanks, 
> Abhinaba 
>  
> [[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. 



-- 

Message: 2 
Date: Mon, 30 Nov 2015 17:39:00 +0530 
From: Abhinaba Roy  
To: phgrosj...@sciviews.org 
Cc: r-help  
Subject: Re: [R] Extracting part of alpha numeric string 
Message-ID: 
 
Content-Type: text/plain; charset="UTF-8" 

Hey, 

worked like a charm! :) 

Could you please explain about 

sub("^([0-9]*).*$", "\\1", fields) 

Thanks, 
Abhinaba 

On Mon, Nov 30, 2015 at 4:47 PM,  wrote: 

> fields <- c("2154333b-3208-4519-8b76-acaef5b5a479", 
> "980958a0-103b-4ba9-afaf-27b2f5c24e69", 
> "00966654-0dea-4899-b8cf-26e8300b262d") 
> sub("^([0-9]*).*$", "\\1", fields) 
> 
> Best, 
> 
> Philippe Grosjean 
> 
> > On 30 Nov 2015, at 11:39, Abhinaba Roy 

  1   2   3   4   5   6   7   >