Dear all,
Myself Vijaykumar Muley working as senior research fellow. By training I am
a computational biologist with not a strong knowledge of statistics. I have
done some analysis which is explained as follows,
I have 10340 (X) profiles of binary vectors with same length(N=845), I will
call then "gene profiles"
for example...
v1 v2 v3 v4.....vN
a 1 0 1 0 1
b 0 0 1 0 0
c 1 0 1 1 1
d 0 1 1 1 1
e 0 0 1 1 1
. . . . ........
. . . . ........
. . . . ........
upto
10340
then I have some other binary profiles with same length (N=845), here I will
call then "expression profile";
v1 v2 v3 v4.....vN
f1 1 0 1 0 1
f2 0 0 1 0 0
f3 1 0 1 1 1
now I am comparing profile f1 with all X profiles using hypergeometic
distribution function. What I am getting is p-value(probability) of the
similarity between profile f1 and all X profiles i.e. 10340 by random chance
alone.
for example,
#pair p-value
f1,a 1e-20
f1,b 0.01
.
.
upto
f1,10340 0.05
same thing i am doing with f2 and f3.
if we arrange this data(output) in better readable format, it looks like
f1 f2 f3
a 1e-20 0.01 0.10
b 0.01 1e-9 0.02
c 1e-3 0.1 0.30
d 0.03 0.07 1e-5
e 1e-1 0.01 1e-9
. . . . ........
. . . . ........
. . . . ........
upto
10340
I hope everyone understood what type of output I am getting.
Now I want to perform multiple hypothesis comparision(P-value adjustment) on
this data , so that I will get the statistically significant associations
between various "expression profiles" and "gene profiles" at
specific alpha
level;
Most conservative method for p-value adjustment is bonferroni and many
others with less conservation, I dont care which method I use but the
problem here is
according to what parameter I should use for correct or adjust p-values ?.
so in case of Bonferroni correction,
should I multiply the each p-value with 10340 or
as I have compared 3 expression profiles against 10340 gene profiles, should
I multiply p-value with 3*10340
I am aksing this for understanding. What I want to do is
>From the above gene, p-value table, I want to calculate the percentage of
false positive rate at each p-values from 0.0001 to 0.05
So that I can use a good cutoff as significance level (alpha) to exclude the
gene profiles which are weakly associated with all expression profiles.
(If I am correct, to do this I need to use other p-value correction methods,
either simulation based, resampling or
Benjamini and Hochberg (B&H).
Please can any one suuggests me about p-value adjustment or p-value
correction, I mean statistically or technically which number should I
consider for correction, 10340 or 3 * 10340, as I have three features to
associate with same 10340 gene set. or if I am wrong, can any one tell me
the protocol which I should refer to get fair number of significant
associations between genes and expression profiles.
I am using package "multtest" for p-value adjustment but literally I
am not
getting for correction,
should I give p-values for each expression profile alone or give it all
p-values ie. 3*10340.
I have gone through many tutorials and articles for multiple hypothesis
testing but really couldnt get exactly, what is it.
Please give me some clues, some of you may be actively working on p-value
adjustment / multiple hypothesis testing, I expect some suggestions.
I will be grateful for you kind help.
sincerely,
On Sat, Mar 14, 2009 at 4:30 PM, <r-help-request@r-project.org> wrote:
> 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-request@r-project.org
>
> You can reach the person managing the list at
> r-help-owner@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: Plots not loading (Philipp Pagel)
> 2. COURSE: R and S-PLUS 1 day introduction, UK, 29 April 2009
> (Andrew Jack)
> 3. Re: How to combine xtable and minipage with Sweave ?
> (Dieter Menne)
> 4. pairs of numbers (emj83)
> 5. Re: pairs of numbers (emj83)
> 6. Re: Taking diff of character vectors (Sergey Goriatchev)
> 7. Re: print median and sd... (jim holtman)
> 8. Re: Selecting / creating unique colours for behavioural /
> transitional data (Kingsford Jones)
> 9. code to find all distinct subsets of size r from a set of
> size n (Dale Steele)
> 10. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 11. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 12. R multiline expression grief (Paul Suckling)
> 13. Re: Unable to run smoother in qplot() or ggplot() - complains
> about knots (Ista Zahn)
> 14. Re: Selecting / creating unique colours for behavioural /
> transitional data (Kingsford Jones)
> 15. Re: R multiline expression grief (jim holtman)
> 16. Re: R multiline expression grief (Thomas Lumley)
> 17. Re: cor.test(x,y) (Sarah Goslee)
> 18. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 19. Re: R multiline expression grief (Wacek Kusnierczyk)
> 20. Re: Selecting / creating unique colours for behavioural /
> transitional data (hadley wickham)
> 21. Re: code to find all distinct subsets of size r from a set of
> size n (Kingsford Jones)
> 22. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 23. Re: R multiline expression grief (Paul Suckling)
> 24. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 25. Re: R multiline expression grief (Wacek Kusnierczyk)
> 26. Re: R multiline expression grief (Gabor Grothendieck)
> 27. Re: Unable to run smoother in qplot() or ggplot() - complains
> about knots (hadley wickham)
> 28. Re: How to combine xtable and minipage with Sweave ? (Ptit_Bleu)
> 29. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 30. Re: Selecting / creating unique colours for behavioural /
> transitional data (Kingsford Jones)
> 31. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 32. Re: R multiline expression grief (Wacek Kusnierczyk)
> 33. Re: R multiline expression grief ( (Ted Harding))
> 34. Re: R multiline expression grief (Gabor Grothendieck)
> 35. Re: Is there any difference between <- and = (Alan Zaslavsky)
> 36. Re: R multiline expression grief (Wacek Kusnierczyk)
> 37. Re: Time-Ordered Clustering (Prew, Paul)
> 38. Re: Is there any difference between <- and = (Wacek Kusnierczyk)
> 39. updating packages? (rkevinburton@charter.net)
> 40. updating packages? (rkevinburton@charter.net)
> 41. Re: code to find all distinct subsets of size r from a set of
> size n (David Winsemius)
> 42. Re: updating packages? (ronggui)
> 43. Re: Is there any difference between <- and = (Alan Zaslavsky)
> 44. Re: Using package ROCR (LIMONIKA)
> 45. Re: print median and sd... (johnhj)
> 46. Re: Selecting / creating unique colours for behavioural /
> transitional data (Olivier Delaigue)
> 47. Re: [R-SIG-Finance] Problem with RBloomberg (not the usual
> one) (Voss, Kent)
> 48. Save the elements of an atomic vector to a text fil (johnhj)
> 49. Re: print median and sd... (jim holtman)
> 50. Re: Save the elements of an atomic vector to a text fil
> (jim holtman)
> 51. Re: Save the elements of an atomic vector to a text fil
> (Usuario R)
> 52. Re: How to combine xtable and minipage with Sweave ?
> (Dieter Menne)
> 53. Re: Save the elements of an atomic vector to a text fil
> (David Winsemius)
> 54. Re: [R-SIG-Finance] Problem with RBloomberg (not the usual
> one) (Sergey Goriatchev)
> 55. Re: How to color certain area under curve (Vincent Goulet)
> 56. Re: How to combine xtable and minipage with Sweave ? (Ptit_Bleu)
> 57. Re: Cross-validation -> lift curve (Gene Leynes)
> 58. search for string insider a string (Tan, Richard)
> 59. Re: Selecting / creating unique colours for behavioural /
> transitional data (Alexis Gabadinho)
> 60. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 61. Re: How to find maximum values on the density function of
> arandom variable (guox@ucalgary.ca)
> 62. Re: Selecting / creating unique colours for behavioural /
> transitional data (Alexis Gabadinho)
> 63. More basic equivalent of TukeyHSD (Janet)
> 64. how to add labels to existing plot for the subset of data
> (Xin Shi)
> 65. Re: print median and sd... (johnhj)
> 66. Re: Save the elements of an atomic vector to a text fil (johnhj)
> 67. Sorting rows of a matrix independent of each other (Kevski)
> 68. Re: How to find maximum values on the density function of
> arandom variable (David Winsemius)
> 69. Re: How to combine xtable and minipage with Sweave ?
> (Duncan Murdoch)
> 70. Re: Sorting rows of a matrix independent of each other
> (Wacek Kusnierczyk)
> 71. Re: Sorting rows of a matrix independent of each other
> (David Winsemius)
> 72. Re: Sorting rows of a matrix independent of each other
> (Paul Smith)
> 73. Re: How to find maximum values on the density function of
> arandom variable (guox@ucalgary.ca)
> 74. Re: Sorting rows of a matrix independent of each other (Kevski)
> 75. Re: Matrix Construction; Subdiagonal (Paul Smith)
> 76. Re: search for string insider a string (Gabor Grothendieck)
> 77. Re: How to find maximum values on the density function of
> arandom variable (David Winsemius)
> 78. Re: Unable to run smoother in qplot() or ggplot() - complains
> about knots (Christopher David Desjardins)
> 79. Fourier Analysis Help (Vittorio Colagrande)
> 80. Hierarchical Bayesian Modeling in R (Kiran BM)
> 81. Re: Windows binary version of DPpackage (Dieter Menne)
> 82. Re: Sorting rows of a matrix independent of each other
> (Wacek Kusnierczyk)
> 83. Re: Sorting rows of a matrix independent of each other
> (Gabor Grothendieck)
> 84. Overlay plot: boxplot and stripchart (Aldi Kraja)
> 85. Re: Fourier Analysis Help (stephen sefick)
> 86. Re: search for string insider a string (Tan, Richard)
> 87. malformed plot symbols in lattice pdf (Mark Wilkinson)
> 88. Running Ztest on r (avideh yesharim)
> 89. Re: Overlay plot: boxplot and stripchart (David Winsemius)
> 90. Re: malformed plot symbols in lattice pdf (Dieter Menne)
> 91. Re: Fourier Analysis Help (Murray Cooper)
> 92. transforming a matrix (Dimitri Szerman)
> 93. Re: Sorting rows of a matrix independent of each other
> (Wacek Kusnierczyk)
> 94. Re: search for string insider a string (Gabor Grothendieck)
> 95. different outcomes using read.table vs read.csv (jatwood)
> 96. Re: different outcomes using read.table vs read.csv
> (Barry Rowlingson)
> 97. Output Data Formatting Question (Jason Rupert)
> 98. Mixed model help! (Mart?n Quiroga)
> 99. Re: different outcomes using read.table vs read.csv (Jason Rupert)
> 100. Re: transforming a matrix (David Winsemius)
> 101. Re: Output Data Formatting Question (jim holtman)
> 102. More basic equivalent of TukeyHSD (Janet Rosenbaum)
> 103. Using format to add leading zeroes (Jonathan Greenberg)
> 104. Ever see Process R exited abnormally with code 4? (Paul Johnson)
> 105. Question on summing rows within nested variable
> (Vedula, Satyanarayana)
> 106. Re: Using format to add leading zeroes (David Winsemius)
> 107. Re: Question on summing rows within nested variable
> (David Winsemius)
> 108. Re: Question on summing rows within nested variable (jim holtman)
> 109. Re: Using format to add leading zeroes (jim holtman)
> 110. Help with Function! (Lars Bishop)
> 111. Re: Help with Function! (Paul Johnson)
> 112. Build function from model formula (Corey Dow-Hygelund)
> 113. Re: How to combine xtable and minipage with Sweave ?
> (Paul Johnson)
> 114. Is it normal that normalize.loess does not tolerate a single
> NA value? (Emmanuel Levy)
> 115. permutations in R (onyourmark)
> 116. permutations in R (onyourmark)
> 117. Re: permutations in R (Daniel Viar)
> 118. Re: Mixed model help! (Dieter Menne)
> 119. obtaining the values for the hazard function in a cox
> regression (Bob Green)
> 120. Re: temporal join (Jonathan Greenberg)
> 121. Re: print median and sd... (Jim Lemon)
> 122. gsub and regex to tidy comma-limited values (Daren Tan)
> 123. Re: temporal join (Gabor Grothendieck)
> 124. Re: temporal join (Gabor Grothendieck)
> 125. Re: Selecting / creating unique colours for behavioural /
> transitional data (Jim Lemon)
> 126. Re: gsub and regex to tidy comma-limited values
> (Gabor Grothendieck)
> 127. Re: Selecting / creating unique colours for behavioural /
> transitional data (Ross Culloch)
> 128. Re: Map using projection (Ray Brownrigg)
> 129. help (ali al-wardi)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 13 Mar 2009 12:16:04 +0100
> From: Philipp Pagel <p.pagel@wzw.tum.de>
> Subject: Re: [R] Plots not loading
> To: r-help@r-project.org
> Message-ID: <20090313111604.GB6364@localhost>
> Content-Type: text/plain; charset=utf-8
>
> On Thu, Mar 12, 2009 at 01:25:40PM -0700, Atul Joshi wrote:
> > When I run my .r script using source (myfilename) from console the
plots
> appear.
> >
> > However, when I execute the same file via terminal command line using
R
> CMD BATCH myfilename, the plots do not appear.
> >
> > I am working with Mac.
> >
> > Am I doing something wrong?
>
> In BATCH mode it does not make much sense to display plots on the
> screen because the script may be running on a system without screen
> (cluster). So R uses a different default device. On my LINUX
> system it's pdf, so all my plots go to Rplots.pdf unless I explicitly
> send them somewhere else. I don't know about the defaults on Macs but
> you should be able to find the file in the current directory easily.
>
> cu
> Philipp
>
> --
> Dr. Philipp Pagel
> Lehrstuhl f?r Genomorientierte Bioinformatik
> Technische Universit?t M?nchen
> Wissenschaftszentrum Weihenstephan
> 85350 Freising, Germany
> http://mips.gsf.de/staff/pagel
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 13 Mar 2009 04:25:03 -0700
> From: "Andrew Jack" <ajack@tibco.com>
> Subject: [R] COURSE: R and S-PLUS 1 day introduction, UK, 29 April
> 2009
> To: <r-help@r-project.org>
> Message-ID:
>
<5EC578A4338B2640A36E5F4773AFD1BA627EE1@NA-PA-VBE04.na.tibco.com>
> Content-Type: text/plain; charset="us-ascii"
>
> =========================================>
> Course: 1 day introduction to R and S-PLUS
>
> Location: Basingstoke, UK
>
> Date: Wednesday 29 April 2009
>
> Cost: 500 GBP
>
> =========================================>
> Details:
>
> SP411: An introduction to R and TIBCO Spotfire S-PLUS
>
> This course will give an introduction to the S language, as implemented
> in both S-PLUS and R. Attendees will gain a basic understanding of the S
> language so that they can start to load, process, visualise and analyse
> their own data. The Graphical User Interfaces for S-PLUS and R will not
> be discussed. No prior knowledge of R or S-PLUS will be assumed.
>
> Duration: 1 day.
>
> For further details, and to register, go to:
>
> http://inter.viewcentral.com/reg/TIBCO/RandSPlusIntro
>
> ---------------------------------------------------------
> Andrew Jack
> Spotfire Division, TIBCO Software, Ltd
> ajack@tibco.com
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 13 Mar 2009 11:26:36 +0000 (UTC)
> From: Dieter Menne <dieter.menne@menne-biomed.de>
> Subject: Re: [R] How to combine xtable and minipage with Sweave ?
> To: r-help@stat.math.ethz.ch
> Message-ID: <loom.20090313T112355-183@post.gmane.org>
> Content-Type: text/plain; charset=us-ascii
>
> Ptit_Bleu <ptit_bleu <at> yahoo.fr> writes:
>
> > I'm trying to put a dynamic table and a dynamic graph side by side
in a
> pdf
> > document using Sweave.
> > The data.frame used to generate the table is called rg (rg.txt):
> >
> > "Date"; "Code"; "Data1";
"Data2"
> > "2009-03-10";"1";1958;147
> > "2009-03-10";"2";302;144
> ...
> > The Sweave script to test, saved as test_minipage_sweave.rnw, is the
> > following one (I'm a newbie in Latex and R so I pasted some
commands I
> found
> > here and there) :
> >
> 1) There were typos in your code. It should be
>
> print(xtable(rg), include.rownames=F)
>
> and it should be results=tex, not TEX
>
> 2) <<>> must start at column 0, this is the first error
>
> 3) Check about the rules of minipage and floats. See the sequence
> for the figure in the tex code; this gives the typical "Not in outer
> mode" error
>
> Dieter
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 13 Mar 2009 03:51:54 -0700 (PDT)
> From: emj83 <stp08emj@shef.ac.uk>
> Subject: [R] pairs of numbers
> To: r-help@r-project.org
> Message-ID: <22494116.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi,
>
> I have two lists of numbers which are both 1,2,3,4.
> I would like to combine pairs so that I have:
> 1,2
> 1,3
> 1,4
> 2,3
> 2,4
> 3,4.
>
> I know that expand.grid() can give me all combinations of pairs.
>
> Any suggestions would be much appreciated.
>
> Emma
> --
> View this message in context:
> http://www.nabble.com/pairs-of-numbers-tp22494116p22494116.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 13 Mar 2009 04:07:50 -0700 (PDT)
> From: emj83 <stp08emj@shef.ac.uk>
> Subject: Re: [R] pairs of numbers
> To: r-help@r-project.org
> Message-ID: <22494346.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> I have solved my problem using:
> > x<-1:4
> > x
> [1] 1 2 3 4
> > combn(x,2)
> [,1] [,2] [,3] [,4] [,5] [,6]
> [1,] 1 1 1 2 2 3
> [2,] 2 3 4 3 4 4
>
> Thanks Emma
>
>
> emj83 wrote:
> >
> > Hi,
> >
> > I have two lists of numbers which are both 1,2,3,4.
> > I would like to combine pairs so that I have:
> > 1,2
> > 1,3
> > 1,4
> > 2,3
> > 2,4
> > 3,4.
> >
> > I know that expand.grid() can give me all combinations of pairs.
> >
> > Any suggestions would be much appreciated.
> >
> > Emma
> >
>
> --
> View this message in context:
> http://www.nabble.com/pairs-of-numbers-tp22494116p22494346.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 13 Mar 2009 12:48:57 +0100
> From: Sergey Goriatchev <sergeyg@gmail.com>
> Subject: Re: [R] Taking diff of character vectors
> To: markleeds@verizon.net
> Cc: r-help@r-project.org
> Message-ID:
> <7cb007bd0903130448s7141bc69qfc3811d1a6694c5@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Fabulous, guys!
>
> Let me try your suggestions.
>
> Thanks a lot!
>
> Best,
> SErgey
>
> On Fri, Mar 13, 2009 at 11:53, <markleeds@verizon.net> wrote:
> > Hi:
> > For A, you can use head and tail but you have to add a zero the front.
> > For B, you can use the same function, but put it inside an sapply and
run
> > over the columns and then cbind it back with the original dataframe.
> > A)
> > nm2 <- c(rep("SPZ8", 10), rep("SPX9", 10))
> > -1.0*c(0,as.numeric((head(nm2,-1) != tail(nm2,-1))))
> >
> > B)
> > nm3 <- c(rep("GLF9", 4), rep("GLF10", 16))
> > matr <- cbind(nm2, nm3)
> > temp<-as.data.frame(sapply(1:ncol(matr), function(.col) {
> > -1.0*c(0,as.numeric((head(matr[,.col],-1) != tail(matr[,.col],-1))))
> > }))
> > cbind(matr,temp)
> >
> >
> >
> > On Fri, Mar 13, 2009 at? 5:24 AM, Sergey Goriatchev wrote:
> >> Hello, everybody
> >>
> >> Say I have
> >> nm1 <- c(rep(1,10), rep(0,10))
> >> then I can do:
> >> diff(nm1)
> >> to see where I have shift in value
> >>
> >> but what if I have
> >> nm2 <- c(rep("SPZ8", 10), rep("SPX9", 10))
> >>
> >> how can I produce the same ouput as diff(nm1) does, that is zeros
> >> everywhere except for one place where SPZ8 changes to SPX9 (there
> >> should be 1 there)?
> >>
> >> What if I have a matrix of characters like that:
> >> nm3 <- c(rep("GLF9", 4), rep("GLF10", 16))
> >> matr <- cbind(nm2, nm3)
> >>
> >> How can I efficiently create two more columns that contain zeros
> >> everywhere except for place where there is shift in character
values?
> >>
> >> Thanks for help!
> >> Sergey
> >>
> >> --
> >> I'm not young enough to know everything. /Oscar Wilde
> >> Experience is one thing you can't get for nothing. /Oscar
Wilde
> >> When you are finished changing, you're finished. /Benjamin
Franklin
> >> Tell me and I forget, teach me and I remember, involve me and I
learn.
> >> /Benjamin Franklin
> >> Luck is where preparation meets opportunity. /George Patten
> >>
> >> ______________________________________________
> >> R-help@r-project.org??mailing list
> >> 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.
>
>
>
> --
> I'm not young enough to know everything. /Oscar Wilde
> Experience is one thing you can't get for nothing. /Oscar Wilde
> When you are finished changing, you're finished. /Benjamin Franklin
> Tell me and I forget, teach me and I remember, involve me and I learn.
> /Benjamin Franklin
> Luck is where preparation meets opportunity. /George Patten
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 13 Mar 2009 08:11:31 -0400
> From: jim holtman <jholtman@gmail.com>
> Subject: Re: [R] print median and sd...
> To: johnhj <jharris@web.de>
> Cc: r-help@r-project.org
> Message-ID:
> <644e1f320903130511k73c38beai53f85b815ff045a5@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Where do you want to print it? Is it the console (if so, try
> 'print(median)') or if it is the plot, use 'text' with the
appropriate
> parameters. It would help if you listed the " I tried many things but
> without success..." and what you were expecting vs. what you got.
> Reproducible code would be useful (and required).
>
> On Thu, Mar 12, 2009 at 10:42 PM, johnhj <jharris@web.de> wrote:
> >
> > Hii,
> >
> > Can anybody help me, I don't know how to print the
"median". Below is my
> > code snipplet...
> >
> > x
> >
>
<-read.table(file="D:/Uni/Diplom/Diplom/Grafiken/R/BATMAN/Kabel/Batman1hop/Standardabweichung__output_30_1_Kabel(30m)_b.txt")
> >
> > png(filename = "D:/Grafiken/R/Standardabweichung/Kopie.png",
width = 640,
> > height = 480,pointsize = 12, bg = "white", ?res = NA)
> >
> > median<-with(x, tapply(V3, grup, median))
> >
> > ???
> >
> > dev.off()
> >
> > I will print, the median values with a simple line.. I tried many
things
> but
> > without success...
> > I would be very appreciate, if anyone could help me...
> >
> > greetings,
> > John
> >
> > --
> > View this message in context:
> http://www.nabble.com/print-median-and-sd...-tp22489185p22489185.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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.
> >
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem that you are trying to solve?
>
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 13 Mar 2009 06:28:16 -0600
> From: Kingsford Jones <kingsfordjones@gmail.com>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: Ross Culloch <ross.culloch@dur.ac.uk>
> Cc: r-help@r-project.org
> Message-ID:
> <2ad0cc110903130528oa57b8c6w17ddf66b5a280ecd@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Try
>
> #install.packages('RColorBrewer')
> example(brewer.pal, pack='RColorBrewer')
>
>
> hth,
> Kingsford Jones
>
> On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> wrote:
> >
> > Dear all,
> >
> > This seems like a simple problem but i've searched the help files
and
> tried
> > various options but failed, so apologies in advance for asking what
i'm
> sure
> > is an easy thing to do!
> >
> > In short, I have displayed behavioural data using the TraMineR package
> such
> > that there is a colour change between the transition of behaviours,
> however,
> > all the methods that i have used thus far have given me gradual
changes
> in
> > colour such that it is impossible to tell the difference from several
of
> the
> > behaviours. I have looked in the help section here, and looked at
various
> > books and help files in R, but most seem intent on gradual changes in
> colour
> > for heat, terrain, depth, etc - i may not be looking in the correct
> places,
> > or perhaps i don't know what i'm looking for, exactly.
> >
> > The code below is the closest i can get to colours being not too
similar,
> > but it's still hard to tell apart:
> >
> > col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >
> > What i ideally want to do is create a palette with random colours that
> are
> > no where near one another so that i can tell the 15 different
behaviours
> > apart - is this possible?
> >
> > If anyone can help i would be most greatful!
> >
> > Best wishes,
> >
> > Ross
> > --
> > View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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: 9
> Date: Fri, 13 Mar 2009 08:35:59 -0400
> From: Dale Steele <dale.w.steele@gmail.com>
> Subject: [R] code to find all distinct subsets of size r from a set of
> size n
> To: r-help@r-project.org
> Message-ID:
> <72e8303a0903130535l49e61defrf26c3afbde6db66f@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I'm doing a permutation test and need to efficiently generate all
> distinct subsets of size r from a set of size n. P 138 of MASS (4th
> ed) notes that "The code to generate this efficiently is in the
> scripts". I was unable to find this code on quick inspection of the
> \library\MASS\scripts file for Chapter 5 and 'subsets' is not a
> function in MASS.
>
> I did find this problem is discussed in RNews, Programmer's Niche
> 1(1):27 - 30 and RNews, 1(2):29-31. Is there function in 'base' R
or
> other package to do this? Thanks. --Dale
>
>
>
> ------------------------------
>
> Message: 10
> Date: Fri, 13 Mar 2009 05:38:51 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22495482.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi Kingsford,
>
> Thanks for the reply - some of the sets/palettes in the RColorBrewer are
> ideal, but the problem with the problem i have is that they only go up to
> 12
> colours, and i need 15 colours - so i assume the only thing i can do is
> create my own palette, but i'm having limited success in trying to work
out
> how to do this.
>
>
> Kingsford Jones wrote:
> >
> > Try
> >
> > #install.packages('RColorBrewer')
> > example(brewer.pal, pack='RColorBrewer')
> >
> >
> > hth,
> > Kingsford Jones
> >
> > On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> > wrote:
> >>
> >> Dear all,
> >>
> >> This seems like a simple problem but i've searched the help
files and
> >> tried
> >> various options but failed, so apologies in advance for asking
what i'm
> >> sure
> >> is an easy thing to do!
> >>
> >> In short, I have displayed behavioural data using the TraMineR
package
> >> such
> >> that there is a colour change between the transition of
behaviours,
> >> however,
> >> all the methods that i have used thus far have given me gradual
changes
> >> in
> >> colour such that it is impossible to tell the difference from
several of
> >> the
> >> behaviours. I have looked in the help section here, and looked at
> various
> >> books and help files in R, but most seem intent on gradual changes
in
> >> colour
> >> for heat, terrain, depth, etc - i may not be looking in the
correct
> >> places,
> >> or perhaps i don't know what i'm looking for, exactly.
> >>
> >> The code below is the closest i can get to colours being not too
> similar,
> >> but it's still hard to tell apart:
> >>
> >> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>
> >> What i ideally want to do is create a palette with random colours
that
> >> are
> >> no where near one another so that i can tell the 15 different
behaviours
> >> apart - is this possible?
> >>
> >> If anyone can help i would be most greatful!
> >>
> >> Best wishes,
> >>
> >> Ross
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> >> Sent from the R help mailing list archive at Nabble.com.
> >>
> >> ______________________________________________
> >> R-help@r-project.org mailing list
> >> 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
> > 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.
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22495482.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 11
> Date: Fri, 13 Mar 2009 05:39:48 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22495482.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi Kingsford,
>
> Thanks for the reply - some of the sets/palettes in the RColorBrewer are
> ideal, but the i have is that they only go up to 12 colours, and i need 15
> colours (sorry, should have mentioned that)- so i assume the only thing i
> can do is create my own palette, but i'm having limited success in
trying
> to
> work out how to do this.
>
>
> Kingsford Jones wrote:
> >
> > Try
> >
> > #install.packages('RColorBrewer')
> > example(brewer.pal, pack='RColorBrewer')
> >
> >
> > hth,
> > Kingsford Jones
> >
> > On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> > wrote:
> >>
> >> Dear all,
> >>
> >> This seems like a simple problem but i've searched the help
files and
> >> tried
> >> various options but failed, so apologies in advance for asking
what i'm
> >> sure
> >> is an easy thing to do!
> >>
> >> In short, I have displayed behavioural data using the TraMineR
package
> >> such
> >> that there is a colour change between the transition of
behaviours,
> >> however,
> >> all the methods that i have used thus far have given me gradual
changes
> >> in
> >> colour such that it is impossible to tell the difference from
several of
> >> the
> >> behaviours. I have looked in the help section here, and looked at
> various
> >> books and help files in R, but most seem intent on gradual changes
in
> >> colour
> >> for heat, terrain, depth, etc - i may not be looking in the
correct
> >> places,
> >> or perhaps i don't know what i'm looking for, exactly.
> >>
> >> The code below is the closest i can get to colours being not too
> similar,
> >> but it's still hard to tell apart:
> >>
> >> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>
> >> What i ideally want to do is create a palette with random colours
that
> >> are
> >> no where near one another so that i can tell the 15 different
behaviours
> >> apart - is this possible?
> >>
> >> If anyone can help i would be most greatful!
> >>
> >> Best wishes,
> >>
> >> Ross
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> >> Sent from the R help mailing list archive at Nabble.com.
> >>
> >> ______________________________________________
> >> R-help@r-project.org mailing list
> >> 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
> > 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.
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22495482.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 12
> Date: Fri, 13 Mar 2009 12:55:35 +0000
> From: Paul Suckling <paul.suckling@gmail.com>
> Subject: [R] R multiline expression grief
> To: r-help@r-project.org
> Message-ID:
> <df529a970903130555g445f0d1cx7d2ff247e890afc@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Dear all.
>
> After much grief I have finally found the source of some weird
> discrepancies in results generated using R. It turns out that this is
> due to the way R handles multi-line expressions. Here is an example
> with R version 2.8.1:
>
> ----------------------------------------------------
> # R-script...
>
> r_parse_error <- function ()
> {
> a <- 1;
> b <- 1;
> c <- 1;
> d <- a + b + c;
> e <- a +
> b +
> c;
> f <- a
> + b
> + c;
> cat('a',a,"\n");
> cat('b',b,"\n");
> cat('c',c,"\n");
> cat('d',d,"\n");
> cat('e',e,"\n");
> cat('f',f,"\n");
> }
> ----------------------------------------------------
> > r_parse_error();
> a 1
> b 1
> c 1
> d 3
> e 3
> f 1
> ----------------------------------------------------
>
> As far as I am concerned f should have the value 3.
>
> This is causing me endless problems since case f is our house style
> for breaking up expressions for readability. All our code will need to
> be rechecked as a result. Is this behaviour a bug? If not, is it
> possible to get R to generate a warning that several lines of an
> expression are potentially being ignored, perhaps by turning on a
> strict mode which requires the semi-colons?
>
> Thank you,
>
> Paul
>
>
>
> ------------------------------
>
> Message: 13
> Date: Fri, 13 Mar 2009 08:57:12 -0400
> From: Ista Zahn <istazahn@gmail.com>
> Subject: Re: [R] Unable to run smoother in qplot() or ggplot() -
> complains about knots
> To: cddesjardins@gmail.com
> Cc: r-help@r-project.org
> Message-ID:
> <f55e7cf50903130557v3e60d2d6k10644c5ad26449f1@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > From: Christopher David Desjardins <cddesjardins@gmail.com>
> > To: r-help@r-project.org
> > Date: Thu, 12 Mar 2009 17:37:26 -0500
> > Subject: [R] Unable to run smoother in qplot() or ggplot() - complains
> about knots
> > I get the following error when I run qplot()
> >
> > qplot(grade, read,data = hhm.long.m, geom = c("point",
"smooth"))
> >
> > Error in smooth.construct.cr.smooth.spec(object, data, knots) :
> > x has insufficient unique values to support 10 knots: reduce k.
> >
> > I am not sure how to tackle this problem. When I take a subsample
(<
> 1000) than I am able to run that function but with my sample of ~ ?40,000
> qplot gives me that error. I have 6 grades.
> > Please cc me on reply.
>
> Hi Chris,
> Have you read the documentation for stat_smooth? It's not clear to me
> what the problem is, because I'm not sure what the defaults are. But
> since the default's are not working, I would try it with different
> settings. See http://had.co.nz/ggplot2/stat_smooth.html.
>
> -Ista
> >
> >
> > Thanks!
> > Chris
>
>
>
> ------------------------------
>
> Message: 14
> Date: Fri, 13 Mar 2009 07:01:42 -0600
> From: Kingsford Jones <kingsfordjones@gmail.com>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: Ross Culloch <ross.culloch@dur.ac.uk>
> Cc: r-help@r-project.org
> Message-ID:
> <2ad0cc110903130601t719a0150qe31367c355fddc3f@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> One option for creating your own palette is
>
> #install.packages('epitools')
> mycols <- colors.plot(locator = TRUE)
>
> then left-click on 15 colors of your liking and then right-click
'Stop'.
>
> mycols will be a data.frame with the third column containing the color
> names.
>
> Kingsford
>
> On Fri, Mar 13, 2009 at 6:38 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> wrote:
> >
> > Hi Kingsford,
> >
> > Thanks for the reply - some of the sets/palettes in the RColorBrewer
are
> > ideal, but the problem with the problem i have is that they only go up
to
> 12
> > colours, and i need 15 colours - so i assume the only thing i can do
is
> > create my own palette, but i'm having limited success in trying to
work
> out
> > how to do this.
> >
> >
> > Kingsford Jones wrote:
> >>
> >> Try
> >>
> >> #install.packages('RColorBrewer')
> >> example(brewer.pal, pack='RColorBrewer')
> >>
> >>
> >> hth,
> >> Kingsford Jones
> >>
> >> On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> >> wrote:
> >>>
> >>> Dear all,
> >>>
> >>> This seems like a simple problem but i've searched the
help files and
> >>> tried
> >>> various options but failed, so apologies in advance for asking
what i'm
> >>> sure
> >>> is an easy thing to do!
> >>>
> >>> In short, I have displayed behavioural data using the TraMineR
package
> >>> such
> >>> that there is a colour change between the transition of
behaviours,
> >>> however,
> >>> all the methods that i have used thus far have given me
gradual changes
> >>> in
> >>> colour such that it is impossible to tell the difference from
several
> of
> >>> the
> >>> behaviours. I have looked in the help section here, and looked
at
> various
> >>> books and help files in R, but most seem intent on gradual
changes in
> >>> colour
> >>> for heat, terrain, depth, etc - i may not be looking in the
correct
> >>> places,
> >>> or perhaps i don't know what i'm looking for, exactly.
> >>>
> >>> The code below is the closest i can get to colours being not
too
> similar,
> >>> but it's still hard to tell apart:
> >>>
> >>> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>>
> >>> What i ideally want to do is create a palette with random
colours that
> >>> are
> >>> no where near one another so that i can tell the 15 different
> behaviours
> >>> apart - is this possible?
> >>>
> >>> If anyone can help i would be most greatful!
> >>>
> >>> Best wishes,
> >>>
> >>> Ross
> >>> --
> >>> View this message in context:
> >>>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> >>> Sent from the R help mailing list archive at Nabble.com.
> >>>
> >>> ______________________________________________
> >>> R-help@r-project.org mailing list
> >>> 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
> >> 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.
> >>
> >>
> >
> > --
> > View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22495482.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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: 15
> Date: Fri, 13 Mar 2009 09:12:17 -0400
> From: jim holtman <jholtman@gmail.com>
> Subject: Re: [R] R multiline expression grief
> To: Paul Suckling <paul.suckling@gmail.com>
> Cc: r-help@r-project.org
> Message-ID:
> <644e1f320903130612m2c8d6396p2a7b0318a033503@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> This is a perfectly legal expression:
>
> f <- a
> + b
> + c;
>
> Type it in a the console, and it will assign a to f and then print out
> the values of b and c. In parsing 'f <- a' that is a complete
> expression. You may be confused since you think that semicolons
> terminate an expression; that is not the case in R. If you write 'f
> <- a +' and then continue on the next line, R recognizes that the
> parsing of the expression is not complete and will continue looking.
> So it is not a bug; just a misunderstanding of what the syntax is and
> how it works.
>
> There are similar questions when people type in the following type of
> statements:
>
> if (1 == 1) print (TRUE)
> else print (FALSE)
>
> At the console you get:
>
> > if (1 == 1) print (TRUE)
> [1] TRUE
> > else print (FALSE)
> Error: unexpected 'else' in "else"
> No suitable frames for recover()
> >
>
> because the parsing of the 'if' is complete. Instead you should be
doing:
>
> > if (1 == 1) {print (TRUE)
> + } else {print (FALSE)}
> [1] TRUE
> >
>
> so the parse knows that the initial 'if' is not complete on the
single
> line.
>
> On Fri, Mar 13, 2009 at 8:55 AM, Paul Suckling
<paul.suckling@gmail.com>
> wrote:
> > Dear all.
> >
> > After much grief I have finally found the source of some weird
> > discrepancies in results generated using R. It turns out that this is
> > due to the way R handles multi-line expressions. Here is an example
> > with R version 2.8.1:
> >
> > ----------------------------------------------------
> > # R-script...
> >
> > r_parse_error <- function ()
> > {
> > ?a <- 1;
> > ?b <- 1;
> > ?c <- 1;
> > ?d <- a + b + c;
> > ?e <- a +
> > ? ?b +
> > ? ?c;
> > ?f <- a
> > ? ?+ b
> > ? ?+ c;
> > ?cat('a',a,"\n");
> > ?cat('b',b,"\n");
> > ?cat('c',c,"\n");
> > ?cat('d',d,"\n");
> > ?cat('e',e,"\n");
> > ?cat('f',f,"\n");
> > }
> > ----------------------------------------------------
> >> r_parse_error();
> > a 1
> > b 1
> > c 1
> > d 3
> > e 3
> > f 1
> > ----------------------------------------------------
> >
> > As far as I am concerned f should have the value 3.
> >
> > This is causing me endless problems since case f is our house style
> > for breaking up expressions for readability. All our code will need to
> > be rechecked as a result. Is this behaviour a bug? If not, is it
> > possible to get R to generate a warning that several lines of an
> > expression are potentially being ignored, perhaps by turning on a
> > strict mode which requires the semi-colons?
> >
> > Thank you,
> >
> > Paul
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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.
> >
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem that you are trying to solve?
>
>
>
> ------------------------------
>
> Message: 16
> Date: Fri, 13 Mar 2009 06:18:23 -0700 (PDT)
> From: Thomas Lumley <tlumley@u.washington.edu>
> Subject: Re: [R] R multiline expression grief
> To: Paul Suckling <paul.suckling@gmail.com>
> Cc: r-help@r-project.org
> Message-ID:
<Pine.LNX.4.43.0903130618230.6762@hymn31.u.washington.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> On Fri, 13 Mar 2009, Paul Suckling wrote:
>
> > Dear all.
> >
> > After much grief I have finally found the source of some weird
> > discrepancies in results generated using R. It turns out that this is
> > due to the way R handles multi-line expressions. Here is an example
> > with R version 2.8.1:
> >
> > ----------------------------------------------------
> > # R-script...
> >
> > r_parse_error <- function ()
> > {
> > a <- 1;
> > b <- 1;
> > c <- 1;
> > d <- a + b + c;
> > e <- a +
> > b +
> > c;
> > f <- a
> > + b
> > + c;
> > cat('a',a,"\n");
> > cat('b',b,"\n");
> > cat('c',c,"\n");
> > cat('d',d,"\n");
> > cat('e',e,"\n");
> > cat('f',f,"\n");
> > }
> > ----------------------------------------------------
> >> r_parse_error();
> > a 1
> > b 1
> > c 1
> > d 3
> > e 3
> > f 1
> > ----------------------------------------------------
> >
> > As far as I am concerned f should have the value 3.
>
> That is most unfortunate for you.
>
> > Is this behaviour a bug?
>
> No.
>
> > If not, is it
> > possible to get R to generate a warning that several lines of an
> > expression are potentially being ignored, perhaps by turning on a
> > strict mode which requires the semi-colons?
>
> No.
>
> R is not ignoring several lines of an expression.
> f <- a
> + b
> + c;
>
> is three perfectly legitimate expressions over three lines. R evaluates
> f<-a
> then evaluates
> +b
> then evaluates
> +c
>
> For people who like semicolons, it's the same as if you had
> f <- a;
> +b;
> +c;
>
> The semicolons are just an alternative to a newline, so a semicolon at the
> end of a line is purely cosmetic. Modifying the parser to require a
> semicolon to terminate a statement would break essentially every piece of R
> code and documentation in existence, so it's probably easier to change
your
> house style.
>
> You could fairly easily write a tool that parsed your scripts and checked
> that all your expressions were either assignments or function calls and
that
> the top-level expressions did not include unary plus or minus.
>
>
> -thomas
>
> Thomas Lumley Assoc. Professor, Biostatistics
> tlumley@u.washington.edu University of Washington, Seattle
>
>
>
> ------------------------------
>
> Message: 17
> Date: Fri, 13 Mar 2009 09:18:29 -0400
> From: Sarah Goslee <sarah.goslee@gmail.com>
> Subject: Re: [R] cor.test(x,y)
> To: mentor_ <mentor_@gmx.net>, "r-help@r-project.org"
> <r-help@r-project.org>
> Message-ID:
> <efb536d50903130618v3fe985dfoa780604e86207238@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Did you read the help for cor.test? Test statistics, references....
> looks pretty complete to me. If the descriptions are too terse,
> then the references given would be the next step.
>
> Sarah
>
> Excerpted from ?cor.test
>
>
> If 'method' is '"pearson"', the test
statistic is based on
> Pearson's product moment correlation coefficient 'cor(x,
y)' and
> follows a t distribution with 'length(x)-2' degrees of freedom
if
> the samples follow independent normal distributions. If there are
> at least 4 complete pairs of observation, an asymptotic confidence
> interval is given based on Fisher's Z transform.
>
> If 'method' is '"kendall"' or
'"spearman"', Kendall's tau or
> Spearman's rho statistic is used to estimate a rank-based measure
> of association. These tests may be used if the data do not
> necessarily come from a bivariate normal distribution.
>
> For Kendall's test, by default (if 'exact' is NULL), an
exact
> p-value is computed if there are less than 50 paired samples
> containing finite values and there are no ties. Otherwise, the
> test statistic is the estimate scaled to zero mean and unit
> variance, and is approximately normally distributed.
>
> For Spearman's test, p-values are computed using algorithm AS 89.
>
> References:
>
> D. J. Best & D. E. Roberts (1975), Algorithm AS 89: The Upper Tail
> Probabilities of Spearman's rho. _Applied Statistics_, *24*,
> 377-379.
>
> Myles Hollander & Douglas A. Wolfe (1973), _Nonparametric
> Statistical Methods._ New York: John Wiley & Sons. Pages 185-194
> (Kendall and Spearman tests).
>
>
> On Fri, Mar 13, 2009 at 5:37 AM, mentor_ <mentor_@gmx.net> wrote:
> >
> > Hi,
> >
> > I am not sure which test is applied to the data if you use cor.test(x,
y)
> ?
> > Is it an unpaired t-Test?
> >
> >
> > Regards
>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>
>
>
> ------------------------------
>
> Message: 18
> Date: Fri, 13 Mar 2009 06:19:34 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22496241.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Many thanks yet again for your reply, thanks for that method, i gave it a
> go
> and i checked 'mycols' and sure enough it had selected the chosen
colours
> and listed their names, but when i used it for making the graph warnigs
> informed me that the supplied colour in not numeric or character.
>
> Ross
>
>
>
> Kingsford Jones wrote:
> >
> > One option for creating your own palette is
> >
> > #install.packages('epitools')
> > mycols <- colors.plot(locator = TRUE)
> >
> > then left-click on 15 colors of your liking and then right-click
'Stop'.
> >
> > mycols will be a data.frame with the third column containing the color
> > names.
> >
> > Kingsford
> >
> > On Fri, Mar 13, 2009 at 6:38 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> > wrote:
> >>
> >> Hi Kingsford,
> >>
> >> Thanks for the reply - some of the sets/palettes in the
RColorBrewer are
> >> ideal, but the problem with the problem i have is that they only
go up
> to
> >> 12
> >> colours, and i need 15 colours - so i assume the only thing i can
do is
> >> create my own palette, but i'm having limited success in
trying to work
> >> out
> >> how to do this.
> >>
> >>
> >> Kingsford Jones wrote:
> >>>
> >>> Try
> >>>
> >>> #install.packages('RColorBrewer')
> >>> example(brewer.pal, pack='RColorBrewer')
> >>>
> >>>
> >>> hth,
> >>> Kingsford Jones
> >>>
> >>> On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> >>> wrote:
> >>>>
> >>>> Dear all,
> >>>>
> >>>> This seems like a simple problem but i've searched the
help files and
> >>>> tried
> >>>> various options but failed, so apologies in advance for
asking what
> i'm
> >>>> sure
> >>>> is an easy thing to do!
> >>>>
> >>>> In short, I have displayed behavioural data using the
TraMineR package
> >>>> such
> >>>> that there is a colour change between the transition of
behaviours,
> >>>> however,
> >>>> all the methods that i have used thus far have given me
gradual
> changes
> >>>> in
> >>>> colour such that it is impossible to tell the difference
from several
> >>>> of
> >>>> the
> >>>> behaviours. I have looked in the help section here, and
looked at
> >>>> various
> >>>> books and help files in R, but most seem intent on gradual
changes in
> >>>> colour
> >>>> for heat, terrain, depth, etc - i may not be looking in
the correct
> >>>> places,
> >>>> or perhaps i don't know what i'm looking for,
exactly.
> >>>>
> >>>> The code below is the closest i can get to colours being
not too
> >>>> similar,
> >>>> but it's still hard to tell apart:
> >>>>
> >>>> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>>>
> >>>> What i ideally want to do is create a palette with random
colours that
> >>>> are
> >>>> no where near one another so that i can tell the 15
different
> >>>> behaviours
> >>>> apart - is this possible?
> >>>>
> >>>> If anyone can help i would be most greatful!
> >>>>
> >>>> Best wishes,
> >>>>
> >>>> Ross
> >>>> --
> >>>> View this message in context:
> >>>>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> >>>> Sent from the R help mailing list archive at Nabble.com.
> >>>>
> >>>> ______________________________________________
> >>>> R-help@r-project.org mailing list
> >>>> 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
> >>> 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.
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22495482.html
> >> Sent from the R help mailing list archive at Nabble.com.
> >>
> >> ______________________________________________
> >> R-help@r-project.org mailing list
> >> 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
> > 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.
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496241.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 19
> Date: Fri, 13 Mar 2009 14:20:41 +0100
> From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Subject: Re: [R] R multiline expression grief
> To: Paul Suckling <paul.suckling@gmail.com>
> Cc: r-help@r-project.org
> Message-ID: <49BA5DA9.1030308@idi.ntnu.no>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Paul Suckling wrote:
>
> <...>
> > ----------------------------------------------------
> > # R-script...
> >
> > r_parse_error <- function ()
> > {
> >
> <...>
>
> > f <- a
> > + b
> > + c;
> > }
> >
> >
> <...>
> > f 1
> > ----------------------------------------------------
> >
> > As far as I am concerned f should have the value 3.
> >
>
> as far as you intend, perhaps. note, the above snippet says:
>
> f <- a; +b; +c
>
> not
>
> f <- a + b + c
>
>
> > This is causing me endless problems since case f is our house style
> > for breaking up expressions for readability. All our code will need to
> > be rechecked as a result. Is this behaviour a bug?
>
> clearly not. and it's hardly idiosyncratic to r. you'd have the
same
> behaviour in, e.g., python, though there you can explicitly demand that
> the lines form a single statement by ending the first two with a
> backslash. there have been similar discussions on mailing lists of a
> number of programming/scripting languages.
>
>
>
> > If not, is it
> > possible to get R to generate a warning that several lines of an
> > expression are potentially being ignored,
>
> they're not ignored! you demand to compute +b and +c, and it's
> certainly done. (i don't think r is smart enough to optimize these
away).
>
> > perhaps by turning on a
> > strict mode which requires the semi-colons?
> >
>
> that's an idea, but the proposed solution would have to be optional to
> avoid annoying those who don't like semiquotes in r code.
>
>
> vQ
>
>
>
> ------------------------------
>
> Message: 20
> Date: Fri, 13 Mar 2009 08:24:19 -0500
> From: hadley wickham <h.wickham@gmail.com>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: Ross Culloch <ross.culloch@dur.ac.uk>
> Cc: r-help@r-project.org
> Message-ID:
> <f8e6ff050903130624k6e1aa531i98c70dab9f315bc0@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> > Thanks for the reply - some of the sets/palettes in the RColorBrewer
are
> > ideal, but the problem with the problem i have is that they only go up
to
> 12
> > colours, and i need 15 colours - so i assume the only thing i can do
is
> > create my own palette, but i'm having limited success in trying to
work
> out
> > how to do this.
>
> I'll think you'll find it very challenging to create 15
> distinguishable colours - there's a good reason the colorbrewer
> colours only go up to 12. Because you could describe your plot more
> fully - it might be possible to display your data in a way that
> doesn't require quite so many colours.
>
> Hadley
>
> --
> http://had.co.nz/
>
>
>
> ------------------------------
>
> Message: 21
> Date: Fri, 13 Mar 2009 07:25:59 -0600
> From: Kingsford Jones <kingsfordjones@gmail.com>
> Subject: Re: [R] code to find all distinct subsets of size r from a
> set of size n
> To: Dale Steele <dale.w.steele@gmail.com>
> Cc: r-help@r-project.org
> Message-ID:
> <2ad0cc110903130625o71b3c256q84f418f8ec2b5802@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> For permutations a couple of options are 'permutations' in package
> gtools, and 'urnsamples' in package prob
>
> hth,
> Kingsford Jones
>
> On Fri, Mar 13, 2009 at 6:35 AM, Dale Steele
<dale.w.steele@gmail.com>
> wrote:
> > I'm doing a permutation test and need to efficiently generate all
> > distinct subsets of size r from a set of size n. ?P 138 of MASS (4th
> > ed) notes that ?"The code to generate this efficiently is in the
> > scripts". ?I was unable to find this code on quick inspection of
the
> > \library\MASS\scripts file for Chapter 5 and 'subsets' is not
a
> > function in MASS.
> >
> > I did find this problem is discussed in RNews, Programmer's Niche
> > 1(1):27 - 30 and RNews, 1(2):29-31. ?Is there function in
'base' ?R or
> > other package to do this? ?Thanks. ?--Dale
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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: 22
> Date: Fri, 13 Mar 2009 06:26:12 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22496355.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi Oliver,
>
> Thanks very much for your reply. I have tried your script, but when the
> script for the graph runs it comes up with several error messages repeating
> that 'supplied colour is not numeric or character'
>
>
>
> Olivier Delaigue wrote:
> >
> >> library(colorRamps)
> >> image(matrix(1:150, 10), col = blue2green2red(15))
> >
> > Regards,
> >
> > Olivier Delaigue
> >
> >
> > Ross Culloch wrote:
> >>
> >> Dear all,
> >>
> >> This seems like a simple problem but i've searched the help
files and
> >> tried various options but failed, so apologies in advance for
asking
> what
> >> i'm sure is an easy thing to do!
> >>
> >> In short, I have displayed behavioural data using the TraMineR
package
> >> such that there is a colour change between the transition of
behaviours,
> >> however, all the methods that i have used thus far have given me
gradual
> >> changes in colour such that it is impossible to tell the
difference from
> >> several of the behaviours. I have looked in the help section here,
and
> >> looked at various books and help files in R, but most seem intent
on
> >> gradual changes in colour for heat, terrain, depth, etc - i may
not be
> >> looking in the correct places, or perhaps i don't know what
i'm looking
> >> for, exactly.
> >>
> >> The code below is the closest i can get to colours being not too
> similar,
> >> but it's still hard to tell apart:
> >>
> >> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>
> >> What i ideally want to do is create a palette with random colours
that
> >> are no where near one another so that i can tell the 15 different
> >> behaviours apart - is this possible?
> >>
> >> If anyone can help i would be most greatful!
> >>
> >> Best wishes,
> >>
> >> Ross
> >>
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496355.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 23
> Date: Fri, 13 Mar 2009 13:26:25 +0000
> From: Paul Suckling <paul.suckling@gmail.com>
> Subject: Re: [R] R multiline expression grief
> To: r-help@r-project.org
> Message-ID:
> <df529a970903130626m3ce097afvab0cd7d081bbe4c7@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I get it. Thanks everyone for the feedback.
>
> Now that I understand how it works, my comment would be that this
> system is dangerous since it makes it difficult to read the code and
> easy to make errors when typing it. I recognise that this is something
> so fundamental that it is unlikely to be changed so I'll have to adapt
> to it.
>
> My feeling is that such confusion could be avoided however, by
> introducing a line continuation character (or group of characters)
> into R that could be used to indicate to the parser (and reader of the
> code) that the expression continues onto the next line.
>
> Something like
>
> f <- a ...
> + b ...
> + c
>
> Cheers,
>
> Paul
>
> 2009/3/13 Paul Suckling <paul.suckling@gmail.com>:
> > Dear all.
> >
> > After much grief I have finally found the source of some weird
> > discrepancies in results generated using R. It turns out that this is
> > due to the way R handles multi-line expressions. Here is an example
> > with R version 2.8.1:
> >
> > ----------------------------------------------------
> > # R-script...
> >
> > r_parse_error <- function ()
> > {
> > ?a <- 1;
> > ?b <- 1;
> > ?c <- 1;
> > ?d <- a + b + c;
> > ?e <- a +
> > ? ?b +
> > ? ?c;
> > ?f <- a
> > ? ?+ b
> > ? ?+ c;
> > ?cat('a',a,"\n");
> > ?cat('b',b,"\n");
> > ?cat('c',c,"\n");
> > ?cat('d',d,"\n");
> > ?cat('e',e,"\n");
> > ?cat('f',f,"\n");
> > }
> > ----------------------------------------------------
> >> r_parse_error();
> > a 1
> > b 1
> > c 1
> > d 3
> > e 3
> > f 1
> > ----------------------------------------------------
> >
> > As far as I am concerned f should have the value 3.
> >
> > This is causing me endless problems since case f is our house style
> > for breaking up expressions for readability. All our code will need to
> > be rechecked as a result. Is this behaviour a bug? If not, is it
> > possible to get R to generate a warning that several lines of an
> > expression are potentially being ignored, perhaps by turning on a
> > strict mode which requires the semi-colons?
> >
> > Thank you,
> >
> > Paul
> >
>
>
>
> --
> Nashi Power.
> http://nashi.podzone.org/
> Registered address: 7 Trescoe Gardens, Harrow, Middx., U.K.
>
>
>
> ------------------------------
>
> Message: 24
> Date: Fri, 13 Mar 2009 06:26:38 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22496355.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi Olivier,
>
> Thanks very much for your reply. I have tried your script, but when the
> script for the graph runs it comes up with several error messages repeating
> that 'supplied colour is not numeric or character'
>
>
>
> Olivier Delaigue wrote:
> >
> >> library(colorRamps)
> >> image(matrix(1:150, 10), col = blue2green2red(15))
> >
> > Regards,
> >
> > Olivier Delaigue
> >
> >
> > Ross Culloch wrote:
> >>
> >> Dear all,
> >>
> >> This seems like a simple problem but i've searched the help
files and
> >> tried various options but failed, so apologies in advance for
asking
> what
> >> i'm sure is an easy thing to do!
> >>
> >> In short, I have displayed behavioural data using the TraMineR
package
> >> such that there is a colour change between the transition of
behaviours,
> >> however, all the methods that i have used thus far have given me
gradual
> >> changes in colour such that it is impossible to tell the
difference from
> >> several of the behaviours. I have looked in the help section here,
and
> >> looked at various books and help files in R, but most seem intent
on
> >> gradual changes in colour for heat, terrain, depth, etc - i may
not be
> >> looking in the correct places, or perhaps i don't know what
i'm looking
> >> for, exactly.
> >>
> >> The code below is the closest i can get to colours being not too
> similar,
> >> but it's still hard to tell apart:
> >>
> >> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>
> >> What i ideally want to do is create a palette with random colours
that
> >> are no where near one another so that i can tell the 15 different
> >> behaviours apart - is this possible?
> >>
> >> If anyone can help i would be most greatful!
> >>
> >> Best wishes,
> >>
> >> Ross
> >>
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496355.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 25
> Date: Fri, 13 Mar 2009 14:26:35 +0100
> From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Subject: Re: [R] R multiline expression grief
> To: Paul Suckling <paul.suckling@gmail.com>
> Cc: r-help@r-project.org
> Message-ID: <49BA5F0B.3050009@idi.ntnu.no>
> Content-Type: text/plain; charset=ISO-8859-1
>
> jim holtman wrote:
> >
> >
> >> if (1 == 1) {print (TRUE)
> >>
> > + } else {print (FALSE)}
> > [1] TRUE
> >
> >
> > so the parse knows that the initial 'if' is not complete on
the single
> line.
> >
>
> ... and likewise the original code could be rewritten as
>
> f <- { a
> + b
> + c }
>
> vQ
>
>
>
> ------------------------------
>
> Message: 26
> Date: Fri, 13 Mar 2009 09:28:31 -0400
> From: Gabor Grothendieck <ggrothendieck@gmail.com>
> Subject: Re: [R] R multiline expression grief
> To: Paul Suckling <paul.suckling@gmail.com>
> Cc: r-help@r-project.org
> Message-ID:
> <971536df0903130628l7724857cl27658b0c6adcb5a9@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> If all your code has semicolons you could write a program that
> puts each statement on one line based on the semicolons and
> then passing it through R will reformat it in a standard way.
> See Rtidy.bat in the batchfiles distribution for the reformatting part:
> http://batchfiles.googlecode.com
>
> On Fri, Mar 13, 2009 at 8:55 AM, Paul Suckling
<paul.suckling@gmail.com>
> wrote:
> > Dear all.
> >
> > After much grief I have finally found the source of some weird
> > discrepancies in results generated using R. It turns out that this is
> > due to the way R handles multi-line expressions. Here is an example
> > with R version 2.8.1:
> >
> > ----------------------------------------------------
> > # R-script...
> >
> > r_parse_error <- function ()
> > {
> > ?a <- 1;
> > ?b <- 1;
> > ?c <- 1;
> > ?d <- a + b + c;
> > ?e <- a +
> > ? ?b +
> > ? ?c;
> > ?f <- a
> > ? ?+ b
> > ? ?+ c;
> > ?cat('a',a,"\n");
> > ?cat('b',b,"\n");
> > ?cat('c',c,"\n");
> > ?cat('d',d,"\n");
> > ?cat('e',e,"\n");
> > ?cat('f',f,"\n");
> > }
> > ----------------------------------------------------
> >> r_parse_error();
> > a 1
> > b 1
> > c 1
> > d 3
> > e 3
> > f 1
> > ----------------------------------------------------
> >
> > As far as I am concerned f should have the value 3.
> >
> > This is causing me endless problems since case f is our house style
> > for breaking up expressions for readability. All our code will need to
> > be rechecked as a result. Is this behaviour a bug? If not, is it
> > possible to get R to generate a warning that several lines of an
> > expression are potentially being ignored, perhaps by turning on a
> > strict mode which requires the semi-colons?
> >
> > Thank you,
> >
> > Paul
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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: 27
> Date: Fri, 13 Mar 2009 08:31:11 -0500
> From: hadley wickham <h.wickham@gmail.com>
> Subject: Re: [R] Unable to run smoother in qplot() or ggplot() -
> complains about knots
> To: Christopher David Desjardins <cddesjardins@gmail.com>
> Cc: r-help@r-project.org
> Message-ID:
> <f8e6ff050903130631i7c6aa638od315c26ea9f6d1f0@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Thu, Mar 12, 2009 at 5:37 PM, Christopher David Desjardins
> <cddesjardins@gmail.com> wrote:
> > I get the following error when I run qplot()
> >
> > qplot(grade, read,data = hhm.long.m, geom = c("point",
"smooth"))
> >
> > Error in smooth.construct.cr.smooth.spec(object, data, knots) :
> > ?x has insufficient unique values to support 10 knots: reduce k.
> >
> > I am not sure how to tackle this problem. When I take a subsample
(<
> 1000)
> > than I am able to run that function but with my sample of ~ ?40,000
qplot
> > gives me that error. I have 6 grades.
>
> You have 6 values on the x-axis? Maybe you want to just calculate the
> mean at each grade. If so, see
> http://had.co.nz/ggplot2/stat_summary.html
>
> Hadley
>
> --
> http://had.co.nz/
>
>
>
> ------------------------------
>
> Message: 28
> Date: Fri, 13 Mar 2009 06:32:58 -0700 (PDT)
> From: Ptit_Bleu <ptit_bleu@yahoo.fr>
> Subject: Re: [R] How to combine xtable and minipage with Sweave ?
> To: r-help@r-project.org
> Message-ID: <22496502.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hello Dieter,
>
> And thank you for the corrections.
> Concerning the point 3, I'm a bit lost. Is it a problem of place to put
the
> table and the graph side by side (my english is quite as low as my skills
> in
> Latex) ?
> I tried with \begin{minipage}{0.45\textwidth} instead of 0.7 and I put
> "//tiny" but no success.
>
> I tried to add some \begin{table} before
> \begin{minipage}[b]{0.45\linewidth}
> as I saw here :
>
>
http://texblog.wordpress.com/2007/08/01/placing-figurestables-side-by-side-minipage/
>
>
http://texblog.wordpress.com/2007/08/01/placing-figurestables-side-by-side-minipage/
> Again ! LaTeX Error: Not in outer par mode.
>
> Could you give me a last clue so that I can spend a nice week-end.
> Thanks in advance,
> Ptiti Bleu.
>
> last script :
> ------------------------------------------------
>
> \documentclass[a4paper]{article}
> \usepackage[T1]{fontenc}
> \usepackage[frenchb]{babel}
> \usepackage{geometry}
> \usepackage{color, pdfcolmk}
> \usepackage[mediumqspace]{SIunits}
>
>
> \geometry{a4paper,left=1cm,right=1cm,top=1cm,bottom=1.5cm}
> \date{}
>
> \begin{document}
>
> \DefineVerbatimEnvironment{Sinput}{Verbatim}{formatcom = {\color[rgb]{0, 0,
> 0.56}}}
> \DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom >
{\color[rgb]{0.56,
> 0, 0}}}
> \setkeys{Gin}{width=\textwidth}
>
> <<echo=FALSE, results=tex>>>
rg<-read.table(file="d:/RWork/rg.txt", sep=";",
dec=".", header=T, as.is
> =T)
> @
>
> \begin{figure}[ht]
> \begin{minipage}[b]{0.45\linewidth}
> \centering
> <<RsingleA,echo=F,fig=T,width=2.5,height=2.5>>> plot(1:10)
> @
> \caption{First figure}
> \label{fig:figure1}
> \end{minipage}
> \end{figure}
>
> \hspace{0.5cm}
>
> \begin{minipage}{0.45\textwidth}
> <<echo=FALSE, results=tex>>> library(xtable)
> print(xtable(rg), include.rownames=F, size="\\tiny")
> @
> \end{minipage}
>
> \end{document}
>
> --
> View this message in context:
>
http://www.nabble.com/How-to-combine-xtable-and-minipage-with-Sweave---tp22493636p22496502.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 29
> Date: Fri, 13 Mar 2009 06:34:12 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22496516.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi Hadley,
>
> Many thanks for your post. You're not wrong - i'm certainly finding
it
> challenging, but i assumed it was because i was making some basic errors.
> My
> data are 15 types of behaviour, e.g. resting, alert, locomotion, etc. so i
> need to use 15 colours to tell each appart in a barplot which esentially
> colour codes the sequence of behaviours. Therefore i need all colours to be
> individually identifiable with no possible confusion between the 15. As you
> touched on colourbrewer and other packages typically use gradients for
> changes in terrain, etc, which is not what i need, and as yousay, they only
> go up to 12. But what is frustrating is that there are 657 colours, and i
> can see that i could pick out 15 colours that are all very different, but i
> can physically work out how i can do that. I that makes sense?
>
>
>
>
>
>
> hadley wrote:
> >
> >> Thanks for the reply - some of the sets/palettes in the
RColorBrewer are
> >> ideal, but the problem with the problem i have is that they only
go up
> to
> >> 12
> >> colours, and i need 15 colours - so i assume the only thing i can
do is
> >> create my own palette, but i'm having limited success in
trying to work
> >> out
> >> how to do this.
> >
> > I'll think you'll find it very challenging to create 15
> > distinguishable colours - there's a good reason the colorbrewer
> > colours only go up to 12. Because you could describe your plot more
> > fully - it might be possible to display your data in a way that
> > doesn't require quite so many colours.
> >
> > Hadley
> >
> > --
> > http://had.co.nz/
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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.
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496516.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 30
> Date: Fri, 13 Mar 2009 07:36:54 -0600
> From: Kingsford Jones <kingsfordjones@gmail.com>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID:
> <2ad0cc110903130636y13cb5ca4j5f733e1ee407aaff@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Fri, Mar 13, 2009 at 7:19 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> wrote:
> >
> > Many thanks yet again for your reply, thanks for that method, i gave
it a
> go
> > and i checked 'mycols' and sure enough it had selected the
chosen colours
> > and listed their names, but when i used it for making the graph
warnigs
> > informed me that the supplied colour in not numeric or character.
>
>
> The data frame holds is storing the colors as class factor. You'll
> need to convert to character. Note
>
> > mycols <- colors.plot(T)
> > str(mycols$color.names)
> Factor w/ 4 levels "blue","green",..: 3 4 2 1
> > str(as.character(mycols$color.names))
> chr [1:4] "tomato1" "yellow1" "green"
"blue"
>
>
> hth,
> Kingsford
>
>
> >
> > Ross
> >
> >
> >
> > Kingsford Jones wrote:
> >>
> >> One option for creating your own palette is
> >>
> >> #install.packages('epitools')
> >> mycols <- colors.plot(locator = TRUE)
> >>
> >> then left-click on 15 colors of your liking and then right-click
'Stop'.
> >>
> >> mycols will be a data.frame with the third column containing the
color
> >> names.
> >>
> >> Kingsford
> >>
> >> On Fri, Mar 13, 2009 at 6:38 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> >> wrote:
> >>>
> >>> Hi Kingsford,
> >>>
> >>> Thanks for the reply - some of the sets/palettes in the
RColorBrewer
> are
> >>> ideal, but the problem with the problem i have is that they
only go up
> to
> >>> 12
> >>> colours, and i need 15 colours - so i assume the only thing i
can do is
> >>> create my own palette, but i'm having limited success in
trying to work
> >>> out
> >>> how to do this.
> >>>
> >>>
> >>> Kingsford Jones wrote:
> >>>>
> >>>> Try
> >>>>
> >>>> #install.packages('RColorBrewer')
> >>>> example(brewer.pal, pack='RColorBrewer')
> >>>>
> >>>>
> >>>> hth,
> >>>> Kingsford Jones
> >>>>
> >>>> On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch
<ross.culloch@dur.ac.uk
> >
> >>>> wrote:
> >>>>>
> >>>>> Dear all,
> >>>>>
> >>>>> This seems like a simple problem but i've searched
the help files and
> >>>>> tried
> >>>>> various options but failed, so apologies in advance
for asking what
> i'm
> >>>>> sure
> >>>>> is an easy thing to do!
> >>>>>
> >>>>> In short, I have displayed behavioural data using the
TraMineR
> package
> >>>>> such
> >>>>> that there is a colour change between the transition
of behaviours,
> >>>>> however,
> >>>>> all the methods that i have used thus far have given
me gradual
> changes
> >>>>> in
> >>>>> colour such that it is impossible to tell the
difference from several
> >>>>> of
> >>>>> the
> >>>>> behaviours. I have looked in the help section here,
and looked at
> >>>>> various
> >>>>> books and help files in R, but most seem intent on
gradual changes in
> >>>>> colour
> >>>>> for heat, terrain, depth, etc - i may not be looking
in the correct
> >>>>> places,
> >>>>> or perhaps i don't know what i'm looking for,
exactly.
> >>>>>
> >>>>> The code below is the closest i can get to colours
being not too
> >>>>> similar,
> >>>>> but it's still hard to tell apart:
> >>>>>
> >>>>> col <- rainbow(15,start = 0, end = 1, gamma = 0.5)
> >>>>>
> >>>>> What i ideally want to do is create a palette with
random colours
> that
> >>>>> are
> >>>>> no where near one another so that i can tell the 15
different
> >>>>> behaviours
> >>>>> apart - is this possible?
> >>>>>
> >>>>> If anyone can help i would be most greatful!
> >>>>>
> >>>>> Best wishes,
> >>>>>
> >>>>> Ross
> >>>>> --
> >>>>> View this message in context:
> >>>>>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> >>>>> Sent from the R help mailing list archive at
Nabble.com.
> >>>>>
> >>>>> ______________________________________________
> >>>>> R-help@r-project.org mailing list
> >>>>> 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
> >>>> 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.
> >>>>
> >>>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22495482.html
> >>> Sent from the R help mailing list archive at Nabble.com.
> >>>
> >>> ______________________________________________
> >>> R-help@r-project.org mailing list
> >>> 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
> >> 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.
> >>
> >>
> >
> > --
> > View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496241.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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: 31
> Date: Fri, 13 Mar 2009 06:58:25 -0700 (PDT)
> From: Ross Culloch <ross.culloch@dur.ac.uk>
> Subject: Re: [R] Selecting / creating unique colours for behavioural /
> transitional data
> To: r-help@r-project.org
> Message-ID: <22496949.post@talk.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> Hi Kingsford,
>
> Thanks yet again for your help! I have tried this, and once again i have
> failed! I have put the code that i've used below (i'm sure
you'll note some
> bad practice) if that is any use to help explain where i'm going wrong,
it
> seems to run fine and feeds back just what you noted it would, but i still
> get the error message as before - if you have any more suggestions i'd
be
> very greatful, i'm sure it is down to me missing something very simple!
>
> Thanks again,
>
> Ross
>
> > mycols <- colors.plot(T)
> > str(mycols$color.names)
> Factor w/ 15 levels "slategray2","snow3",..: 9 10 11
12 13 14 15 1 2 3 ...
> > ##Factor w/ 4 levels "blue","green",..: 3 4 2 1
> > str(as.character(mycols$color.names))
> chr [1:15] "tomato1" "tomato4" "turquoise1"
"violet" "violetred4" "wheat3"
> ...
> > ##chr [1:4] "tomato1" "yellow1" "green"
"blue"
> >
> > attach(dd)
> > seqiplot(data.seq[1:4,], withlegend=FALSE, ylab="Seal ID",
> + axes = F, title = "30-09-2008", cpal=mycols)
> There were 12 warnings (use warnings() to see them)
> > y.lab.pos <- c(0.7, 1.9, 3.1, 4.3)
> > axis(2, at=y.lab.pos, labels=paste(ID[1:4], sep=""),
tick=FALSE)
> > detach(dd)
>
>
>
> Kingsford Jones wrote:
> >
> > On Fri, Mar 13, 2009 at 7:19 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> > wrote:
> >>
> >> Many thanks yet again for your reply, thanks for that method, i
gave it
> a
> >> go
> >> and i checked 'mycols' and sure enough it had selected the
chosen
> colours
> >> and listed their names, but when i used it for making the graph
warnigs
> >> informed me that the supplied colour in not numeric or character.
> >
> >
> > The data frame holds is storing the colors as class factor.
You'll
> > need to convert to character. Note
> >
> >> mycols <- colors.plot(T)
> >> str(mycols$color.names)
> > Factor w/ 4 levels "blue","green",..: 3 4 2 1
> >> str(as.character(mycols$color.names))
> > chr [1:4] "tomato1" "yellow1" "green"
"blue"
> >
> >
> > hth,
> > Kingsford
> >
> >
> >>
> >> Ross
> >>
> >>
> >>
> >> Kingsford Jones wrote:
> >>>
> >>> One option for creating your own palette is
> >>>
> >>> #install.packages('epitools')
> >>> mycols <- colors.plot(locator = TRUE)
> >>>
> >>> then left-click on 15 colors of your liking and then
right-click
> 'Stop'.
> >>>
> >>> mycols will be a data.frame with the third column containing
the color
> >>> names.
> >>>
> >>> Kingsford
> >>>
> >>> On Fri, Mar 13, 2009 at 6:38 AM, Ross Culloch
<ross.culloch@dur.ac.uk>
> >>> wrote:
> >>>>
> >>>> Hi Kingsford,
> >>>>
> >>>> Thanks for the reply - some of the sets/palettes in the
RColorBrewer
> >>>> are
> >>>> ideal, but the problem with the problem i have is that
they only go up
> >>>> to
> >>>> 12
> >>>> colours, and i need 15 colours - so i assume the only
thing i can do
> is
> >>>> create my own palette, but i'm having limited success
in trying to
> work
> >>>> out
> >>>> how to do this.
> >>>>
> >>>>
> >>>> Kingsford Jones wrote:
> >>>>>
> >>>>> Try
> >>>>>
> >>>>> #install.packages('RColorBrewer')
> >>>>> example(brewer.pal, pack='RColorBrewer')
> >>>>>
> >>>>>
> >>>>> hth,
> >>>>> Kingsford Jones
> >>>>>
> >>>>> On Fri, Mar 13, 2009 at 3:20 AM, Ross Culloch <
> ross.culloch@dur.ac.uk>
> >>>>> wrote:
> >>>>>>
> >>>>>> Dear all,
> >>>>>>
> >>>>>> This seems like a simple problem but i've
searched the help files
> and
> >>>>>> tried
> >>>>>> various options but failed, so apologies in
advance for asking what
> >>>>>> i'm
> >>>>>> sure
> >>>>>> is an easy thing to do!
> >>>>>>
> >>>>>> In short, I have displayed behavioural data using
the TraMineR
> >>>>>> package
> >>>>>> such
> >>>>>> that there is a colour change between the
transition of behaviours,
> >>>>>> however,
> >>>>>> all the methods that i have used thus far have
given me gradual
> >>>>>> changes
> >>>>>> in
> >>>>>> colour such that it is impossible to tell the
difference from
> several
> >>>>>> of
> >>>>>> the
> >>>>>> behaviours. I have looked in the help section
here, and looked at
> >>>>>> various
> >>>>>> books and help files in R, but most seem intent on
gradual changes
> in
> >>>>>> colour
> >>>>>> for heat, terrain, depth, etc - i may not be
looking in the correct
> >>>>>> places,
> >>>>>> or perhaps i don't know what i'm looking
for, exactly.
> >>>>>>
> >>>>>> The code below is the closest i can get to colours
being not too
> >>>>>> similar,
> >>>>>> but it's still hard to tell apart:
> >>>>>>
> >>>>>> col <- rainbow(15,start = 0, end = 1, gamma =
0.5)
> >>>>>>
> >>>>>> What i ideally want to do is create a palette with
random colours
> >>>>>> that
> >>>>>> are
> >>>>>> no where near one another so that i can tell the
15 different
> >>>>>> behaviours
> >>>>>> apart - is this possible?
> >>>>>>
> >>>>>> If anyone can help i would be most greatful!
> >>>>>>
> >>>>>> Best wishes,
> >>>>>>
> >>>>>> Ross
> >>>>>> --
> >>>>>> View this message in context:
> >>>>>>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22492438.html
> >>>>>> Sent from the R help mailing list archive at
Nabble.com.
> >>>>>>
> >>>>>> ______________________________________________
> >>>>>> R-help@r-project.org mailing list
> >>>>>> 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
> >>>>> 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.
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22495482.html
> >>>> Sent from the R help mailing list archive at Nabble.com.
> >>>>
> >>>> ______________________________________________
> >>>> R-help@r-project.org mailing list
> >>>> 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
> >>> 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.
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496241.html
> >> Sent from the R help mailing list archive at Nabble.com.
> >>
> >> ______________________________________________
> >> R-help@r-project.org mailing list
> >> 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
> > 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.
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/Selecting---creating-unique-colours-for-behavioural---transitional-data-tp22492438p22496949.html
> Sent from the R help mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 32
> Date: Fri, 13 Mar 2009 15:11:19 +0100
> From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Subject: Re: [R] R multiline expression grief
> To: Paul Suckling <paul.suckling@gmail.com>
> Cc: r-help@r-project.org
> Message-ID: <49BA6987.8020006@idi.ntnu.no>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Gabor Grothendieck wrote:
> > If all your code has semicolons you could write a program that
> > puts each statement on one line based on the semicolons and
> > then passing it through R will reformat it in a standard way.
> > See Rtidy.bat in the batchfiles distribution for the reformatting
part:
> > http://batchfiles.googlecode.com
> >
>
> for the "puts each statement on one line based on the semicolons"
part,
> it's enough to pass the program through a simple sed script, *provided*
> that each line not ending in a semicolon is not a complete line:
>
> sed -n '/;\s*$/!{H}; /;\s*$/{H;g;s/\n//g;s/;\s*$//;p;s/.//g;h}'
> input > output
>
> (i guess this can be simplified.)
>
> vQ
>
>
>
> ------------------------------
>
> Message: 33
> Date: Fri, 13 Mar 2009 14:16:11 -0000 (GMT)
> From: (Ted Harding) <Ted.Harding@manchester.ac.uk>
> Subject: Re: [R] R multiline expression grief
> To: r-help@r-project.org
> Message-ID: <XFMail.090313141611.Ted.Harding@manchester.ac.uk>
> Content-Type: text/plain; charset=iso-8859-1
>
> On 13-Mar-09 12:55:35, Paul Suckling wrote:
> > Dear all.
> > After much grief I have finally found the source of some weird
> > discrepancies in results generated using R. It turns out that this is
> > due to the way R handles multi-line expressions. Here is an example
> > with R version 2.8.1:
> >
> > ----------------------------------------------------
> ># R-script...
> >
> > r_parse_error <- function ()
> > {
> > a <- 1;
> > b <- 1;
> > c <- 1;
> > d <- a + b + c;
> > e <- a +
> > b +
> > c;
> > f <- a
> > + b
> > + c;
> > cat('a',a,"\n");
> > cat('b',b,"\n");
> > cat('c',c,"\n");
> > cat('d',d,"\n");
> > cat('e',e,"\n");
> > cat('f',f,"\n");
> > }
> > ----------------------------------------------------
> >> r_parse_error();
> > a 1
> > b 1
> > c 1
> > d 3
> > e 3
> > f 1
> > ----------------------------------------------------
> >
> > As far as I am concerned f should have the value 3.
> >
> > This is causing me endless problems since case f is our house style
> > for breaking up expressions for readability. All our code will need to
> > be rechecked as a result. Is this behaviour a bug? If not, is it
> > possible to get R to generate a warning that several lines of an
> > expression are potentially being ignored, perhaps by turning on a
> > strict mode which requires the semi-colons?
> >
> > Thank you,
> > Paul
>
> The lines are not being ignored! In
>
> e <- a +
> b +
> c;
>
> each line (until the last) is syntactically incomplete, so the R
> parser continues on to the next line until the expression is
> complete; and the ";" is irrelevant for this purpose. Unlike C,
> but like (say) 'awk', the ";" in R serves to terminate an
expression
> when this is followed on the same line by another one, so it is
> basically a separator.
>
> In
>
> f <- a
> + b
> + c;
>
> however, "f <- a" is complete, so the value of 'a' is
assigned
> to f. The line "+ b" would have sent the value of 'b'
(the "+"
> being the unary operator "+" which does not change anything)
> to the console if it did not occur inside a function definition.
> As it is, although "+ b" is evaluated, because it is inside the
> function no putput is produced. Similarly for "+ c;" (and, once
> again, the ";" is irrelevant since a ";" at the end of
a line
> does nothing -- unless the line was syntatically incomplete at
> that point, in which case ";" as the expression terminator
> would trigger a syntax error since an incomplete expression
> was being terminated. So
>
> f <- a
> + b
> + c;
>
> is not a multiline expression. It is three expressions on three
> separate lines.
>
> The only suggestion I can make is that you have to change your
> "house style" -- it is at odds with the way the R parser works,
> and is bound to cause "much grief".
>
> Best wishes, and good luck!
> Ted.
>
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding@manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 13-Mar-09 Time: 14:16:08
> ------------------------------ XFMail ------------------------------
>
>
>
> ------------------------------
>
> Message: 34
> Date: Fri, 13 Mar 2009 10:21:10 -0400
> From: Gabor Grothendieck <ggrothendieck@gmail.com>
> Subject: Re: [R] R multiline expression grief
> To: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Cc: r-help@r-project.org
> Message-ID:
> <971536df0903130721r632f77a6t8ddabd576ec05eea@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Fri, Mar 13, 2009 at 10:11 AM, Wacek Kusnierczyk
> <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no> wrote:
> > Gabor Grothendieck wrote:
> >> If all your code has semicolons you could write a program that
> >> puts each statement on one line based on the semicolons and
> >> then passing it through R will reformat it in a standard way.
> >> See Rtidy.bat in the batchfiles distribution for the reformatting
part:
> >> http://batchfiles.googlecode.com
> >>
> >
> > for the "puts each statement on one line based on the
semicolons" part,
> > it's enough to pass the program through a simple sed script,
*provided*
> > that each line not ending in a semicolon is not a complete line:
> >
> > ? ?sed -n ?'/;\s*$/!{H};
/;\s*$/{H;g;s/\n//g;s/;\s*$//;p;s/.//g;h}'
> > input > output
> >
> > (i guess this can be simplified.)
> >
>
> One would want to be sure that a comment is not continued onto
> a code line.
>
>
>
> ------------------------------
>
> Message: 35
> Date: Fri, 13 Mar 2009 10:25:19 -0400 (EDT)
> From: Alan Zaslavsky <zaslavsk@hcp.med.harvard.edu>
> Subject: Re: [R] Is there any difference between <- and > To:
r-help@r-project.org
> Message-ID:
> <Pine.GSO.4.60.0903131001240.29200@mikado.hcp.med.harvard.edu>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>
> I would argue that this is a matter of preference and the arguments on
> "principle" for one side or another are not particularly
compelling.
> When the "=" was introduced for assignment, an argument was made
that
> name=value function arguments are also implicitly a kind of assignment.
> While Duncan has pointed out a typical example of how this could be
> ambiguous, <- also has its problems. A syntactic confusion with
"<-"
> arises in expressions like
>
> x<-3
>
> which could be read either as an assignment or as a logical expression
> comparing x to -3. Perhaps obviously ambiguous when written naked like
> this but when buried in a larger expression, it's easy to write an
> expression like that and discover that you have overwritten x. Some might
> (and have, most emphatically) advise that we should routinely insert
> spaces in our typing in a way that disambiguates such expressions but I
> find an argument that relies on spaces, which are usually syntactically
> unmeaningful, not very compelling.
>
> Besides, I just find that clumsy two-character arrow ugly! This is an
> esthetic matter -- reminds me too much of an emoticon. :-( For over 10
> years I used the alternative "_" underscore for S assignment
(nice as a
> single character with no competing syntactic meaning) but that has gone
> away, as far as I can tell primarily due to discomfort (disdain?) of
> developers who find it unattractive because of the use of "_" as
a
> connecting special category in OTHER contexts (C and shell programming).
>
> However, a mutually satisfactory solution is at hand!! If growth in the
> number of R programmers continues exponentially at its current rate, by
> the year 2097 the number of R programmers will exceed the population of
> the earth. At that point they will rise up and demand the restoration of
> the APL arrow key (remembered by some doddering guru who heard about it
> from her grandfather) to the standard keyboard, and our problem will be
> solved. (But there will be a minor irritation because in the New Zealand
> keyboard that key code will have been assigned to the locally popular
> sheep icon.)
>
> Alan Zaslavsky
>
>
>
> ------------------------------
>
> Message: 36
> Date: Fri, 13 Mar 2009 15:34:19 +0100
> From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Subject: Re: [R] R multiline expression grief
> To: Gabor Grothendieck <ggrothendieck@gmail.com>
> Cc: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>,
> r-help@r-project.org
> Message-ID: <49BA6EEB.1040505@idi.ntnu.no>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Gabor Grothendieck wrote:
> > On Fri, Mar 13, 2009 at 10:11 AM, Wacek Kusnierczyk
> > <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no> wrote:
> >
> >> Gabor Grothendieck wrote:
> >>
> >>> If all your code has semicolons you could write a program that
> >>> puts each statement on one line based on the semicolons and
> >>> then passing it through R will reformat it in a standard way.
> >>> See Rtidy.bat in the batchfiles distribution for the
reformatting part:
> >>> http://batchfiles.googlecode.com
> >>>
> >>>
> >> for the "puts each statement on one line based on the
semicolons" part,
> >> it's enough to pass the program through a simple sed script,
*provided*
> >> that each line not ending in a semicolon is not a complete line:
> >>
> >> sed -n '/;\s*$/!{H};
/;\s*$/{H;g;s/\n//g;s/;\s*$//;p;s/.//g;h}'
> >> input > output
> >>
> >> (i guess this can be simplified.)
> >>
> >>
> >
> > One would want to be sure that a comment is not continued onto
> > a code line.
> >
>
> of course; you'd have to handle comments separately.
>
> vQ
>
>
>
> ------------------------------
>
> Message: 37
> Date: Fri, 13 Mar 2009 09:35:08 -0500
> From: "Prew, Paul" <Paul.Prew@ecolab.com>
> Subject: Re: [R] Time-Ordered Clustering
> To: <r-help@r-project.org>
> Message-ID:
>
>
<6B810AFB14C606439FD57E5985E0379103531A42@useagan1500p.GLOBAL.ECOLAB.CORP
> >
>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear Ingmar,
>
> Thank you for your reply, I hope I answer your question ---
>
> A couple specific applications I have in mind:
>
> * We work with customers to reduce energy consumption from use of hot
> water. Baseline data was gathered at several locations by attaching a
> temperature sensor downstream from a hot water valve and recording the
> temperature every two minutes, over 10 days. Example questions: how
> many times was hot water used? What was the average duration? What
> were the average temperatures of the hot water?
>
> * We have products that have a 3-stage lifecycle: 1) ramp-up => 2)
> steady-state => 3) end of life. Performance is different in each stage.
> Data is gathered by attaching sensors to the product, and continuously
> monitoring. Example questions for each stage: What was the average
> duration? What was the average performance?
>
> I'm not very familiar with markov processes, and don't know what
detail
> is necessary to specify a transition matrix. The processes have not
> been regular/predictable/cyclical enough to consider time series
> analyses.
>
> Thanks, Paul
>
> ========================================================>
> Message: 123
> Date: Fri, 13 Mar 2009 10:45:45 +0100
> From: Ingmar Visser <i.visser@uva.nl>
> Subject: Re: [R] Time-Ordered Clustering
> To: "Prew, Paul" <Paul.Prew@ecolab.com>
> Cc: r-help@r-project.org
> Message-ID: <38589632-D0DB-4466-8A69-887B9BEEF90F@uva.nl>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> Dear Paul,
>
> Could you be more specific about what you mean here?
> I don't know the Runger paper so it's hard to tell what it is that
> you're looking for.
>
> Blatant plug: I developed a package for hidden Markov models
> called depmixS4 that in some sense does what you want: clustering
> taking dependencies over time into account by specifying a
> transition matrix.
>
> Similarly, there are other packages that fit similar models, searching
> for hidden markov model provides a number of them.
>
> hth, Ingmar Visser
>
> On 12 Mar 2009, at 23:39, Prew, Paul wrote:
>
> > Hello All,
> >
> > Does anyone know of a package that performs constraint-based clusters?
> > Ideally the package could perform "Time-Ordered Clustering",
a
> > technique
> > applied in a recent journal article by Runger, Nelson, Harnish
> > (using MS
> > Excel). Quote, "in our specific implementation of constrained
> > clustering, the clustering algorithm remains agglomerative and
> > hierarchical, but observations or clusters are constrained to only
> > join
> > if they are adjacent in time." CRAN searches using variants of
> > "cluster" and/or "constraint" and/or
"time" etc. didn't yield
> > anything I
> > could recognize.
> >
> > Thank you,
> > Paul
> >
> >
> > Paul Prew
> > Ecolab
> > Eagan, MN
> > paul.prew@ecolab.com
> > CONFIDENTIALITY NOTICE: =\ \ This e-mail communication a...{{dropped:
> > 12}}
> CONFIDENTIALITY NOTICE: =\ \ This e-mail communication a...{{dropped:12}}
>
>
>
> ------------------------------
>
> Message: 38
> Date: Fri, 13 Mar 2009 15:41:26 +0100
> From: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Subject: Re: [R] Is there any difference between <- and > To: Alan
Zaslavsky <zaslavsk@hcp.med.harvard.edu>
> Cc: r-help@r-project.org
> Message-ID: <49BA7096.2090205@idi.ntnu.no>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Alan Zaslavsky wrote:
> > I would argue that this is a matter of preference and the arguments on
> > "principle" for one side or another are not particularly
compelling.
>
> indeed; i have argued (i think...) for treating them as equals, the
> vhoice being a matter of taste.
>
>
> > When the "=" was introduced for assignment, an argument was
made that
> > name=value function arguments are also implicitly a kind of
assignment.
>
> sure they are. you assign (or not, depending on whether the arguments
> are actually used) to function-call-local variables, that is, the
> function's parameters.
>
>
> > While Duncan has pointed out a typical example of how this could be
> > ambiguous, <- also has its problems. A syntactic confusion with
"<-"
> > arises in expressions like
> >
> > x<-3
> >
> > which could be read either as an assignment or as a logical expression
> > comparing x to -3.
>
> ha! cool.
>
> > Perhaps obviously ambiguous when written naked like this but when
> > buried in a larger expression, it's easy to write an expression
like
> > that and discover that you have overwritten x.
>
> even worse if the code is processed in some way that might remove
> spaces, thus turning < - into <-.
>
> > Some might (and have, most emphatically) advise that we should
> > routinely insert spaces in our typing in a way that disambiguates such
> > expressions but I find an argument that relies on spaces, which are
> > usually syntactically unmeaningful, not very compelling.
> >
> > Besides, I just find that clumsy two-character arrow ugly!
>
> :)
>
> > This is an esthetic matter -- reminds me too much of an emoticon. :-(
> > For over 10 years I used the alternative "_" underscore for
S
> > assignment (nice as a single character with no competing syntactic
> > meaning) but that has gone away, as far as I can tell primarily due to
> > discomfort (disdain?) of developers who find it unattractive because
> > of the use of "_" as a connecting special category in OTHER
contexts
> > (C and shell programming).
> >
> > However, a mutually satisfactory solution is at hand!! If growth in
> > the number of R programmers continues exponentially at its current
> > rate, by the year 2097 the number of R programmers will exceed the
> > population of the earth. At that point they will rise up and demand
> > the restoration of the APL arrow key (remembered by some doddering
> > guru who heard about it from her grandfather) to the standard
> > keyboard, and our problem will be solved. (But there will be a minor
> > irritation because in the New Zealand keyboard that key code will have
> > been assigned to the locally popular sheep icon.)
>
> by that time r programs will be scanned directly from your head, i
> suppose, and the intelligent scanner will as gladly take <- as it will
> =, so the problem will rather vanish.
>
> vQ
>
>
>
> ------------------------------
>
> Message: 39
> Date: Fri, 13 Mar 2009 7:43:42 -0700
> From: <rkevinburton@charter.net>
> Subject: [R] updating packages?
> To: r-help@r-project.org
> Message-ID: <20090313104342.E40Y2.2497387.root@mp16>
> Content-Type: text/plain; charset=utf-8
>
> I am trying to update the packages that I have installed but I get the
> following warning messages:
>
> package 'tseries' successfully unpacked and MD5 sums checked
> Warning: cannot remove prior installation of package 'tseries'
> bundle 'forecasting' successfully unpacked and MD5 sums checked
> Warning: cannot remove prior installation of package 'forecast'
>
> What does that mean? How can I update these packages?
>
> Thank you.
>
> Kevin
>
>
>
> ------------------------------
>
> Message: 40
> Date: Fri, 13 Mar 2009 7:44:37 -0700
> From: <rkevinburton@charter.net>
> Subject: [R] updating packages?
> To: r-help@r-project.org
> Message-ID: <20090313104437.J6F3I.2497479.root@mp16>
> Content-Type: text/plain; charset=utf-8
>
> I am trying to update the packages that I have installed but I get the
> following warning messages:
>
> package 'tseries' successfully unpacked and MD5 sums checked
> Warning: cannot remove prior installation of package 'tseries'
> bundle 'forecasting' successfully unpacked and MD5 sums checked
> Warning: cannot remove prior installation of package 'forecast'
>
> What does that mean? How can I update these packages?
>
> Thank you.
>
> Kevin
>
>
>
> ------------------------------
>
> Message: 41
> Date: Fri, 13 Mar 2009 10:50:25 -0400
> From: David Winsemius <dwinsemius@comcast.net>
> Subject: Re: [R] code to find all distinct subsets of size r from a
> set of size n
> To: Dale Steele <dale.w.steele@gmail.com>
> Cc: r-help@r-project.org
> Message-ID: <90F07392-1482-4C86-B8DA-15ED07AD3749@comcast.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> If your subsets are to be taken from the rows of a dataframe, df, and
> the size is r, then something like this could satisfy:
>
> apply(combn(nrow(df), r), 2, function(x) df[x, ])
>
> (Although these are not really permutations as I understand that term.)
>
> --
> David Winsemius
>
> On Mar 13, 2009, at 8:35 AM, Dale Steele wrote:
>
> > I'm doing a permutation test and need to efficiently generate all
> > distinct subsets of size r from a set of size n. P 138 of MASS (4th
> > ed) notes that "The code to generate this efficiently is in the
> > scripts". I was unable to find this code on quick inspection of
the
> > \library\MASS\scripts file for Chapter 5 and 'subsets' is not
a
> > function in MASS.
> >
> > I did find this problem is discussed in RNews, Programmer's Niche
> > 1(1):27 - 30 and RNews, 1(2):29-31. Is there function in
'base' R or
> > other package to do this? Thanks. --Dale
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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, MD
> Heritage Laboratories
> West Hartford, CT
>
>
>
> ------------------------------
>
> Message: 42
> Date: Fri, 13 Mar 2009 22:50:58 +0800
> From: ronggui <ronggui.huang@gmail.com>
> Subject: Re: [R] updating packages?
> To: rkevinburton@charter.net
> Cc: r-help@r-project.org
> Message-ID:
> <38b9f0350903130750k787be2f8h2e0cf2cf657707ef@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Maybe they are loaded, use search() to see if they are. If yes, then
> use detach() to unload them first.
>
> Best
>
> 2009/3/13 <rkevinburton@charter.net>:
> > I am trying to update the packages that I have installed but I get the
> following warning messages:
> >
> > package 'tseries' successfully unpacked and MD5 sums checked
> > Warning: cannot remove prior installation of package 'tseries'
> > bundle 'forecasting' successfully unpacked and MD5 sums
checked
> > Warning: cannot remove prior installation of package
'forecast'
> >
> > What does that mean? How can I update these packages?
> >
> > Thank you.
> >
> > Kevin
> >
> > ______________________________________________
> > R-help@r-project.org mailing list
> > 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.
> >
>
>
>
> --
> HUANG Ronggui, Wincent
> Tel: (00852) 3442 3832
> PhD Candidate
> Dept of Public and Social Administration
> City University of Hong Kong
> Home page: http://asrr.r-forge.r-project.org/rghuang.html
>
> A sociologist is someone who, when a beautiful women enters the room
> and everybody look at her, looks at everybody.
>
>
>
> ------------------------------
>
> Message: 43
> Date: Fri, 13 Mar 2009 10:59:16 -0400 (EDT)
> From: Alan Zaslavsky <zaslavsk@hcp.med.harvard.edu>
> Subject: Re: [R] Is there any difference between <- and > To: Wacek
Kusnierczyk <Waclaw.Marcin.Kusnierczyk@idi.ntnu.no>
> Cc: r-help@r-project.org
> Message-ID:
> <Pine.GSO.4.60.0903131057500.29398@mikado.hcp.med.harvard.edu>
> Content-Type: TEXT/PLA...
>
> [Message clipped]
--
Vijaykumar Yogesh Muley
Senior Research Fellow,
Dr. Akash Ranjan's Group,
Computational and Functional Genomics Laboratory,
Bldg.7, Gruhakalpa
5-4-399/B, Nampally
Hyderabad- 500001
India
Ph.No: +91 9441189013
E-mail : vijay@cdfd.org.in
Life : A journey from Cell to Cell
----------------------------------------------
[[alternative HTML version deleted]]