Re: [R] solving system of equations involving non-linearities

2009-08-07 Thread Werner W.
Many thanks, BBsolve works like a charm. First I thought I should use the squares of the equations because BBsolve would use some minimization objective function anyway but it actually only works if I don't use the squared equations. I'll check the documentation if I find something about the

Re: [R] A question regarding R scoping

2009-08-07 Thread markleeds
__ 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.

Re: [R] using cat()

2009-08-07 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks, Bill bill.venab...@csiro.au wrote: fn - function(x) { j - x+1 cat(the value of j is , j, \n) j } fn(1:10) It is clear for me now the use of cat(). As Steve pointed out in his mail, I've failed at providing an example, one of the rules of thumb of this list!

Re: [R] using cat()

2009-08-07 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks, Steve, Steve Lianoglou wrote: It seems like you're asking to use cat() for something it's not meant to do. cat() is generally used to write output, either to the screen or to a file. Sorry for not adding an example to my first post! And yes, I was trying to use it for something it

Re: [R] Is there a 'vi' mode in R?

2009-08-07 Thread Hesen Peng
I've no idea about vi. But there is one called ESS(emacs speaks statistics) in Emacs. I'm very curious how VI is going to work on generating X11 output. On Thu, Aug 6, 2009 at 2:54 PM, Peng Yupengyu...@gmail.com wrote: Hi, I'm wondering if R provide a vi mode in the command line just like

Re: [R] using cat()

2009-08-07 Thread [Ricardo Rodriguez] Your XEN ICT Team
Sorry, [Ricardo Rodriguez] Your XEN ICT Team wrote: eval(parse(text=getauth('http://tinyurl.com/ne5bl3',user,pass))) I get NULL. Please, use DummyDummy as user and dummy as pass if you want to try it. Thanks. I think the proposed URL could present some more problems. Please, use this

Re: [R] Why is 0 not an integer?

2009-08-07 Thread Martin Maechler
William Dunlap wdun...@tibco.com on Thu, 6 Aug 2009 15:06:08 -0700 writes: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Giovanni Petris Sent: Thursday, August 06, 2009 3:00 PM To:

Re: [R] Completion for custom $ operator?

2009-08-07 Thread Romain Francois
On 08/04/2009 10:02 PM, Deepayan Sarkar wrote: On Tue, Aug 4, 2009 at 11:37 AM, Vitalie S.vitosm...@rambler.ru wrote: Dear UseRs, I declared a `$` method for a S4 class. Can I have ab automatic completion for this operator in R? Lists and environment objects provide this feature by default,

Re: [R] Completion for custom $ operator?

2009-08-07 Thread Deepayan Sarkar
On 8/7/09, Romain Francois romain.franc...@dbmail.com wrote: On 08/04/2009 10:02 PM, Deepayan Sarkar wrote: On Tue, Aug 4, 2009 at 11:37 AM, Vitalie S.vitosm...@rambler.ru wrote: Dear UseRs, I declared a `$` method for a S4 class. Can I have ab automatic completion for this

Re: [R] acf Significance

2009-08-07 Thread Steve Jones
Your suggestion wasn't entirely useless - I didn't know about it before, so I learned something! I've had a look in the plot.acf source and found the bit I need, so it's all good now. Thanks for the suggestions. Steve. markle...@verizon.net wrote: Hi Steve: Clearly my str suggestions was

Re: [R] Completion for custom $ operator?

2009-08-07 Thread Romain Francois
On 08/07/2009 09:38 AM, Deepayan Sarkar wrote: On 8/7/09, Romain Francoisromain.franc...@dbmail.com wrote: On 08/04/2009 10:02 PM, Deepayan Sarkar wrote: On Tue, Aug 4, 2009 at 11:37 AM, Vitalie S.vitosm...@rambler.ru wrote: Dear UseRs, I declared a `$` method for a S4 class. Can I have

Re: [R] sweave and R. Searching for a document that will get me started

2009-08-07 Thread Renaud Lancelot
Sweave was designed to embed R code within LaTeX documents. You REALLY need to learn a bit of LaTeX before using Sweave. There are many available documents on the Internet, e.g.: http://www.ctan.org/tex-archive/info/beginlatex/ http://tug.ctan.org/tex-archive/info/lshort/ 2009/8/7 John Sorkin

Re: [R] Conditional randomization of groups

2009-08-07 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Hi unknown, As a quick patch, try something like mydata$Set - 1 mydata$Set[c(sample(mydata$ID[mydata$Type==A], ifelse(runif(1)1/2,2,3)), sample(mydata$ID[mydata$Type==B], 3) )[1:5] ] - 2 HTH, Michael -Original Message- From: r-help-boun...@r-project.org

Re: [R] sweave and R. Searching for a document that will get me started

2009-08-07 Thread David Hajage
Sweave/LaTeX is the most powerfull tool to write document with embedded R code. The hard task is to learn LaTeX. But you could also have a look to packages: - R2HTML or hwriter if you prefer HTML markup, - odfWeave if you prefer write document with OpenOffice for example, - or ascii, if you

Re: [R] Durbin-Watson

2009-08-07 Thread Hardi
Thank you for all your reply, especially Alan Now I understand better how does the durbin watson test works. But this means that my residuals are not independent (note that I'm doing this test to validate the ANOVA assumption that the residuals are independent). The results were taken from a

[R] plotting huge data

2009-08-07 Thread gauravbhatti
I have a data frame with 25000 rows containing two columns Time and Distance. When I plot a simple distance versus time plot, the plot is very confusing showing no general trend because of the large data. Is there any way I can improve the plot by lets say using moving average as in EXCEL ?

Re: [R] plotting huge data

2009-08-07 Thread Jim Holtman
?supsmu ?filter Sent from my iPhone On Aug 7, 2009, at 3:28, gauravbhatti gaurav15...@hotmail.com wrote: I have a data frame with 25000 rows containing two columns Time and Distance. When I plot a simple distance versus time plot, the plot is very confusing showing no general trend

Re: [R] Durbin-Watson

2009-08-07 Thread Achim Zeileis
On Fri, 7 Aug 2009, Hardi wrote: Now I understand better how does the durbin watson test works. But this means that my residuals are not independent (note that I'm doing this test to validate the ANOVA assumption that the residuals are independent). Yes. The autocorrelation is rather low,

Re: [R] sweave and R. Searching for a document that will get me started

2009-08-07 Thread Liviu Andronic
Hello, On Fri, Aug 7, 2009 at 9:26 AM, David Hajagedhajag...@gmail.com wrote: The hard task is to learn LaTeX. You can get around learning (much of) LaTeX by using Sweave with LyX. You will find information in the r-help and lyx ML archives, and on Google. Liviu

Re: [R] plotting huge data

2009-08-07 Thread Liviu Andronic
Hello, On Fri, Aug 7, 2009 at 8:28 AM, gauravbhattigaurav15...@hotmail.com wrote: I have a data frame with 25000 rows containing two columns Time and Distance. When I plot a simple distance versus time plot, the plot is very confusing showing no general trend because of the large data. Is

[R] eval parent.frame() twice

2009-08-07 Thread Rune Schjellerup Philosof
Hi I want to use a function (update) that in its body uses eval(call, parent.frame()) I would like to use this function in a function that does not contain the variables referred to in 'call'. Those variables are instead in the parent.frame() of my function (named 'second' below) Like this: a -

[R] Fitting Truncated Distribution

2009-08-07 Thread Lorenzo Isella
Dear All, I know that this topic has been already discussed on this list (see e.g. http://markmail.org/message/bq2bdxwblwl4rpgf?q=r+fit+truncated+lognormalpage=1refer=2ufc4fb2eftfwwml#query:r%20fit%20truncated%20lognormal+page:1+mid:7wxgkdxhixotorr5+state:results for the case of weibull

[R] xtable, sweave and resizebox

2009-08-07 Thread Welma Pereira
does anyone know to rezize a table produzed by xtable? The size of my table is too big and I would like to resize it like using resizebox but it gives an erros when I try using it using it its fine \SweaveOpts{echo=false} results=tex= xtable(stats0,caption='Número de transacções dos artigos

Re: [R] adding color bar to a graph

2009-08-07 Thread Jim Lemon
Monica Pisica wrote: Hi everybody, I am wondering how i can add a stretch color bar / legend to a graph that uses colorBrewer to define the colors in it. I will try to explain my graph, but i also uploaded it at: ftp://ftpext.usgs.gov/pub/er/fl/st.petersburg/Monica_pal/ The file is:

Re: [R] eval parent.frame() twice

2009-08-07 Thread Peter Dalgaard
Rune Schjellerup Philosof wrote: Hi I want to use a function (update) that in its body uses eval(call, parent.frame()) I would like to use this function in a function that does not contain the variables referred to in 'call'. Those variables are instead in the parent.frame() of my

Re: [R] Ylim

2009-08-07 Thread Jim Lemon
Mohsen Jafarikia wrote: Hello All: Can anybody tell me what is the problem with my program please. I have an error message as appears below. My program is: ifn - Jul08_09.LM data - read.table(ifn) ofn - Jul.png bitmap(ofn, type = png256, width = 30, height = 30, pointsize = 30, bg =

Re: [R] eval parent.frame() twice

2009-08-07 Thread Rune Schjellerup Philosof
Peter Dalgaard skrev: Rune Schjellerup Philosof wrote: Hi I want to use a function (update) that in its body uses eval(call, parent.frame()) I would like to use this function in a function that does not contain the variables referred to in 'call'. Those variables are instead in the

Re: [R] plotting huge data

2009-08-07 Thread Frank E Harrell Jr
gauravbhatti wrote: I have a data frame with 25000 rows containing two columns Time and Distance. When I plot a simple distance versus time plot, the plot is very confusing showing no general trend because of the large data. Is there any way I can improve the plot by lets say using moving

Re: [R] adding color bar to a graph

2009-08-07 Thread Monica Pisica
Hi Jim, Thanks for your answer. It does it but not quite as i would like it ;-) I need the colors to be blended as the colorRampPalette does it going from one color to the next in the list. Your legend will have 5 discreet colors and accept a vector of colors as the image.plot command does.

Re: [R] eval parent.frame() twice

2009-08-07 Thread Duncan Murdoch
On 8/7/2009 7:36 AM, Rune Schjellerup Philosof wrote: Peter Dalgaard skrev: Rune Schjellerup Philosof wrote: Hi I want to use a function (update) that in its body uses eval(call, parent.frame()) I would like to use this function in a function that does not contain the variables referred

Re: [R] solving system of equations involving non-linearities

2009-08-07 Thread Ravi Varadhan
If you suspect multiple roots, you can try `multiStart' in BB, which runs `BBsolve' from multiple starting values (which you have to specify). If you want to convert it to an optimization problem, you can form the sum of squared residuals of the equations and then use `BBoptim'. However, I would

[R] Gauss-Laguerre using statmod

2009-08-07 Thread Doran, Harold
I believe this may be more related to analysis than it is to R, per se. Suppose I have the following function that I wish to integrate: ff - function(x) pnorm((x - m)/sigma) * dnorm(x, observed, sigma) Then, given the parameters: mu - 300 sigma - 50 m - 250 target - 200 sigma_i - 50 I can use

[R] install package version compatible with on older version of R

2009-08-07 Thread Renaud Gaujoux
Hi, I'm trying to install Chipster (for microarray analysis: http://chipster.csc.fi/), which expressly relies on R 2.6.1 (for now). So I'd like to install automatically (i.e. using a 'install.packages' like function) the last version of a package compatible with the running R version. For

Re: [R] plotting huge data

2009-08-07 Thread Martin Maechler
FEH == Frank E Harrell f.harr...@vanderbilt.edu on Fri, 07 Aug 2009 07:19:16 -0500 writes: FEH gauravbhatti wrote: I have a data frame with 25000 rows containing two columns Time and Distance. That's large by some standards, but definitely not huge ... When I plot a simple

[R] How do I plot a line followed by two forecast points?

2009-08-07 Thread Jorgy Porgee
Good day all, I'm trying to plot a continuous line plot, which is followed by two forecast points eg. one forecast point is 12 months out, and another 24 months out from the last date of the line plot. In my attempts so far, the second plot (the forecast points) is scaled against a new axis

Re: [R] Is there a 'vi' mode in R?

2009-08-07 Thread Peng Yu
On Fri, Aug 7, 2009 at 5:04 AM, Jakson Alves de Aquinojaksonaqu...@gmail.com wrote: Peng Yu wrote: I'm wondering if R provide a vi mode in the command line just like other shells such as bash do. Can somebody let me know? I maintain a Vim plugin that makes the interaction with R easier:  

Re: [R] Repeatable, But Time Varying R GUI Crash

2009-08-07 Thread Ben Madin
G'day all, running the script in : [R.app GUI 1.28 (5399) i386-apple-darwin9.6.0] R version 2.9.0 (2009-04-17) i386-apple-darwin9.6.0 locale: en_AU.UTF-8/en_AU.UTF-8/C/C/en_AU.UTF-8/en_AU.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base

Re: [R] Proper / Improper scoring Rules

2009-08-07 Thread Donald Catanzaro, PhD
Hi All, I am working on some ordinal logistic regresssions using LRM in the Design package. My response variable has three categories (1,2,3) and after using the creating my model and using a call to predict some values and I wanted to use a simple .5 cut-off to classify my probabilities

[R] Problem with area()

2009-08-07 Thread Agustin Lobo
I'm using area() to evaluate the area under 2 functions (defined using approxfun()) and the result is in contradiction with visual inspection (please see: http://sites.google.com/site/eospansite/dummy/problem_area.jpg ) The area under the red curve should be larger than the one under the black

Re: [R] problem with recording numeric output into another dataframe

2009-08-07 Thread Rnewbie
Thank you very much for the reply. The thing I want to achieve in the end is to use dataframe1 as a master dataframe, and get values from multiple dataframes to dataframe1, so that I can analyze the data altogether, like this: IDvalue1 value2 value3 a 100 123 456

[R] bug with subset and plot?

2009-08-07 Thread Knut Helge Jensen
Hi! I have the following problem that I beleive is a bug: I have a dataframe with one categorical and one numerical vector. The categorical vector has three levels (uc, up and vc). A plot of the vectors with the categorical vector on the x-axis gives a boxplot with three boxes - exactly as

[R] cannot upgrade to R 2.9.1 in Ubuntu

2009-08-07 Thread Luis Ridao Cruz
R-help, At the moment the R version installed on my machine is 2.8.1. (Ubuntu 9.04) I wish to upgrade to R 2.9.1. I did: $ sudo apt-get upgrade ..but R is not upgraded although the sources.list file is updated with: deb http://cran.ii.uib.no/bin/linux/ubuntu jaunty/ When I run from the

Re: [R] Help ::Not able to Connect R to SQL Server 2000

2009-08-07 Thread bed.si...@oracle.com
Hi Simon, Now I am able to connect my SQL Server2000 from R using RODBC as you told me in the last line of your mail. Thanks a lot to you Simon for helping. Now I feel better than before. J Cheers!! BS -Original Message- From: Simon Urbanek

Re: [R] A question regarding R scoping

2009-08-07 Thread Ivo Shterev
Dear All, Sorry for the introduced confusion. My question is to have a function (in my case f1) that just takes an argument and modifies it (no copies, no returns). This can be done by: f1 = function(i){i - 1} Then this function is called by another function (in my case f2) that just

Re: [R] bug with subset and plot?

2009-08-07 Thread Erik Iverson
http://stackoverflow.com/questions/1195826/dropping-factor-levels-in-a-subsetted-data-frame-in-r -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Knut Helge Jensen Sent: Friday, August 07, 2009 5:02 AM To: r-h...@stat.math.ethz.ch

[R] error installing bioconductor

2009-08-07 Thread foxhunt99
Hi, I am new to R. I am downloaded the installer for R 2.9.1, and that installed just fine. Then I want to install Biocondcutor packages. According to bioconductor website, I input the following commands. source(http://bioconductor.org/biocLite.R;) bioLite() Error: could not find function

[R] lattice dotplot: line height for multi-line labels

2009-08-07 Thread Boris.Vasiliev
Dear R-users, I am looking for suggestions on how to control the line-height for multi-line labels in lattice dotplot. In particular, in the dotplot produced by library(lattice) aa - c('A'=10,'B\nb'=20,'C'=30) dotplot(aa) I would like to control the vertical separation between 'B' and 'b' in

Re: [R] Proper / Improper scoring Rules

2009-08-07 Thread Frank E Harrell Jr
Donald Catanzaro, PhD wrote: Hi All, I am working on some ordinal logistic regresssions using LRM in the Design package. My response variable has three categories (1,2,3) and after using the creating my model and using a call to predict some values and I wanted to use a simple .5 cut-off to

Re: [R] Repeatable, But Time Varying R GUI Crash

2009-08-07 Thread Duncan Murdoch
The bug is now fixed in R-patched and R-devel. Duncan Murdoch On 8/7/2009 11:38 AM, Ben Madin wrote: G'day all, running the script in : [R.app GUI 1.28 (5399) i386-apple-darwin9.6.0] R version 2.9.0 (2009-04-17) i386-apple-darwin9.6.0 locale:

Re: [R] error installing bioconductor

2009-08-07 Thread David Winsemius
On Aug 7, 2009, at 10:51 AM, foxhunt99 wrote: Hi, I am new to R. I am downloaded the installer for R 2.9.1, and that installed just fine. Then I want to install Biocondcutor packages. According to bioconductor website, I input the following commands.

Re: [R] error installing bioconductor

2009-08-07 Thread Erik Iverson
First, there is a separate Bioconductor list for future Bioc questions.. Second, you're typing the wrong function name. biocLite(), not bioLite() -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of foxhunt99 Sent: Friday, August

Re: [R] lattice dotplot: line height for multi-line labels

2009-08-07 Thread Deepayan Sarkar
On 8/7/09, boris.vasil...@forces.gc.ca boris.vasil...@forces.gc.ca wrote: Dear R-users, I am looking for suggestions on how to control the line-height for multi-line labels in lattice dotplot. In particular, in the dotplot produced by library(lattice) aa - c('A'=10,'B\nb'=20,'C'=30)

Re: [R] A question regarding R scoping

2009-08-07 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ivo Shterev Sent: Friday, August 07, 2009 9:36 AM To: murd...@stats.uwo.ca; markle...@verizon.net Cc: r-help@r-project.org Subject: Re: [R] A question regarding R scoping

Re: [R] bug with subset and plot?

2009-08-07 Thread Ista Zahn
See http://wiki.r-project.org/rwiki/doku.php?id=tips:data-manip:drop_unused_levels -Ista Hi! I have the following problem that I beleive is a bug: I have a dataframe with one categorical and one numerical vector. The categorical vector has three levels (uc, up and vc). A plot of the

Re: [R] bug with subset and plot?

2009-08-07 Thread milton ruser
hi knut may be: treatment-factor(treatment) plot(...) cheers milton On Fri, Aug 7, 2009 at 6:02 AM, Knut Helge Jensen knut.jen...@bio.uib.nowrote: Hi! I have the following problem that I beleive is a bug: I have a dataframe with one categorical and one numerical vector. The categorical

Re: [R] Time Series smoothing

2009-08-07 Thread Giovanni Petris
My guess is that your data, 'x', has frequency 1, or is not a ts object altogether. In both cases there is no meaningful way of extracting a sesonal component from the data. However, as you can see in the help page, HoltWinters has an argument 'gamma' that, when given the value 0, allows to fit

Re: [R] R book for economists

2009-08-07 Thread Trevor Davis
There is also Grant Farnsworth's Econometrics in R in the contributed documentation section of the R website: http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf Best, Trevor Thiemo Fetzer wrote: Dear Group, I am an economics student starting with PhD work in London. As

Re: [R] Is there a 'vi' mode in R?

2009-08-07 Thread Trevor Davis
If you are using R in a *nix machine then R is usually compiled with support for gnu-readline which does have a vi mode. You need a file called .inputrc in your home directory containing the following line: set editing-mode vi in order to activate it. It works exactly like the vi

Re: [R] Is there a 'vi' mode in R?

2009-08-07 Thread Deepayan Sarkar
On 8/6/09, Peng Yu pengyu...@gmail.com wrote: Hi, I'm wondering if R provide a vi mode in the command line just like other shells such as bash do. Can somebody let me know? I've never used vi-mode, but vi mode in bash (at least) is provided by the readline library, and R uses the same

[R] RE xtable, sweave and resizebox

2009-08-07 Thread Teysseyre
Hello In doc of xtable.pdf at page 7 : .../... ## Demonstration of longtable support. ## Remember to insert \usepackage{longtable} on your LaTeX preamble x - matrix(rnorm(1000), ncol = 10) x.big - xtable(x,label='tabbig',caption='Example of longtable spanning several pages')

Re: [R] Gauss-Laguerre using statmod

2009-08-07 Thread Ravi Varadhan
Harold, I don't think there is any error in your code. The problem is with using Gauss-Laguerre quadrature for this integrand. I changed your function `ff' slightly so that it admits a closed-form integral (I took the means and sigmas to be the same): ff2 - function(x) pnorm(x, mu, sigma) *

Re: [R] A question regarding R scoping

2009-08-07 Thread Ivo Shterev
Hi Mark, I think your suggestion to call rm(i) before or after calling f1 so that the local variable is removed, is the most straighforward solution to my problem. I was trying to implement some efficient C-style techniques in R, but the scoping principle in R is quite different than C.

[R] lattice: simultaneously control aspect outer whitespace

2009-08-07 Thread Jacob Wegelin
Suppose we wish to achieve the following three aims: (1) Control the aspect ratio of our plot (i.e., tweak this till it looks great) (2) Save the plot as a PDF with zero or minimal white space outside it. (3) Preserve this in code, so that in the future the exact same plot can be reproduced by

Re: [R] A question regarding R scoping

2009-08-07 Thread markleeds
__ 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] ggplot2-ddply question

2009-08-07 Thread Felipe Carrillo
Hi all: I am trying to use the ddply function to estimate the mean of 'Total','Fry','Smolt' and 'Fry.Eq' columns without success. I have the dput of my dataset below. I wonder if someone can give me a hand with this function. # dput(winter) winter -structure(list(IDDate = structure(c(37L, 48L,

Re: [R] ggplot2-ddply question

2009-08-07 Thread David Winsemius
On Aug 7, 2009, at 3:36 PM, Felipe Carrillo wrote: Hi all: I am trying to use the ddply function to estimate the mean of 'Total','Fry','Smolt' and 'Fry.Eq' columns without success. I have the dput of my dataset below. I wonder if someone can give me a hand with this function. #

Re: [R] How do I plot a line followed by two forecast points?

2009-08-07 Thread Jorgy Porgee
Hi Jean, Thank you for the reply. I do have the forecast points before I plot, the example below was just for illustration purposes..If I am to add the forecast points to one y-series data plot however, is there a way of highlighting them? This is essentially what I'm trying to do below by

Re: [R] How do I plot a line followed by two forecast points?

2009-08-07 Thread Clint Bowman
Because you know a priori the dates associated with your forecast points you could use the col= in the plot function to change colors for the last two points (may require some mathmatical gymnastics to specify the colors desired--I've set up a vector and created an index from either the x or y

Re: [R] ggplot2-ddply question

2009-08-07 Thread Felipe Carrillo
On Aug 7, 2009, at 3:36 PM, Felipe Carrillo wrote: Hi all: I am trying to use the ddply function to estimate the mean of 'Total','Fry','Smolt' and 'Fry.Eq' columns without success. I have the dput of my dataset below. I wonder if someone can give me a hand with this function. #

[R] Seeing negative numbers to zero

2009-08-07 Thread DebbieMB
Hi, I am also new to R and I have a related question. I am trying to set negative values in a single column of a dataframe to zero and I can't seem to do it. I have tried: KN1-subset(KN,select=c(5)) # Here I am selecting the column of the dataframe KN1 and assigning it the name KN2 - this

Re: [R] How do I plot a line followed by two forecast points?

2009-08-07 Thread Jean V Adams
Just wait until after you have the forecasts before you create the plot. # Sample dates xValues - seq.Date(as.Date(1990-01-31), to=as.Date(1992-12-31), by=month) # Sample y value yValues - seq(0.1, length=length(xValues)) # Sample forecast one year from xValue's end point fcastDate -

[R] RMySQL - overwrite record, not table

2009-08-07 Thread whizvast
Hi, useR- In RMySQL, how do I overwrite records? (equivalent to replace query). For example, suppose that dat2 is a newer data.frame than dat1. con - dbConnect(MySQL()) res - dbWriteTable(con, DBname, dat1, row.names=F, append=T, replace=T) res - dbWriteTable(con, DBname, dat2, row.names=F,

Re: [R] Bar plots with stacked columns marked with askterisks

2009-08-07 Thread dorothyc
Hi, I'm trying to plot bar graphs with stacked columns marked with askterisks for certain columns, which follow certain criteria. I've gotten the stacked bar plots with Data set A (please refer to code below). However, I haven't figured how to put asterisks on columns based on some extra

[R] how to partitioning a clustered heatmap

2009-08-07 Thread Fededa Juan Pablo
Hello all, I'm doing heatmap.2 graphics of matrix x with hclust clustering in the rows, as an argument in heatmap.2 . The problem is that the heatmap contains 1000 genes, and I want to cut it in several pieces, but after the clustering. If I use x[1:100,] as delimiting argument for the first

Re: [R] How do I plot a line followed by two forecast points?

2009-08-07 Thread whizvast
Run this codes: plot( 1:20, type='l') lines( 0.5*1:20, col=2) If you use par(new=T), this will call a new high-level graphic device, which is why the axes do not match. Alternatively, you can set ylim and pass the arguments to two plot functions: plot( rnorm(100), type='h', ylim=c(-3,3))

[R] create separate plots by factors

2009-08-07 Thread Ingrid Tohver
Hello, I am attempting to create several plots based on site (~300 total) and am having trouble with the code. I simply want to create a plot using the code, plot(year, peak), for the following dataset. I would like for each site to be plotted on a separate page and the plots saved in a

Re: [R] Seeing negative numbers to zero

2009-08-07 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of DebbieMB Sent: Friday, August 07, 2009 1:29 PM To: r-help@r-project.org Subject: [R] Seeing negative numbers to zero Hi, I am also new to R and I have a related question.

Re: [R] Seeing negative numbers to zero

2009-08-07 Thread Ted Harding
On 07-Aug-09 20:29:16, DebbieMB wrote: Hi, I am also new to R and I have a related question. I am trying to set negative values in a single column of a dataframe to zero and I can't seem to do it. I have tried: KN1-subset(KN,select=c(5)) # Here I am selecting the column of the dataframe

Re: [R] Seeing negative numbers to zero

2009-08-07 Thread Daniel Nordlund
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Daniel Nordlund Sent: Friday, August 07, 2009 2:50 PM To: r-help@r-project.org Subject: Re: [R] Seeing negative numbers to zero -Original Message- From:

Re: [R] Seeing negative numbers to zero

2009-08-07 Thread David Winsemius
On Aug 7, 2009, at 4:29 PM, DebbieMB wrote: Hi, I am also new to R and I have a related question. I am trying to set negative values in a single column of a dataframe to zero and I can't seem to do it. I have tried: KN1-subset(KN,select=c(5)) # Here I am selecting the column of the

[R] Simple Question: adding points to a boxplot

2009-08-07 Thread Farley, Robert
I apologize in advance for the simplicity of this question. I use R 2-3 times a year, and I seem to forget more in the intervening months than I learn during my days of panicked reading I HAVE tried looking at the help resources; I'm just not very good at understanding them. I have a

Re: [R] multiple lty on same panel in xyplot

2009-08-07 Thread Duncan Mackay
Hi RUsers I like to keep the plots self contained and avoid changing the current device parameters by using the par.settings. To see what I could achieve by using par settings I tried the following and several variants but could not get black points. xyplot(yM + yF ~ x, panel =

Re: [R] Simple Question: adding points to a boxplot

2009-08-07 Thread David Winsemius
On Aug 7, 2009, at 6:43 PM, Farley, Robert wrote: I apologize in advance for the simplicity of this question. I use R 2-3 times a year, and I seem to forget more in the intervening months than I learn during my days of panicked reading I HAVE tried looking at the help resources; I'm

[R] how to limit output to console beyond options(max.print) ?

2009-08-07 Thread Michael Lachmann
I have code that generates a structure that includes in it 30 data frames of size 57*1004. It isn't so important why I needed shape of data frame, maybe I didn't I have options(max.print) set to a low number but it seems that this does not have much effect - printing my structure still takes

[R] generalized linear models

2009-08-07 Thread annie Zhang
Hi, R users, I am trying to use glm to do logistic regression. I know generally when I have two covariates, say x1 and x2, then I do fit - glm(y~x1+x2,famliy='binomial') But now my covariates form a n*p matrix, say x, so actually each column is a covariate. So I think I should do fit -

Re: [R] Simple Question: adding points to a boxplot

2009-08-07 Thread Farley, Robert
Sorry to keep bothering you all. Phil's easy fix got my code working and I have my graphic. Just for my education: Is there a SIMPLE way to verify/ensure that the ordering of the data is the same in both dataframes? Is this done within the plotting routines, or is it usually as a data

Re: [R] Is there a 'vi' mode in R?

2009-08-07 Thread Peng Yu
On Fri, Aug 7, 2009 at 5:04 AM, Jakson Alves de Aquinojaksonaqu...@gmail.com wrote: Peng Yu wrote: I'm wondering if R provide a vi mode in the command line just like other shells such as bash do. Can somebody let me know? I maintain a Vim plugin that makes the interaction with R easier:  

[R] frequency of numbers in a list

2009-08-07 Thread Julius Tesoro
Hi, I have two vectors, mag and i, and I want to generate a of vector where each element is the frequency of mag which is greater than i. i produced the following code. However I get the following error: mag-rnorm(40,5,3) i-seq(floor(min(mag)),max(mag), 0.5) freq-sum(mag=i) Warning message:

Re: [R] Simple Question: adding points to a boxplot

2009-08-07 Thread David Winsemius
On Aug 7, 2009, at 8:33 PM, Farley, Robert wrote: Sorry to keep bothering you all. Phil's easy fix got my code working and I have my graphic. Just for my education: Is there a SIMPLE way to verify/ensure that the ordering of the data is the same in both dataframes? Is this done within

Re: [R] generalized linear models

2009-08-07 Thread milton ruser
Hi Annie, create a new data.frame with input variables having all predictors variables on it. after give a look at ?predict best wishes milton On Fri, Aug 7, 2009 at 8:19 PM, annie Zhang annie.zhang2...@gmail.comwrote: Hi, R users, I am trying to use glm to do logistic regression. I know

[R] interesting statistics article in NYT

2009-08-07 Thread markleeds
__ 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] interesting statistics article in NYT

2009-08-07 Thread Jorge Ivan Velez
Dear all, I noticed something wrong my Mark's email so I am sending the link to the article he mentioned: http://www.nytimes.com/2009/08/06/technology/06stats.html?_r=1ref=technology Best, Jorge On 8/7/09, Mark Leeds wrote: __