[R] I can't see my questions and their answers in this mailing list !

2016-07-18 Thread MAURICE Jean - externe
HI,

I tried, for some months, to ask questions on this list. I think that my 
questions are 'sent somewhere' because I received answers for them in private 
but not via the list and I don't see neither my questions neither your answers 
on the list.. What am I doing wrong ?

Jean in France



Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à 
l'intention exclusive des destinataires et les informations qui y figurent sont 
strictement confidentielles. Toute utilisation de ce Message non conforme à sa 
destination, toute diffusion ou toute publication totale ou partielle, est 
interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le 
copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si 
vous avez reçu ce Message par erreur, merci de le supprimer de votre système, 
ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support 
que ce soit. Nous vous remercions également d'en avertir immédiatement 
l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie 
électronique arrivent en temps utile, sont sécurisées ou dénuées de toute 
erreur ou virus.


This message and any attachments (the 'Message') are intended solely for the 
addressees. The information contained in this Message is confidential. Any use 
of information contained in this Message not in accord with its purpose, any 
dissemination or disclosure, either whole or partial, is prohibited except 
formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any 
part of it. If you have received this message in error, please delete it and 
all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or 
virus-free.
__
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] GREA - installation problems

2016-07-18 Thread Manderscheid Katharina
i came across the GREA add-in for RStudio on R-bloggers: 
http://feedproxy.google.com/~r/RBloggers/~3/dU-3B7fQJ2c/?utm_source=feedburner&utm_medium=email
https://github.com/Stan125/GREA
and wanted to try it straight away - yet I failed already with the installation.
after typing in
> devtools::install_github("Stan125/GREA")
I get the following:

Downloading GitHub repo Stan125/GREA@master

from URL https://api.github.com/repos/Stan125/GREA/zipball/master

Installing GREA

"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" --no-site-file --no-environ --no-save  \

  --no-restore --quiet CMD INSTALL  \

  
"C:/Users/mandersk/AppData/Local/Temp/RtmpSEKk1L/devtools18e0379148ae/Stan125-GREA-e80db34"
  \

  --library="\\unetna01/mandersk$/Daten/R/win-library/3.3" --install-tests



* installing *source* package 'GREA' ...

** R

** inst

** preparing package for lazy loading

** help

*** installing help indices

** building package indices

** testing if installed package can be loaded

*** arch - i386

Warnung in library(pkg_name, lib.loc = lib, character.only = TRUE, 
logical.return = TRUE)

  there is no package called 'GREA'

Fehler: Laden fehlgeschlagen

Ausf�hrung angehalten

*** arch - x64

Warnung in library(pkg_name, lib.loc = lib, character.only = TRUE, 
logical.return = TRUE)

  there is no package called 'GREA'

Fehler: Laden fehlgeschlagen

Ausf�hrung angehalten

ERROR: loading failed for 'i386', 'x64'

* removing '\\unetna01/mandersk$/Daten/R/win-library/3.3/GREA'

Error: Command failed (1)

any suggestions??
thanks, k@

[[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] I can't see my questions and their answers in this mailing list !

2016-07-18 Thread Ivan Calandra

Hi Jean,

This question made it to the list at last. My answer probably 
(hopefully) will.
But I cannot tell you why your previous attempts did not work. Have your 
questions been moderated...?


Ivan

--
Ivan Calandra, PhD
Scientific Mediator
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calan...@univ-reims.fr
--
https://www.researchgate.net/profile/Ivan_Calandra
https://publons.com/author/705639/

Le 18/07/2016 à 10:24, MAURICE Jean - externe a écrit :

HI,

I tried, for some months, to ask questions on this list. I think that my 
questions are 'sent somewhere' because I received answers for them in private 
but not via the list and I don't see neither my questions neither your answers 
on the list.. What am I doing wrong ?

Jean in France




Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à 
l'intention exclusive des destinataires et les informations qui y figurent sont 
strictement confidentielles. Toute utilisation de ce Message non conforme à sa 
destination, toute diffusion ou toute publication totale ou partielle, est 
interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le 
copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si 
vous avez reçu ce Message par erreur, merci de le supprimer de votre système, 
ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support 
que ce soit. Nous vous remercions également d'en avertir immédiatement 
l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie 
électronique arrivent en temps utile, sont sécurisées ou dénuées de toute 
erreur ou virus.


This message and any attachments (the 'Message') are intended solely for the 
addressees. The information contained in this Message is confidential. Any use 
of information contained in this Message not in accord with its purpose, any 
dissemination or disclosure, either whole or partial, is prohibited except 
formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any 
part of it. If you have received this message in error, please delete it and 
all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or 
virus-free.


__
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] I can't see my questions and their answers in this mailing list !

2016-07-18 Thread MAURICE Jean - externe
Hi Ivan : I can see your answer on the list (but not my question!).
The thing I have done this time is to send my question to both @ 
r-help@r-project.org and r-help-boun...@r-project.org

I don't think my previous questions were moderated : they were strictly about R 
problems.

Thank Ivan
Jean in France

PS Mais peut-être que le chemin de Reims à Grenoble est plus court 



Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à 
l'intention exclusive des destinataires et les informations qui y figurent sont 
strictement confidentielles. Toute utilisation de ce Message non conforme à sa 
destination, toute diffusion ou toute publication totale ou partielle, est 
interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le 
copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si 
vous avez reçu ce Message par erreur, merci de le supprimer de votre système, 
ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support 
que ce soit. Nous vous remercions également d'en avertir immédiatement 
l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie 
électronique arrivent en temps utile, sont sécurisées ou dénuées de toute 
erreur ou virus.


This message and any attachments (the 'Message') are intended solely for the 
addressees. The information contained in this Message is confidential. Any use 
of information contained in this Message not in accord with its purpose, any 
dissemination or disclosure, either whole or partial, is prohibited except 
formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any 
part of it. If you have received this message in error, please delete it and 
all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or 
virus-free.

__
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] I can't see my questions and their answers in this mailing list !

2016-07-18 Thread Ivan Calandra

Jean,

I got an idea. In the mailing list membership configuration, there is an 
option called " Receive your own posts to the list?". Yours might be 
turned off.


Follow this link to edit your subscription (at the end of each e-mail): 
https://stat.ethz.ch/mailman/listinfo/r-help


HTH,
Ivan

--
Ivan Calandra, PhD
Scientific Mediator
University of Reims Champagne-Ardenne
GEGENAA - EA 3795
CREA - 2 esplanade Roland Garros
51100 Reims, France
+33(0)3 26 77 36 89
ivan.calan...@univ-reims.fr
--
https://www.researchgate.net/profile/Ivan_Calandra
https://publons.com/author/705639/

Le 18/07/2016 à 11:15, MAURICE Jean - externe a écrit :

Hi Ivan : I can see your answer on the list (but not my question!).
The thing I have done this time is to send my question to both @ 
r-help@r-project.org and r-help-boun...@r-project.org

I don't think my previous questions were moderated : they were strictly about R 
problems.

Thank Ivan
Jean in France

PS Mais peut-être que le chemin de Reims à Grenoble est plus court 



Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à 
l'intention exclusive des destinataires et les informations qui y figurent sont 
strictement confidentielles. Toute utilisation de ce Message non conforme à sa 
destination, toute diffusion ou toute publication totale ou partielle, est 
interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le 
copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si 
vous avez reçu ce Message par erreur, merci de le supprimer de votre système, 
ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support 
que ce soit. Nous vous remercions également d'en avertir immédiatement 
l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie 
électronique arrivent en temps utile, sont sécurisées ou dénuées de toute 
erreur ou virus.


This message and any attachments (the 'Message') are intended solely for the 
addressees. The information contained in this Message is confidential. Any use 
of information contained in this Message not in accord with its purpose, any 
dissemination or disclosure, either whole or partial, is prohibited except 
formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any 
part of it. If you have received this message in error, please delete it and 
all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or 
virus-free.

__
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] intersection of two polygons which are not shapefiles

2016-07-18 Thread Adrienne Wootten
All,

Greetings! I hope things are going well for all!  I apologize if someone's
already answered this and I'm just not finding it.  Here's what I'd like to
do, but I'm hitting a brick wall with it.

I have two sets of points for which I've already determined which ones
points for the boundaries with the chull function.  What I need for what
I'm doing is the coordinates where the two resulting polygons overlap.
These are not raster grids, nor shapefiles.  What I have to work with are
the two data frames with the points at the vertices of each polygon
(included below).

> chx1
  x  y
1  0.5822569 -0.878
2  0.5338428 -0.5883604
3 -0.3442943 -0.6701115
4  -0.7409293  0.2286962
5  0.2147221  0.8061485
6  0.4914146  0.4941865
7  0.5822569 -0.878

> chx2
  x  y
1  0.7163506 -0.4357497
2  0.6513128 -0.5395180
3   0.1818315 -0.6317423
4  -0.6394281 -0.5765610
5 -0.6044681  0.1831627
6 -0.5799485  0.3231473
7  0.2248476  0.9601908
8  0.7163506 -0.4357497


If anyone has any ideas on how to get what I'm after I'd appreciate it!
I've tried a lot of things from the raster, rgeos, and more.  Knowing me
it's something obvious I'm just not seeing right now.

Thanks all!
Adrienne


-- 
Adrienne Wootten
Ph.D Candidate / Graduate Research Assistant
State Climate Office of North Carolina
Department of Marine, Earth and Atmospheric Sciences
North Carolina State University

[[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] I can't see my questions and their answers in this mailing list !

2016-07-18 Thread S Ellison
> I got an idea. In the mailing list membership configuration, there is an 
> option
> called " Receive your own posts to the list?". Yours might be turned off.

(At least) one other issue might be intruding: I found recently that our chosen 
email filter had been instructed to use indiscriminate spoofing detection, 
which at least by default it does without notification or warning*. I found 
after a mystifying absence of own posts that this is recognising _all_ my own 
posts to R-help as spoofed emails because of the (perfectly reasonable) policy 
of showing the OP's email in the 'from' field. It was unfortunately set to do 
so without notification or warning. For this particular filtering product, 
whitelisting R-help does not fix the problem - the product ignores the 
originating server information when whitelisting. They seem to have forgotten 
that legitimate mailing lists exist.

Presumably other email filtering products could be doing the same. 

S Ellison

*To be fair to the product**, an email report is available - if you go to the 
relevant web portal and manually request it. Of course, the only reason you'd 
do that is if you know that it's needed and where the website is. You may have 
to ask your IT staff about that.

**Which I am very happy to identify on an individual basis if you think this 
might be your problem.




***
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] findAssocs in TM package in R help?

2016-07-18 Thread Duncan Murdoch

On 18/07/2016 10:17 AM, Shivi Bhatia wrote:

Hi Duncan,

This is no homework, i am asking for a package a solution or other
measures to achieve this. I am not asking for a homework or to have some
one else do the work for me.


Sorry, "text mining assignment" sounded like homework to me.  But some 
assignments aren't homework.


Duncan Murdoch



On Mon, Jul 18, 2016 at 5:09 AM, Duncan Murdoch
mailto:murdoch.dun...@gmail.com>> wrote:

On 17/07/2016 6:31 PM, Shivi Bhatia wrote:

Hi Team,

Please suggest.

On Sun, Jul 17, 2016 at 2:55 AM, Shivi Bhatia
mailto:shivipm...@gmail.com>> wrote:

Good Day,

I am working on a text mining assignment and have built the
document
matrix using the tm package.


We don't do homework here.  You should ask your instructor for help.

Duncan Murdoch


Now I need to run findAssocs from my dtm with some word say
'like' with a
correlation of 0.70 but  as far as i have been researching
it tells it this
function is only viable when we have more than 1 doc however
in my case i
only have 1. So please suggest if there is an alternate to
this issue.

This is because there are words that correlate to each other
in the data I
am dealing with.

Kindly advice.


[[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] intersection of two polygons which are not shapefiles

2016-07-18 Thread S Ellison
> I have two sets of points for which I've already determined which ones points
> for the boundaries with the chull function.  What I need for what I'm doing is
> the coordinates where the two resulting polygons overlap.

There's a relevant answer on mathoverflow that might help if you're thinking of 
writing code: see
http://mathoverflow.net/questions/130577/how-to-find-overlap-between-two-convex-hulls-along-with-the-overlap-area.
 

The other 'obvious' approach is to find one of the various shapefile packages 
in R, convert your chull to such an object and use something like 
gIntersection() from rgeos or intersect from raster (see 
http://gis.stackexchange.com/questions/140504/extracting-intersection-areas-in-r)

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.


[R] Install R version 3.3 on Debian server

2016-07-18 Thread Mbr Mbr
Hello,

I'm currently in a internship and I'm working on a Debian server.
However, I have some errors in my scripts and I think it's because of the
version of R installed on the server (works well on my PC with the latest
version of R on Windows aka 3.3.1).

Here are the details from sessionInfo() of the server :

   - R version 2.15.1 (2012-06-22)
   - Platform : i486-pc-linux-gnu (32 bit)

Since I'm totally a beginner about Linux server and my internship's tutor
doesn't want to read the tutorial to install R for Debian (even if the
server is his) or help for this tank for some unknown reason, I would like
to know how to upgrade the current R version on the server (from 2.15.1 to
3.3).

Thanks in advance

Sincelerly,

Mbr

[[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 code, heat wave statistics

2016-07-18 Thread Damjan /
Dar all,

I have a txt file with 4 column data about daily maximum temperature for
some years.

I need to find the number of heat waves and :

Average (+ standard deviation) and maximum duration of the heatwave, · The
number of heat waves, · The number of days in the summer heat wave .

txt file is like this:

  year  month   day   temmax 1879 1 1 7,8 1879 1 2 7,5 1879 1 3 5,6 1879 1
4 6,2 1879 1 5 4 1879 1 6 -0,9 1879 1 7 -3 1879 1 8 -2,6 1879 1 9 -4,6 1879
1 10 -3,2 1879 1 11 -0,4 1879 1 12 3 1879 1 13 1,2 1879 1 14 -1,4 1879 1 15
0 1879 1 16 -2,4 1879 1 17 -3 1879 1 18 0,5 1879 1 19 0,6 1879 1 20 -2,6

[[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] color problem barplot

2016-07-18 Thread Abdoulaye SARR
I am doing a basic bar plot which works but the color of bars positive (green) 
and negative (brown) don’t show up from the below command:

barplot(z, ylim=c(-2,2), col=ifelse(x>0,"brown","green »))

any help? or other methods?

asarr
__
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] means by year, month and day

2016-07-18 Thread Tom Mosca
Dear Jim,



I'm very inexperienced with R.



I'm sorry I failed to recognize the flaw in my example.  I just clipped the 
first few lines of data, and should have realized that they were for the first 
few hours of a single day.



My first problem was to take the means by day.  As all the data come from a 
single year, I accomplished the goal by using:

> datATMP<-aggregate(mydata, by=mydata[c("MM","DD")], FUN=mean)



My second problem was to sort the results by month, for which I used:

> attach(datATMP)
> datATMP1 <- datATMP[order(MM),]
> datATMP1
> detach(datATMP)



I have read that I should avoid using attach(), and should use with() instead.  
However, I have not yet figured out how to do this with with().  I'm only 
running short segments of code, and think I'll be alright with attach() for the 
time being, but do want to develop better form.  So, I'll keep working on it.



Thank you for your kind response and examples.  I will study them.



Sincerely, Tom






From: jim holtman [jholt...@gmail.com]
Sent: Sunday, July 17, 2016 7:14 PM
To: Jianling Fan
Cc: Tom Mosca; r-help@r-project.org
Subject: Re: [R] means by year, month and day

Here is an example of using dplyr.  Please provide a reasonable subset of data. 
 Your was all for the same date.  Use 'dput' to put in your email.

> x <- read.table(text = " X.YY MM DD hh WDI R.WSP D.GST   PRES  ATMP  DEWP
+   2015  1  1  0 328   3.6   4.5 1028.0   3.8  -3.5
+   2015  1  1  1 300   2.1   2.7 1027.9   3.7  -4.4
+   2015  1  1  2 264   2.4   2.9 1027.7   3.6  -4.5
+   2015  1  1  3 230   4.1   4.5 1027.4   4.2  -3.8
+   2015  1  1  4 242   8.1   9.2 1026.6   4.4  -3.1
+   2015  1  1  5 262   9.3  10.1 1026.6   4.1  -3.8
+   2015  1  1  6 267   8.6   9.6 1026.3   4.2  -3.8
+   2015  1  1  7 264   9.3   9.9 1026.1   3.9  -2.8
+   2015  1  1  8 268   8.2   9.1 1026.1   3.5  -3.0
+   2015  1  1  9 272   8.8   9.6 1025.4   3.2  -3.3
+   2015  2  1  0 328   3.6   4.5 1028.0   3.8  -3.5
+   2015  2  1  1 300   2.1   2.7 1027.9   3.7  -4.4
+   2015  2  1  2 264   2.4   2.9 1027.7   3.6  -4.5
+   2015  2  1  3 230   4.1   4.5 1027.4   4.2  -3.8
+   2015  2  1  4 242   8.1   9.2 1026.6   4.4  -3.1
+   2015  2  1  5 262   9.3  10.1 1026.6   4.1  -3.8
+   2015  2  1  6 267   8.6   9.6 1026.3   4.2  -3.8
+   2015  2  1  7 264   9.3   9.9 1026.1   3.9  -2.8
+   2015  2  1  8 268   8.2   9.1 1026.1   3.5  -3.0
+   2015  2  1  9 272   8.8   9.6 1025.4   3.2  -3.3
+   2015  3  1  0 328   3.6   4.5 1028.0   3.8  -3.5
+   2015  3  1  1 300   2.1   2.7 1027.9   3.7  -4.4
+   2015  3  1  2 264   2.4   2.9 1027.7   3.6  -4.5
+   2015  3  1  3 230   4.1   4.5 1027.4   4.2  -3.8
+   2015  3  1  4 242   8.1   9.2 1026.6   4.4  -3.1
+   2015  3  1  5 262   9.3  10.1 1026.6   4.1  -3.8
+   2015  3  1  6 267   8.6   9.6 1026.3   4.2  -3.8
+   2015  3  1  7 264   9.3   9.9 1026.1   3.9  -2.8
+   2015  3  1  8 268   8.2   9.1 1026.1   3.5  -3.0
+   2015  3  1  9 272   8.8   9.6 1025.4   3.2  -3.3
+  ",
+  header = TRUE,
+  as.is = TRUE)
>
>  library(dplyr)
>  by_year <- x %>%
+ group_by(X.YY) %>%
+ summarise_each(funs(mean))
>
>  by_ym <- x %>%
+ group_by(X.YY, MM ) %>%
+ summarise_each(funs(mean))
>
>  by_ymd <- x %>%
+ group_by(X.YY, MM, DD) %>%
+ summarise_each(funs(mean))
>
> by_year
Source: local data frame [1 x 10]
   X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
 
1  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> by_ym
Source: local data frame [3 x 10]
Groups: X.YY [?]
   X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
 
1  2015 1 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
2  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
3  2015 3 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> by_ymd
Source: local data frame [3 x 10]
Groups: X.YY, MM [?]
   X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
 
1  2015 1 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
2  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
3  2015 3 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
>


Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

On Sun, Jul 17, 2016 at 5:42 PM, Jianling Fan 
mailto:fanjianl...@gmail.com>> wrote:
Hello Tom,

try aggregate() or cast(). Both works.I prefer the latter.


library(reshape)
desc<-melt(mydata, measure.vars=c("WDI","R.WSP", "D.GST", "PRES",
"ATMP", "DEWP"),
   id.vars=c("X.YY","MM","DD"))
summary<-cast(desc, X.YY+MM+DD~variable, mean)









On 17 July 2016 at 06:22, Tom Mosca mailto:t...@vims.edu>> wrote:
> Hello Good Folk,
>
> My dataframe looks like this:
>> mydata
>  X.YY MM DD hh WDI R.WSP D.GST   PRES  ATMP  DEWP
> 12015  1  1  0 328   3.6   4.5 1028.0   3.8  -3.5
> 22015  1  1  1 300 

Re: [R] means by year, month and day

2016-07-18 Thread William Dunlap via R-help
If you are very inexperienced with R you still have time to forget you ever
heard
of the attach function.  Your code
> attach(datATMP)
> datATMP1 <- datATMP[order(MM),]
> detach(datATMP)
can be replaced by
> datATMP1 <- datATMP[order(datATMP[["MM"]]),]


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Mon, Jul 18, 2016 at 6:18 AM, Tom Mosca  wrote:

> Dear Jim,
>
>
>
> I'm very inexperienced with R.
>
>
>
> I'm sorry I failed to recognize the flaw in my example.  I just clipped
> the first few lines of data, and should have realized that they were for
> the first few hours of a single day.
>
>
>
> My first problem was to take the means by day.  As all the data come from
> a single year, I accomplished the goal by using:
>
> > datATMP<-aggregate(mydata, by=mydata[c("MM","DD")], FUN=mean)
>
>
>
> My second problem was to sort the results by month, for which I used:
>
> > attach(datATMP)
> > datATMP1 <- datATMP[order(MM),]
> > datATMP1
> > detach(datATMP)
>
>
>
> I have read that I should avoid using attach(), and should use with()
> instead.  However, I have not yet figured out how to do this with with().
> I'm only running short segments of code, and think I'll be alright with
> attach() for the time being, but do want to develop better form.  So, I'll
> keep working on it.
>
>
>
> Thank you for your kind response and examples.  I will study them.
>
>
>
> Sincerely, Tom
>
>
>
>
>
> 
> From: jim holtman [jholt...@gmail.com]
> Sent: Sunday, July 17, 2016 7:14 PM
> To: Jianling Fan
> Cc: Tom Mosca; r-help@r-project.org
> Subject: Re: [R] means by year, month and day
>
> Here is an example of using dplyr.  Please provide a reasonable subset of
> data.  Your was all for the same date.  Use 'dput' to put in your email.
>
> > x <- read.table(text = " X.YY MM DD hh WDI R.WSP D.GST   PRES  ATMP
> DEWP
> +   2015  1  1  0 328   3.6   4.5 1028.0   3.8  -3.5
> +   2015  1  1  1 300   2.1   2.7 1027.9   3.7  -4.4
> +   2015  1  1  2 264   2.4   2.9 1027.7   3.6  -4.5
> +   2015  1  1  3 230   4.1   4.5 1027.4   4.2  -3.8
> +   2015  1  1  4 242   8.1   9.2 1026.6   4.4  -3.1
> +   2015  1  1  5 262   9.3  10.1 1026.6   4.1  -3.8
> +   2015  1  1  6 267   8.6   9.6 1026.3   4.2  -3.8
> +   2015  1  1  7 264   9.3   9.9 1026.1   3.9  -2.8
> +   2015  1  1  8 268   8.2   9.1 1026.1   3.5  -3.0
> +   2015  1  1  9 272   8.8   9.6 1025.4   3.2  -3.3
> +   2015  2  1  0 328   3.6   4.5 1028.0   3.8  -3.5
> +   2015  2  1  1 300   2.1   2.7 1027.9   3.7  -4.4
> +   2015  2  1  2 264   2.4   2.9 1027.7   3.6  -4.5
> +   2015  2  1  3 230   4.1   4.5 1027.4   4.2  -3.8
> +   2015  2  1  4 242   8.1   9.2 1026.6   4.4  -3.1
> +   2015  2  1  5 262   9.3  10.1 1026.6   4.1  -3.8
> +   2015  2  1  6 267   8.6   9.6 1026.3   4.2  -3.8
> +   2015  2  1  7 264   9.3   9.9 1026.1   3.9  -2.8
> +   2015  2  1  8 268   8.2   9.1 1026.1   3.5  -3.0
> +   2015  2  1  9 272   8.8   9.6 1025.4   3.2  -3.3
> +   2015  3  1  0 328   3.6   4.5 1028.0   3.8  -3.5
> +   2015  3  1  1 300   2.1   2.7 1027.9   3.7  -4.4
> +   2015  3  1  2 264   2.4   2.9 1027.7   3.6  -4.5
> +   2015  3  1  3 230   4.1   4.5 1027.4   4.2  -3.8
> +   2015  3  1  4 242   8.1   9.2 1026.6   4.4  -3.1
> +   2015  3  1  5 262   9.3  10.1 1026.6   4.1  -3.8
> +   2015  3  1  6 267   8.6   9.6 1026.3   4.2  -3.8
> +   2015  3  1  7 264   9.3   9.9 1026.1   3.9  -2.8
> +   2015  3  1  8 268   8.2   9.1 1026.1   3.5  -3.0
> +   2015  3  1  9 272   8.8   9.6 1025.4   3.2  -3.3
> +  ",
> +  header = TRUE,
> +  as.is = TRUE)
> >
> >  library(dplyr)
> >  by_year <- x %>%
> + group_by(X.YY) %>%
> + summarise_each(funs(mean))
> >
> >  by_ym <- x %>%
> + group_by(X.YY, MM ) %>%
> + summarise_each(funs(mean))
> >
> >  by_ymd <- x %>%
> + group_by(X.YY, MM, DD) %>%
> + summarise_each(funs(mean))
> >
> > by_year
> Source: local data frame [1 x 10]
>X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
>  
> 1  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> > by_ym
> Source: local data frame [3 x 10]
> Groups: X.YY [?]
>X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
>  
> 1  2015 1 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> 2  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> 3  2015 3 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> > by_ymd
> Source: local data frame [3 x 10]
> Groups: X.YY, MM [?]
>X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
>  
> 1  2015 1 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> 2  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> 3  2015 3 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> >
>
>
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
> On Sun, Jul 17, 20

Re: [R] R code, heat wave statistics

2016-07-18 Thread Christopher W Ryan
I think much depends on how you define heat wave.

--Chris Ryan
Broome County Health Department
Binghamton, NY USA

On Mon, Jul 18, 2016 at 6:16 AM, Damjan /  wrote:
> Dar all,
>
> I have a txt file with 4 column data about daily maximum temperature for
> some years.
>
> I need to find the number of heat waves and :
>
> Average (+ standard deviation) and maximum duration of the heatwave, · The
> number of heat waves, · The number of days in the summer heat wave .
>
> txt file is like this:
>
>   year  month   day   temmax 1879 1 1 7,8 1879 1 2 7,5 1879 1 3 5,6 1879 1
> 4 6,2 1879 1 5 4 1879 1 6 -0,9 1879 1 7 -3 1879 1 8 -2,6 1879 1 9 -4,6 1879
> 1 10 -3,2 1879 1 11 -0,4 1879 1 12 3 1879 1 13 1,2 1879 1 14 -1,4 1879 1 15
> 0 1879 1 16 -2,4 1879 1 17 -3 1879 1 18 0,5 1879 1 19 0,6 1879 1 20 -2,6
>
> [[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] Install R version 3.3 on Debian server

2016-07-18 Thread Martin Maechler
> Mbr Mbr 
> on Mon, 18 Jul 2016 11:45:00 +0200 writes:

> Hello,
> I'm currently in a internship and I'm working on a Debian server.
> However, I have some errors in my scripts and I think it's because of the
> version of R installed on the server (works well on my PC with the latest
> version of R on Windows aka 3.3.1).

> Here are the details from sessionInfo() of the server :

> - R version 2.15.1 (2012-06-22)
> - Platform : i486-pc-linux-gnu (32 bit)

Yes,  2.15.1  is considered antique,  and nobody should be using
it unless for "Rchaelogy" (the pre-history and history of R
implementations), and so I do occasionally start such a version.

> Since I'm totally a beginner about Linux server and my internship's tutor
> doesn't want to read the tutorial to install R for Debian (even if the
> server is his) or help for this tank for some unknown reason, I would like
> to know how to upgrade the current R version on the server (from 2.15.1 to
> 3.3).

Very good proposal.
Two things:

- We have a *dedicated* mailing list for Debian (and
  Debian-derived such as "ubuntu") Linux distributions:
  --> https://www.R-project.org/mail.html does list the "SIG"
  (Special Interest Groups), including R-SIG-Debian
  which points to http://stat.ethz.ch/mailman/listinfo/r-sig-debian

- CRAN itself has sections about this, notably
  https://cloud.r-project.org/bin/linux/debian/
  will tell you how to tell your debian system to get R from
  CRAN as opposed from the debian repositories.
  

> Thanks in advance

You are welcome,
Martin Maechler

> Sincelerly,
> Mbr

> [[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] means by year, month and day

2016-07-18 Thread Tom Mosca
Dear William,



The line of code you composed works perfectly, as you knew it would.  Thank you 
for your kind response.  I will now endeavor to forget that other function 
exists.



Sincerely, Tom


From: William Dunlap [wdun...@tibco.com]
Sent: Monday, July 18, 2016 12:14 PM
To: Tom Mosca
Cc: jim holtman; Jianling Fan; r-help@r-project.org
Subject: Re: [R] means by year, month and day

If you are very inexperienced with R you still have time to forget you ever 
heard
of the attach function.  Your code
> attach(datATMP)
> datATMP1 <- datATMP[order(MM),]
> detach(datATMP)
can be replaced by
> datATMP1 <- datATMP[order(datATMP[["MM"]]),]


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Mon, Jul 18, 2016 at 6:18 AM, Tom Mosca 
mailto:t...@vims.edu>> wrote:
Dear Jim,



I'm very inexperienced with R.



I'm sorry I failed to recognize the flaw in my example.  I just clipped the 
first few lines of data, and should have realized that they were for the first 
few hours of a single day.



My first problem was to take the means by day.  As all the data come from a 
single year, I accomplished the goal by using:

> datATMP<-aggregate(mydata, by=mydata[c("MM","DD")], FUN=mean)



My second problem was to sort the results by month, for which I used:

> attach(datATMP)
> datATMP1 <- datATMP[order(MM),]
> datATMP1
> detach(datATMP)



I have read that I should avoid using attach(), and should use with() instead.  
However, I have not yet figured out how to do this with with().  I'm only 
running short segments of code, and think I'll be alright with attach() for the 
time being, but do want to develop better form.  So, I'll keep working on it.



Thank you for your kind response and examples.  I will study them.



Sincerely, Tom






From: jim holtman [jholt...@gmail.com]
Sent: Sunday, July 17, 2016 7:14 PM
To: Jianling Fan
Cc: Tom Mosca; r-help@r-project.org
Subject: Re: [R] means by year, month and day

Here is an example of using dplyr.  Please provide a reasonable subset of data. 
 Your was all for the same date.  Use 'dput' to put in your email.

> x <- read.table(text = " X.YY MM DD hh WDI R.WSP D.GST   PRES  ATMP  DEWP
+   2015  1  1  0 328   3.6   4.5 1028.0   3.8  -3.5
+   2015  1  1  1 300   2.1   2.7 1027.9   3.7  -4.4
+   2015  1  1  2 264   2.4   2.9 1027.7   3.6  -4.5
+   2015  1  1  3 230   4.1   4.5 1027.4   4.2  -3.8
+   2015  1  1  4 242   8.1   9.2 1026.6   4.4  -3.1
+   2015  1  1  5 262   9.3  10.1 1026.6   4.1  -3.8
+   2015  1  1  6 267   8.6   9.6 1026.3   4.2  -3.8
+   2015  1  1  7 264   9.3   9.9 1026.1   3.9  -2.8
+   2015  1  1  8 268   8.2   9.1 1026.1   3.5  -3.0
+   2015  1  1  9 272   8.8   9.6 1025.4   3.2  -3.3
+   2015  2  1  0 328   3.6   4.5 1028.0   3.8  -3.5
+   2015  2  1  1 300   2.1   2.7 1027.9   3.7  -4.4
+   2015  2  1  2 264   2.4   2.9 1027.7   3.6  -4.5
+   2015  2  1  3 230   4.1   4.5 1027.4   4.2  -3.8
+   2015  2  1  4 242   8.1   9.2 1026.6   4.4  -3.1
+   2015  2  1  5 262   9.3  10.1 1026.6   4.1  -3.8
+   2015  2  1  6 267   8.6   9.6 1026.3   4.2  -3.8
+   2015  2  1  7 264   9.3   9.9 1026.1   3.9  -2.8
+   2015  2  1  8 268   8.2   9.1 1026.1   3.5  -3.0
+   2015  2  1  9 272   8.8   9.6 1025.4   3.2  -3.3
+   2015  3  1  0 328   3.6   4.5 1028.0   3.8  -3.5
+   2015  3  1  1 300   2.1   2.7 1027.9   3.7  -4.4
+   2015  3  1  2 264   2.4   2.9 1027.7   3.6  -4.5
+   2015  3  1  3 230   4.1   4.5 1027.4   4.2  -3.8
+   2015  3  1  4 242   8.1   9.2 1026.6   4.4  -3.1
+   2015  3  1  5 262   9.3  10.1 1026.6   4.1  -3.8
+   2015  3  1  6 267   8.6   9.6 1026.3   4.2  -3.8
+   2015  3  1  7 264   9.3   9.9 1026.1   3.9  -2.8
+   2015  3  1  8 268   8.2   9.1 1026.1   3.5  -3.0
+   2015  3  1  9 272   8.8   9.6 1025.4   3.2  -3.3
+  ",
+  header = TRUE,
+  as.is = TRUE)
>
>  library(dplyr)
>  by_year <- x %>%
+ group_by(X.YY) %>%
+ summarise_each(funs(mean))
>
>  by_ym <- x %>%
+ group_by(X.YY, MM ) %>%
+ summarise_each(funs(mean))
>
>  by_ymd <- x %>%
+ group_by(X.YY, MM, DD) %>%
+ summarise_each(funs(mean))
>
> by_year
Source: local data frame [1 x 10]
   X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
 
1  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> by_ym
Source: local data frame [3 x 10]
Groups: X.YY [?]
   X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
 
1  2015 1 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
2  2015 2 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
3  2015 3 1   4.5 269.7  6.45  7.21 1026.81  3.86  -3.6
> by_ymd
Source: local data frame [3 x 10]
Groups: X.YY, MM [?]
   X.YYMMDDhh   WDI R.WSP D.GSTPRES  ATMP  DEWP
 
1  2015 1 1   4.5 269.7  6.45  7.21 1026

[R] barplot colour problem

2016-07-18 Thread Abdoulaye Sarr
I am doing a basic bar plot which works but the color of bars positive
(green) and negative (brown) don’t show up from the below command:

barplot(z, ylim=c(-2,2), col=ifelse(x>0,"brown","green »))

any help? or other methods?

fipou

[[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] barplot colour problem

2016-07-18 Thread Marc Schwartz

> On Jul 18, 2016, at 1:06 PM, Abdoulaye Sarr  wrote:
> 
> I am doing a basic bar plot which works but the color of bars positive
> (green) and negative (brown) don’t show up from the below command:
> 
> barplot(z, ylim=c(-2,2), col=ifelse(x>0,"brown","green »))
> 
> any help? or other methods?
> 
> fipou


Presuming that the above is a direct copy and paste, your ifelse() statement is 
using 'x' to determine the color, rather than 'z'. Presumably a typo?

This works, for example, with 'z' as a vector:

  z <- seq(from = -5, to = 5)

  barplot(z, col = ifelse(z > 0, "brown", "green"))


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.

Re: [R] [FORGED] intersection of two polygons which are not shapefiles

2016-07-18 Thread Rolf Turner

On 19/07/16 01:16, Adrienne Wootten wrote:

All,

Greetings! I hope things are going well for all!  I apologize if someone's
already answered this and I'm just not finding it.  Here's what I'd like to
do, but I'm hitting a brick wall with it.

I have two sets of points for which I've already determined which ones
points for the boundaries with the chull function.  What I need for what
I'm doing is the coordinates where the two resulting polygons overlap.
These are not raster grids, nor shapefiles.  What I have to work with are
the two data frames with the points at the vertices of each polygon
(included below).


chx1

  x  y
1  0.5822569 -0.878
2  0.5338428 -0.5883604
3 -0.3442943 -0.6701115
4  -0.7409293  0.2286962
5  0.2147221  0.8061485
6  0.4914146  0.4941865
7  0.5822569 -0.878


chx2

  x  y
1  0.7163506 -0.4357497
2  0.6513128 -0.5395180
3   0.1818315 -0.6317423
4  -0.6394281 -0.5765610
5 -0.6044681  0.1831627
6 -0.5799485  0.3231473
7  0.2248476  0.9601908
8  0.7163506 -0.4357497


If anyone has any ideas on how to get what I'm after I'd appreciate it!
I've tried a lot of things from the raster, rgeos, and more.  Knowing me
it's something obvious I'm just not seeing right now.


You can do this very easily using the spatstat package:

library(spatstat)
X1 <- read.table(textConnection("
 x  y
1  0.5822569 -0.878
2  0.5338428 -0.5883604
3 -0.3442943 -0.6701115
4  -0.7409293  0.2286962
5  0.2147221  0.8061485
6  0.4914146  0.4941865
7  0.5822569 -0.878"))

X2 <- read.table(textConnection("
   x  y
1  0.7163506 -0.4357497
2  0.6513128 -0.5395180
3   0.1818315 -0.6317423
4  -0.6394281 -0.5765610
5 -0.6044681  0.1831627
6 -0.5799485  0.3231473
7  0.2248476  0.9601908
8  0.7163506 -0.4357497"))

X1 <- reverse.xypolygon(X1) # Vertices are in the wrong
X2 <- reverse.xypolygon(X2) # (clockwise) order.
W1 <- owin(poly=X1)
W2 <- owin(poly=X2)
WI <- intersect.owin(W1,W2)

plot(union.owin(W1,W2),col="blue",main="")
plot(WI,add=TRUE,col="red")

HTH

cheers,

Rolf Turner

P.S.  To extract the coordinates of the intersection polygon you can do:

WI$bdry[[1]]

R. T.

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
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] [FORGED] Re: R code, heat wave statistics

2016-07-18 Thread Rolf Turner


On 19/07/16 04:58, Christopher W Ryan wrote:


I think much depends on how you define heat wave.

--Chris Ryan
Broome County Health Department
Binghamton, NY USA


Check out:

@Article{Wong:2015:ASA,
  author =   {T. S. T. Wong},
  title ={Statistical Analysis of Heat Waves in
 the State of {Victoria} in {Australia}},
  journal =  {Australian \& New Zealand Journal of Statistics},
  volume =   {57},
  pages ={463--480},
  year = {2015}
}

for some relevant discussion.

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276



On Mon, Jul 18, 2016 at 6:16 AM, Damjan /  wrote:

Dar all,

I have a txt file with 4 column data about daily maximum temperature for
some years.

I need to find the number of heat waves and :

Average (+ standard deviation) and maximum duration of the heatwave, · The
number of heat waves, · The number of days in the summer heat wave .

txt file is like this:

  year  month   day   temmax 1879 1 1 7,8 1879 1 2 7,5 1879 1 3 5,6 1879 1
4 6,2 1879 1 5 4 1879 1 6 -0,9 1879 1 7 -3 1879 1 8 -2,6 1879 1 9 -4,6 1879
1 10 -3,2 1879 1 11 -0,4 1879 1 12 3 1879 1 13 1,2 1879 1 14 -1,4 1879 1 15
0 1879 1 16 -2,4 1879 1 17 -3 1879 1 18 0,5 1879 1 19 0,6 1879 1 20 -2,6


__
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] barplot colour problem

2016-07-18 Thread Abdoulaye Sarr
Thank you Marc,

The typo was causing the problem, solved now.

Regards,
Fipou

On Mon, Jul 18, 2016 at 8:38 PM, Marc Schwartz  wrote:

>
> > On Jul 18, 2016, at 1:06 PM, Abdoulaye Sarr 
> wrote:
> >
> > I am doing a basic bar plot which works but the color of bars positive
> > (green) and negative (brown) don’t show up from the below command:
> >
> > barplot(z, ylim=c(-2,2), col=ifelse(x>0,"brown","green »))
> >
> > any help? or other methods?
> >
> > fipou
>
>
> Presuming that the above is a direct copy and paste, your ifelse()
> statement is using 'x' to determine the color, rather than 'z'. Presumably
> a typo?
>
> This works, for example, with 'z' as a vector:
>
>   z <- seq(from = -5, to = 5)
>
>   barplot(z, col = ifelse(z > 0, "brown", "green"))
>
>
> Regards,
>
> Marc Schwartz
>
>
>

[[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] Anova() type iii SS plots and diagnostics

2016-07-18 Thread Pamela Wong
I am wondering if there is a way to plot results and model diagnostics (to 
check for outliers, homoscedasticity, normality, collinearity) using type III 
sums of squares in R
__
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] How to plot density distribution based on mean values and quantiles in R?

2016-07-18 Thread gcchenleidenuniv
Hi all,

I need to draw density curves based on some published data. But in the article 
only mean value (0.015 ) and quantiles (Q0.15=0.012 , Q0.85=0.057) were given. 
So I was thinking if it is possible to plot density curves solely based on the 
mean value and quantiles. The dnorm(x, mean, sd, log) function needs the 
standard deviation which was not mentioned, so it can not be used in this 
situation.

Many thanks!!
Daniel
[[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] How to plot density distribution based on mean values and quantiles in R?

2016-07-18 Thread Jim Lemon
Hi Daniel,
Judging by the numbers you mention, the distribution is either very
skewed or not at all normal. If you look at this:

plot(c(0,0.012,0.015,0.057,0.07),c(0,0.05,0.4,0.05,0),type="b")

you will see the general shape of whatever distribution produced these
summary statistics. Did the paper give any hints as to what the model
distribution might be?

Jim


On Tue, Jul 19, 2016 at 7:11 AM, gcchenleidenuniv
 wrote:
> Hi all,
>
> I need to draw density curves based on some published data. But in the 
> article only mean value (0.015 ) and quantiles (Q0.15=0.012 , Q0.85=0.057) 
> were given. So I was thinking if it is possible to plot density curves solely 
> based on the mean value and quantiles. The dnorm(x, mean, sd, log) function 
> needs the standard deviation which was not mentioned, so it can not be used 
> in this situation.
>
> Many thanks!!
> Daniel
> [[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.