Re: [R] How to remove rows based on frequency of factor and then difference date scores

2010-08-25 Thread Chris Beeley
Many thanks to you both. I have now filed away for future reference the 2 factor tapply as well as the extremely useful looking plyr library. And the code worked beautifully :-) On 24 Aug 2010, at 19:47, Abhijit Dasgupta, PhD aikidasgu...@gmail.com wrote: The paste-y argument is my usual

[R] how do R calculates the number of intervals between tick-marks

2010-08-25 Thread Antonio Olinto
Hello, I want to know how do R calculates the number of intervals between tick-marks in the y axis in a plot. I'm making a three y-axes plot and this information would help me a lot. Thanks in advance. Antonio Olinto

Re: [R] How to remove all objects except a few specified objects?

2010-08-25 Thread Cheng Peng
Thanks Josh and Karl. function dnrm() works well for my purpose. -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2337398.html Sent from the R help mailing list archive at Nabble.com.

[R] Documenting S4 Methods

2010-08-25 Thread Dario Strbenac
I'm in the process of converting some S3 methods to S4 methods. I have this function : setGeneric(enrichmentCalc, function(rs, organism, seqLen, ...){standardGeneric(enrichmentCalc)}) setMethod(enrichmentCalc, c(GenomeDataList, BSgenome), function(rs, organism, seqLen, ...) { ...

[R] Removing inter-bar spaces in barchart

2010-08-25 Thread Jonathan Greenberg
Rhelpers: I'm trying to make a barchart of a 2-group dataset (barchart(x~y,data=data,groups=z,horizontal=FALSE)). My problem is that I can't, for the life of me, seem to get rid of the inter-bar space -- box.ratio set to 1 doesn't do much. Any ideas? I'd ideally want zero space between the

[R] modify a nomogram

2010-08-25 Thread david dav
Hi, I would like to emphasize (zoom) the zone of a nomogram where the probability are 0.01 (nomogram built with nomogram, Design). As a consequence, I don't need to draw the part of the Total points axis with score 60 equivalent in my case to a linear predictor 4.5 - As far as I know, this is

Re: [R] Plot bar lines like excel

2010-08-25 Thread abotaha
Thanks a lot for the nice explanation. however, you mention that it will be nicer if there is data. yes you are right it be very kind of you if you include a simple example. where my data are: x1-c(11.5,9.38,9.3,9.8,9,9.06,9.42,8.8,9.05,8.14,8.2,7.59,6.92,6.47,7.12,

[R] Odp: Finding pairs

2010-08-25 Thread Petr PIKAL
Hi without other details it is probably impossible to give you any reasonable advice. Do you have your data already in R? What is their form? Are they in 2 columns in data frame? How did you get them paired? So without some more information probably nobody will invest his time as it seems no

Re: [R] How to include trend (drift term) in arima.sim

2010-08-25 Thread StephenRichards
Thanks to Mark Leeds and Dennis Murphy for their suggestions. The function arima.sim() only simulates stationary series without a trend, so the best approach appears to be to add the simulated stationary part to the trend as follows: Temp - arima.sim(n=N.Years.Forecast, list(ar=AR.Coef,

Re: [R] how to plot y-axis on the right of x-axis

2010-08-25 Thread Gavin Simpson
On Wed, 2010-08-25 at 07:12 +0800, elaine kuo wrote: Dear List, I have a richness data distributing across 20 N to 20 S latitude. (120 E-140 E longitude). I would like to draw the richness in the north hemisphere and a regression line in the plot (x-axis: latitude, y-axis: richness in

[R] multi day R run crashed - is there a log

2010-08-25 Thread Martin Tomko
Dear all, I am using an R 2.10 installation on a Windows 203 server that I have no control over. After a multi-day run I found that it was terminated/crashed. Is there any log kept by R where I could see whether something/what happened? The same process has been run beofre on a smaller

Re: [R] Draw a perpendicular line?

2010-08-25 Thread Benno Pütz
Maybe perp.slope = -1/slope abline(cy - cx*perp.slope, perp.slope) where cx, cy are x- and y-coordinate of C, resp., and slope the slope you calculated for the line through A and B Am 24.Aug.2010 um 0:04 schrieb CZ: Hi, I am trying to draw a perpendicular line from a point to two

Re: [R] Odp: Finding pairs

2010-08-25 Thread Mike Rhodes
Dear Mr Petr Pikal I am extremely sorry for the manner I have raised the query. Actually that was my first post to this R forum and in fact even I was also bit confused while drafting the query, for which I really owe sorry to all for consuming the precious time. Perhaps I will try to redraft

[R] help

2010-08-25 Thread Loos, Martin
Good afternoon! It may seem trivial to some/most of You, but I found it difficult to properly include a C++-based .dll into a package that I want to build for usage in R. I read through the Writing R extensions... R administration ... instructions, but it seems I did not grasp the bigger

Re: [R] lmer() causes segfault

2010-08-25 Thread Bertolt Meyer
Ben Bolker bbolker at gmail.com writes: Bertolt Meyer bmeyer at sozpsy.uzh.ch writes: Hello lmer() - users, A call to the lmer() function causes my installation of R (2.11.1 on Mac OS X 10.5.8) to crash and I am trying to figure out the problem. [snip snip] detach(package:nlme)

Re: [R] Draw a perpendicular line?

2010-08-25 Thread baptiste auguie
hi, also, make sure you have set the aspect ratio to 1:1 when plotting (asp=1). HTH, baptiste On 25 August 2010 10:20, Benno Pütz pu...@mpipsykl.mpg.de wrote: Maybe perp.slope = -1/slope abline(cy - cx*perp.slope, perp.slope) where cx, cy are x- and y-coordinate of C, resp., and slope

Re: [R] percentage sign in expression

2010-08-25 Thread e-letter
On 24/08/2010, David Winsemius dwinsem...@comcast.net wrote: On Aug 24, 2010, at 9:37 AM, e-letter wrote: Readers, According to the documentation for the function 'plotmath' there is no apparent possibility to add the percent sign (%) to a plot function, Where did you see an assertion

Re: [R] Rotate x-axis label on log scale

2010-08-25 Thread Tim Elwell-Sutton
Yes, I do want the labels on the x-axis but the problem arises when the y-axis is logarithmic presumably because the position labels on the x-axis still needs to be defined in terms of x and y coordinates. The simplified examples below should make the problem clearer. I can't see a way of

Re: [R] Odp: Finding pairs

2010-08-25 Thread Petr PIKAL
Hm r-help-boun...@r-project.org napsal dne 25.08.2010 09:43:26: Dear Mr Petr Pikal I am extremely sorry for the manner I have raised the query. Actually that was my first post to this R forum and in fact even I was also bit confused while drafting the query, for which I really owe sorry

[R] (no subject)

2010-08-25 Thread Mohammad Ali Vakili
Hi I am using repeated meaturement data for my project and I want to use quantile regression with multilevel or panel data in R. I dont find the basic version of software in R, so I have difficulty in using it. I would also appreciate if anyone more proficient in R could help me how to run

Re: [R] Documenting S4 Methods

2010-08-25 Thread Martin Maechler
Dario Strbenac d.strbe...@garvan.org.au on Wed, 25 Aug 2010 13:00:03 +1000 (EST) writes: I'm in the process of converting some S3 methods to S4 methods. I have this function : setGeneric(enrichmentCalc, function(rs, organism, seqLen, ...){standardGeneric(enrichmentCalc)})

Re: [R] how to plot y-axis on the right of x-axis

2010-08-25 Thread Jim Lemon
On 08/25/2010 09:12 AM, elaine kuo wrote: Dear List, I have a richness data distributing across 20 N to 20 S latitude. (120 E-140 E longitude). I would like to draw the richness in the north hemisphere and a regression line in the plot (x-axis: latitude, y-axis: richness in the north

Re: [R] percentage sign in expression

2010-08-25 Thread Gavin Simpson
On Wed, 2010-08-25 at 09:32 +0100, e-letter wrote: On 24/08/2010, David Winsemius dwinsem...@comcast.net wrote: On Aug 24, 2010, at 9:37 AM, e-letter wrote: Readers, According to the documentation for the function 'plotmath' there is no apparent possibility to add the percent sign

Re: [R] Cran-packages-ProfessoR- how to Automatically email a file to an address using the perl program.

2010-08-25 Thread veepsirtt
Hi Jonathan lees How to use this code and after installing ProfessR package autoemail(eadd, sfile, hnote = Exam Results) thanks veepsirtt -- View this message in context:

Re: [R] help

2010-08-25 Thread Ingmar Visser
Martin, On Wed, Aug 25, 2010 at 10:17 AM, Loos, Martin martin.l...@eawag.ch wrote: Good afternoon! It may seem trivial to some/most of You, but I found it difficult to properly include a C++-based .dll into a package that I want to build for usage in R. I read through the Writing R

Re: [R] Rotate x-axis label on log scale

2010-08-25 Thread Jim Lemon
On 08/25/2010 01:37 PM, Tim Elwell-Sutton wrote: Hi Jim Thanks for this. The staxlab function seems very useful. Unfortunately, the rotation option doesn't seem to work for me when the y-axis is on a log scale. It will stagger the labels but not rotate them. There's no error message. On a linear

Re: [R] Plot bar lines like excel

2010-08-25 Thread Dennis Murphy
Hi: Here's a ggplot2 version of your graph. Since you didn't include the dates, I had to make them up, and it may have some consequence with respect to your times because yours don't appear to be exactly equally spaced. I created two data frames - an 'original' one that contains both series in

Re: [R] Plot bar lines like excel

2010-08-25 Thread abotaha
Woow, it is amazing, thank you very much. yes i forget to attach the dates, however, the dates in my case is every 16 days. so how i can use 16 day interval instead of month in by option. cheers, -- View this message in context:

Re: [R] Odp: Finding pairs

2010-08-25 Thread Mike Rhodes
Dear Mr Petr PIKAL After reading the R code provided by you, I realized that I would have never figured out how this could have been done. I am going to re-read again and again your code to understand the logic and the commands you have provided. Thanks again from the heart for your kind advice.

[R] Merging two data set in R,

2010-08-25 Thread Mangalani Peter Makananisa
Dear R Gurus, I am currently working on the two dataset ( A and B), they both have the same fields:ID , REGION, OFFICE, CSTART, CEND, NCYCLE, STATUS and CB. I want to merge the two data set by ID. The problem I have is that the in data A, the ID's are unique. However in the data set B,

[R] keys in score.items in package psych

2010-08-25 Thread Frans Marcelissen
Hi Ruru's, score.items in package psych is very handy for scoring test items. It has the structure score.items(keys,items). For instance: score.items(c(1,1,1),data.frame(a1=rep(1,5),a2=rep(1,5),a3=rep(1,5)))$scores correctly gives 1 on each case. But if key -1,0,1 the following happens

Re: [R] Cran-packages-ProfessoR- how to Automatically email a file to an address using the perl program.

2010-08-25 Thread Jonathan Lees-2
Yes - please look at the function IDandEM.R (This stand for IDentification and EMail) in there it has a complete function that uses the autoemail function - I use this all the time. There is a logical option (SEND) on whether to actually mail the file to the recipient. The IDandEM function

[R] using an objects contents in a text string

2010-08-25 Thread josquint
Hi, I am (trying) to write a script that will execute a set of functions and then to write some of the output data frames to file. I am wanting to be able to just change a single object and have this them populate through the functions etc. I have no trouble making this work when the function is

[R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread skan
down vote favorite Hello I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements, whith each element equal to the first element of the day. That's, The first element everyday is repeated

Re: [R] lmer() causes segfault

2010-08-25 Thread Dennis Murphy
Hi: Let's start with the data: str(test.data) 'data.frame': 100 obs. of 4 variables: $ StudentID: num 17370 17370 17370 17370 17379 ... $ GroupID : num 1 1 1 1 1 1 1 1 1 1 ... $ Time : num 1 2 3 4 1 2 3 4 1 2 ... $ Score: num 76.8 81.8 89.8 92.8 75.9 ... Both StudentID and

[R] Surprising behaviour survey-package with missing values

2010-08-25 Thread Jan van der Laan
Dear list, I got some surprising results when using the svytotal routine from the survey package with data containing missing values. Some example code demonstrating the behaviour is included below. I have a stratified sampling design where I want to estimate the total income. In some strata

Re: [R] Merging two data set in R,

2010-08-25 Thread Sarah Goslee
First you need to clarify what you'd like to happen when the ID in B is not unique. What do you want the resulting dataframe to look like? Some possible answers involve using different options for merge() or using unique() to remove duplicates from B before merging. But at least to me, merge or

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread Gabor Grothendieck
On Wed, Aug 25, 2010 at 7:43 AM, skan juanp...@gmail.com wrote: I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements, whith each element equal to the first element of the day. That's, The first element

Re: [R] multi day R run crashed - is there a log

2010-08-25 Thread Sarah Goslee
Oh dear. No there isn't. I do a lot of very long runs, and have learned to write out intermediate steps. Depending on what you are doing, saving the RData file periodically may be appropriate, or writing out a csv file of results so far, or even just printing something to the output file (if you

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread Gabor Grothendieck
On Wed, Aug 25, 2010 at 7:56 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Aug 25, 2010 at 7:43 AM, skan juanp...@gmail.com wrote: I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements,

Re: [R] (no subject)

2010-08-25 Thread Sarah Goslee
Hello, http://www.rseek.org is extremely useful if you know what you want to do but not how to do it. Going there and putting quantile regression with multilevel data into the search box returns many references to functions and packages that may be of use. This list can't do much more for you

Re: [R] using an objects contents in a text string

2010-08-25 Thread josquint
ALSO I have had a play with cat() but have also not got this to work e.g. write(x, file = cat(input.variable.name , file = , sep = _data.txt, ), ...) but this does not seem to work and I'm sure it is not the correct use of cat() Thanks. -- View this message in context:

Re: [R] Merging two data set in R,

2010-08-25 Thread Sarah Goslee
What do you want to happen when there are duplicates? A: ID X 1 a 2 b 3 c B: ID Y 1 x 2 y 2 z What happens to ID 1? 2? 3? in your desired output? The all.x and all.y options might be of use. Sarah On Wed, Aug 25, 2010 at 8:00 AM, Mangalani Peter Makananisa pmakanan...@sars.gov.za

Re: [R] using an objects contents in a text string

2010-08-25 Thread Sarah Goslee
I'm a bit confused by your question, but you might just want paste: paste(input.variable.name, data.txt, sep=_) Sarah On Wed, Aug 25, 2010 at 8:06 AM, josquint josqu...@unimelb.edu.au wrote: ALSO    I have had a play with cat() but have also not got this to work e.g. write(x,

Re: [R] multi day R run crashed - is there a log

2010-08-25 Thread Martin Tomko
Hi Sarah, thank you very much for your answer. I have been spitting things out on screen, but unfortunately I have not run it as a batch log, but in the interactive window, so when the GUI crashed I was left without trace... I guess I should google how to run it from a batch. I should also

Re: [R] multi day R run crashed - is there a log

2010-08-25 Thread Sarah Goslee
Hi, On Wed, Aug 25, 2010 at 8:11 AM, Martin Tomko martin.to...@geo.uzh.ch wrote: Hi Sarah, thank you very much for your answer. I have been spitting things out on screen, but unfortunately I have not run it as a batch log, but in the interactive window, so when the GUI crashed I was left

[R] Estimate average standard deviation of mean of two dependent groups

2010-08-25 Thread Jokel Meyer
Dear R-experts! I am currently running a meta-analysis with the help of the great metafor package. However I have some difficulties setting up my raw data to enter it to the meta-analysis models. I have a group of subjects that have been measured in two continuous variables (A B). I have the

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread Gabor Grothendieck
On Wed, Aug 25, 2010 at 7:43 AM, skan juanp...@gmail.com wrote:  down vote  favorite Hello I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements, whith each element equal to the first element of

Re: [R] Merging two data set in R,

2010-08-25 Thread Sarah Goslee
Almost. You'll need to handle the duplicate ID yourself since R has no way of knowing which one(s) to change to NA. As I already suggested, you can use unique() in conjunction with whatever logical rules you require for choosing those values. As I also already suggested, all.y and all.x are the

Re: [R] modify a nomogram

2010-08-25 Thread Frank Harrell
Update to the rms package which is the version now being actively supported. New features will not be added to Design. The nomogram function in rms separates the plotting into a plot method for easier understanding. You can control all axes - some experimentation can tell you if you can

Re: [R] Plot bar lines like excel

2010-08-25 Thread Hadley Wickham
On Wed, Aug 25, 2010 at 6:05 AM, abotaha yaseen0...@gmail.com wrote: Woow, it is amazing, thank you very much. yes i forget to attach the dates, however, the dates in my case is every 16 days. so how i can use 16 day interval instead of month in by option. Here's one way using the lubridate

Re: [R] multi day R run crashed - is there a log

2010-08-25 Thread Martin Tomko
Hi , thanks, the lower.tri idea is I guess the best way. Will try that. Cheers Martin On 8/25/2010 2:21 PM, Sarah Goslee wrote: Hi, On Wed, Aug 25, 2010 at 8:11 AM, Martin Tomkomartin.to...@geo.uzh.ch wrote: Hi Sarah, thank you very much for your answer. I have been spitting things out

[R] multiple x factors using the sciplot package

2010-08-25 Thread Jordan Ouellette-Plante
Dear R community, I am a beginner using the sciplot package to graph barplots. I would like to be able to graph two x factors (Sampling.year and Period). Sampling.year: 2006, 2007, 2008, 2009 Period: First, Second, Total The parameter group is the different species I looked at. They

Re: [R] percentage sign in expression

2010-08-25 Thread David Winsemius
On Aug 25, 2010, at 4:32 AM, e-letter wrote: On 24/08/2010, David Winsemius dwinsem...@comcast.net wrote: On Aug 24, 2010, at 9:37 AM, e-letter wrote: Readers, According to the documentation for the function 'plotmath' there is no apparent possibility to add the percent sign (%) to a

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread skan
thanks I'll try them, Why do you use the brackets in zz[] ? -- View this message in context: http://r.789695.n4.nabble.com/Repeat-the-first-day-data-through-all-the-day-Zoo-tp2338069p2338266.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] how do R calculates the number of intervals between tick-marks

2010-08-25 Thread David Winsemius
On Aug 24, 2010, at 7:05 PM, Antonio Olinto wrote: Hello, I want to know how do R calculates the number of intervals between tick-marks in the y axis in a plot. ?axTicks # and then look at the other citations and the code as needed I'm making a three y-axes plot and this information

[R] Comparing samples with widely different uncertainties

2010-08-25 Thread Sandy Small
Hi This is probably more of a statistics question than a specific R question, although I will be using R and need to know how to solve the problem in R. I have several sets of data (ejection fraction measurements) taken in various ways from the same set of (~400) patients (so it is paired data).

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread Gabor Grothendieck
On Wed, Aug 25, 2010 at 9:48 AM, skan juanp...@gmail.com wrote: thanks I'll try them, Why do you use the brackets in zz[]  ? So it stays a zoo object with the same index. We are only replacing the data part. __ R-help@r-project.org mailing list

Re: [R] how do R calculates the number of intervals between tick-marks

2010-08-25 Thread Henrique Dallazuanna
Take a look at pretty function. On Tue, Aug 24, 2010 at 8:05 PM, Antonio Olinto aolint...@bignet.com.brwrote: Hello, I want to know how do R calculates the number of intervals between tick-marks in the y axis in a plot. I'm making a three y-axes plot and this information would help me a

Re: [R] Odp: Finding pairs

2010-08-25 Thread Petr PIKAL
Hi well, I will add some explanation r-help-boun...@r-project.org napsal dne 25.08.2010 11:24:38: Dear Mr Petr PIKAL After reading the R code provided by you, I realized that I would have never figured out how this could have been done. I am going to re-read again and again your code to

[R] approxfun-problems (yleft and yright ignored)

2010-08-25 Thread Samuel Wuest
Dear all, I have run into a problem when running some code implemented in the Bioconductor panp-package (applied to my own expression data), whereby gene expression values of known true negative probesets (x) are interpolated onto present/absent p-values (y) between 0 and 1 using the *approxfun -

Re: [R] Comparing samples with widely different uncertainties

2010-08-25 Thread peter dalgaard
On Aug 25, 2010, at 3:57 PM, Sandy Small wrote: Hi This is probably more of a statistics question than a specific R question, although I will be using R and need to know how to solve the problem in R. I have several sets of data (ejection fraction measurements) taken in various ways from

Re: [R] Comparing samples with widely different uncertainties

2010-08-25 Thread Marc Schwartz
On Aug 25, 2010, at 8:57 AM, Sandy Small wrote: Hi This is probably more of a statistics question than a specific R question, although I will be using R and need to know how to solve the problem in R. I have several sets of data (ejection fraction measurements) taken in various ways from

[R] SEM : Warning : Could not compute QR decomposition of Hessian

2010-08-25 Thread Anne Mimet
Hi useRs, I'm trying for the first time to use a sem. The model finally runs, but gives a warning saying : In sem.default(ram = ram, S = S, N = N, param.names = pars, var.names = vars, : Could not compute QR decomposition of Hessian. Optimization probably did not converge. I found in

[R] frequency, count rows, data for heat map

2010-08-25 Thread rtsweeney
Hi all, I have read posts of heat map creation but I am one step prior -- Here is what I am trying to do and wonder if you have any tips? We are trying to map sequence reads from tumors to viral genomes. Example input file : 111 abc 111 sdf 111 xyz 1079 abc 1079 xyz 1079 xyz

[R] lattice help required

2010-08-25 Thread Kay Cichini
hello, i want to stack two lattice plots beneath each other using one x-axis and sharing the same text-panels, like: # library(lattice) y1 - rnorm(100,100,10) y2 - rnorm(100,10,1) facs-expand.grid(Sites=rep(c(Site I,Site

Re: [R] lmer() causes segfault

2010-08-25 Thread Bertolt Meyer
Dennis, just wow. Thank you so much. I knew it was something trivial - in this case the variable type of the of the grouping variables. However, something as trivial as this should not throw a segfault IMHO. I tried subscribing to R-sig-mixed this morning, but the corresponding mail

Re: [R] frequency, count rows, data for heat map

2010-08-25 Thread Jan van der Laan
Your problem is not completely clear to me, but perhaps something like data - data.frame( a = rep(c(1,2), each=10), b = rep(c('a', 'b', 'c', 'd'), 5)) library(plyr) daply(data, a ~ b, nrow) does what you need. Regards, Jan On Wed, Aug 25, 2010 at 4:53 PM, rtsweeney tripswee...@gmail.com

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread skan
# duplicated / na.locf doesn't work it says Error in fix.by(by.x, x) : 'by' must specify valid column(s) if I use ifelse instead of ifelse.zoo it works but it gives me a non zoo vector. Myabe is because my zoo version is older. cheers -- View this message in context:

Re: [R] Estimate average standard deviation of mean of two dependent groups

2010-08-25 Thread Joshua Wiley
Hi Jokel, If I remember correctly 1) The variance of the sum of two variables X and Y is: var(X) + var(Y) + (2 * cov(X, Y)) If you create some sample data, you can verify this by: var((X + Y)) 2) The variance of a random variable (X) multiplied by some constant (K) is equal to the

Re: [R] lattice help required

2010-08-25 Thread RICHARD M. HEIBERGER
Kay, doe this do what you want? dotplot(y1+y2 ~ facs$Treatment|facs$Sites, outer=TRUE, scales = list(x = list(rot = 90, tck=c(1,0))), ylab=c(y1, y2), xlab=c(Site 1, Site 2), strip=FALSE) On Wed, Aug 25, 2010 at 11:04 AM, Kay Cichini

Re: [R] Draw a perpendicular line?

2010-08-25 Thread William Revelle
At 3:04 PM -0700 8/23/10, CZ wrote: Hi, I am trying to draw a perpendicular line from a point to two points. Mathematically I know how to do it, but to program it, I encounter some problem and hope can get help. Thanks. I have points, A, B and C. I calculate the slope and intercept for line

[R] Change value of a slot of an S4 object within a method.

2010-08-25 Thread Joris Meys
Dear all, I have an S4 class with a slot extra which is a list. I want to be able to add an element called name to that list, containing the object value (which can be a vector, a dataframe or another S4 object) Obviously setMethod(add.extra,signature=c(PM10Data,character,vector),

Re: [R] multiple x factors using the sciplot package

2010-08-25 Thread Dennis Murphy
Hi: You can probably do what you want in either ggplot2 or lattice, but I would recommend at least a couple different approaches: (1) Plot individual bar charts by combinations of year and period. This is easy to do in both ggplot2 and lattice: in ggplot2, one would use geom_bar(x) +

Re: [R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-25 Thread holstius
Hi Marie, this link may be helpful if you want to build it for both architectures, 32-bit and 64-bit. I struggled with the same problem not too long ago. http://cran.rakanu.com/bin/macosx/RMacOSX-FAQ.html#Building-universal-package I ended up writing a very simple Makefile to accompany [my

Re: [R] Change value of a slot of an S4 object within a method.

2010-08-25 Thread Steve Lianoglou
Hi Joris, On Wed, Aug 25, 2010 at 11:56 AM, Joris Meys jorism...@gmail.com wrote: Dear all, I have an S4 class with a slot extra which is a list. I want to be able to add an element called name to that list, containing the object value (which can be a vector, a dataframe or another S4

Re: [R] Odp: Finding pairs

2010-08-25 Thread Dennis Murphy
Hi: I'm just ideating here (think IBM commercial...) but perhaps a graphical model approach might be worth looking into. It seems to me that Mr. Rhodes is looking for clusters of banks that are under the same ownership umbrella. That information is not directly available in a single variable, but

[R] package MuMI

2010-08-25 Thread Marino Taussig De Bodonia, Agnese
Hello, I am using the package MuMI to run all the possible combinations of variables in my full model, and select my best models. When I enter my variables in the original model I write them like this lm(y~ a +b +c +a:b) However, MuMI will also use the variable b:a, which I do not want in my

Re: [R] lattice help required

2010-08-25 Thread Kay Cecil Cichini
exactly - thanks a lot, richard! kay Zitat von RICHARD M. HEIBERGER r...@temple.edu: Kay, doe this do what you want? dotplot(y1+y2 ~ facs$Treatment|facs$Sites, outer=TRUE, scales = list(x = list(rot = 90, tck=c(1,0))), ylab=c(y1, y2), xlab=c(Site 1, Site

Re: [R] Repeat the first day data through all the day. Zoo

2010-08-25 Thread Gabor Grothendieck
On Wed, Aug 25, 2010 at 11:18 AM, skan juanp...@gmail.com wrote: # duplicated / na.locf   doesn't work it says Error in fix.by(by.x, x) : 'by' must specify valid column(s) if I use ifelse instead of ifelse.zoo it works but it gives me a non zoo vector. Myabe is because my zoo version is

[R] several odfWeave questions

2010-08-25 Thread Ben Bolker
[Sending both to the maintainer and to R-help, in case anyone else has answers ...] I've looked in odfWeave documentation, vignette, and poked around on the web some, and haven't found answers yet. 1a. am I right in believing that odfWeave does not respect the 'keep.source' option? Am I

Re: [R] frequency, count rows, data for heat map

2010-08-25 Thread Dennis Murphy
Hi: Here are a couple of ways to render a basic 2D table. Let's call your input data frame dat: names(dat) - c('samp', 'sequen') ssTab - as.data.frame(with(dat, table(samp, sequen))) ssTab # data frame version samp sequen Freq 1 111abc1 2 1079abc1 3 5576abc1 4

Re: [R] Change value of a slot of an S4 object within a method.

2010-08-25 Thread Joris Meys
Hi Steve, thanks for the tip. I'll definitely take a closer look at your solution for implementation for future use. But right now I don't have the time to start rewriting my class definitions. Luckily, I found where exactly things were going wrong. After reading into the documentation about

Re: [R] How to obtain seed after generating random number?

2010-08-25 Thread Greg Snow
If you find yourself doing things like this often, but don't want to explicitly set the seed, or save seeds before simulating, then you can run the following code (or put it into .Rprofile or similar): .Last.Random.seed - .Random.seed addTaskCallback( function(expr, val, ok, visible){

[R] nls self starting function

2010-08-25 Thread Marlin Keith Cox
I need the simple function for the following set of data. This is a toy version of my data, but the error is persistent in both. To compare with excel, I would just 1) format trendline, 2) display equation and R-squared on chart. I obviously tried to use a nls and wanted to use the self

Re: [R] lattice help required

2010-08-25 Thread Kay Cichini
... i added relation=free to account for diffferent ranges of y1 and y2: dotplot(y1+y2 ~ facs$Treatment|facs$Sites, outer=TRUE, scales = list(y = list(relation=free), x = list(rot = 90, tck=c(1,0))), ylab=c(y1, y2), xlab=c(Site 1, Site 2),

Re: [R] lattice help required

2010-08-25 Thread RICHARD M. HEIBERGER
The multiple y axes are protecting you in this situation. z - cbind(rnorm(100,c(1,10),1), rnorm(100,c(20,30),1)) dotplot(z[,1]+z[,2] ~ facs$Treatment|facs$Sites, outer=TRUE, scales = list( y = list( relation=free)), ylab=c(y1, y2),

[R] Secant Method Convergence (Method to replicate Excel XIRR/IRR)

2010-08-25 Thread Adrian Ng
Hi, I am new to R, and as a first exercise, I decided to try to implement an XIRR function using the secant method. I did a quick search and saw another posting that used the Bisection method but wanted to see if it was possible using the secant method. I would input a Cash Flow and Date

Re: [R] Merging two data set in R,

2010-08-25 Thread Danne Mora
try the following merge command. merge(A,B, by = intersect(names(A), names(B)), all.x=FALSE, all.y=FALSE) or merge(A,B, by = ID, all.x=FALSE, all.y=FALSE) Dannemora On Wed, Aug 25, 2010 at 5:35 AM, Mangalani Peter Makananisa pmakanan...@sars.gov.za wrote: Dear R Gurus, I am currently

[R] Showing a line function on the ploat area

2010-08-25 Thread Neta
I have a collection of results. I use R to get the linearization presented. how can I get R to show the equation and R^2 value on the plot area next to the graph? -- View this message in context: http://r.789695.n4.nabble.com/Showing-a-line-function-on-the-ploat-area-tp2338389p2338389.html Sent

Re: [R] Plot bar lines like excel

2010-08-25 Thread abotaha
Great .. thanks for the to much help and i too appreciate hel p and explanation Cheers -- View this message in context: http://r.789695.n4.nabble.com/Plot-bar-lines-like-excel-tp2337089p2338158.html Sent from the R help mailing list archive at Nabble.com.

[R] GLM outputs in condensed versus expanded table

2010-08-25 Thread francogrex
Hi I'm having different outputs from GLM when using a condensed table V1 V2 V3 Present Absent 0 0 0 3 12 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 7 20 1 0

[R] NewJerseyR Meeting

2010-08-25 Thread Sarah Lewis
Mango Solutions are proud to announce the first NewJerseyR Meeting to be held on the 16th September 2010. Please see details below: NewJerseyR Date: Tuesday 16th September Time: 6.30pm - 9.30pm Venue: Renaissance Woodbridge Hotel - Iselin, New Jersey The agenda has yet

Re: [R] how to plot y-axis on the right of x-axis

2010-08-25 Thread Antonio Olinto
Dear Elaine I'm developing a code to make a 3 y-axes plot. It may can help you. Also your question leads to mine, posted yesterday: How does R calculate the interval between tick-marks. Below follows the code I'm developing. Data: ANO CKG NUP NDE 200526352158

Re: [R] How to remove all objects except a few specified objects?

2010-08-25 Thread Cheng Peng
Thanks to De-Jian and Peter. Peter's way is neat and cool! -- View this message in context: http://r.789695.n4.nabble.com/How-to-remove-all-objects-except-a-few-specified-objects-tp2335651p2338221.html Sent from the R help mailing list archive at Nabble.com.

[R] Problem with clusterCall, Error in checkForRemoteErrors(lapply(cl, recvResult)) :

2010-08-25 Thread telm8
Hi all, I am trying to use snow package to do a parallel MCMC. I have read a few guides and articles, the following is that I came up with. When I run it I got the error message: Error in checkForRemoteErrors(lapply(cl, recvResult)) : 4 nodes produced errors; first error: could not find

[R] What does this warning message (from optim function) mean?

2010-08-25 Thread Sally Luo
Hi R users, I am trying to use the optim function to maximize a likelihood funciton, and I got the following warning messages. Could anyone explain to me what messege 31 means exactly? Is it a cause for concern? Since the value of convergence turns out to be zero, it means that the converging is

[R] pairwise correlation of many samples

2010-08-25 Thread Moon Eunyoung
Dear list, I have a csv file like below, and I have similar 150 files (responses from 150 samples) in a folder. I’d like to get the mean score of pairwise correlation score among 150 respondents by hour(0~20hour). All I can think of is bring up two files and get the pairwise correlation score

Re: [R] Problem with clusterCall, Error in checkForRemoteErrors(lapply(cl, recvResult)) :

2010-08-25 Thread telm8
Oh, I forgot to say, ui.Next() is a function I defined to sample from the proposal distribution given the current state. -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-clusterCall-Error-in-checkForRemoteErrors-lapply-cl-recvResult-tp2338375p2338378.html Sent from

[R] multivariate analysis of variance

2010-08-25 Thread celal arslan
Hi, can anyone tell me how i may find out the between-group variance and within-group variance for multivariate case? I have 6 Groups and 73 Variables. (with MANOVA ? wie) dim(data) [1] 2034   76 Thanks Celal __ R-help@r-project.org mailing

  1   2   >