Re: [R] Odp: how to generate data set with different length and calculate the mean?

2010-02-01 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.02.2010 16:15:20: > > Petr, > Thanks for your suggestions. It makes sense, since I don't know how to make > a matrix with different length of rows. You can't. Matrix is a vector with dimensions so it can be only rectangular and it can consist of

Re: [R] Changing direction of an axis in cloud or wireframe plot

2010-02-01 Thread Peter Ehlers
Ben Dean wrote: Is there a way to change the direction in which an axis is plotted in cloud/wireframe? For example, for the following code: g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <- log((g$x^g$g + g$y^2) * g$gr) wireframe(z ~ x * y, data = g, groups = gr, scales = list(a

Re: [R] numerical subscripts in a loop in a plot

2010-02-01 Thread Alexander Nervedi
Thanks David and Eik. They both work really well! > CC: r-help@r-project.org > From: dwinsem...@comcast.net > To: alexne...@hotmail.com > Subject: Re: [R] numerical subscripts in a loop in a plot > Date: Mon, 1 Feb 2010 12:59:19 -0500 > > > On Feb 1, 2010, at 12:40 PM, Alexander Nervedi wrote:

[R] character variables in substitute()

2010-02-01 Thread dkStevens
In trying to create a plotmath expression for plot labeling, such as R = 6, beta = 15 where I want beta to be the Greek beta and, possibly, R in italics (like one would get in an explicit expression. The reason for this is that I want to write a string builder function that takes vectors of var

Re: [R] ggplot/time series with indicators question

2010-02-01 Thread Dennis Murphy
Hi: On Mon, Feb 1, 2010 at 8:05 PM, Chuck White wrote: > Thanks Dennis. That is *exactly* what I am looking for. > > Two questions: > 1. how can I get the markers to be filled? I see that geom_point has a > property called fill which is the name of a color. Is there a way to get the > color name

[R] using rbind in a for loop

2010-02-01 Thread Eunjung Kim
*Dear R users, *I'm facing a trivial problem but I cannot solve it. My question is: I want to make data set like this. > i_lon1 i_lat1 i_lon2 i_lat2 i_lon3 i_lat3 i_lon4 i_lat4 > i+1_lon1 i+1_lat1 i+1_lon2 i+1_lat2 i+1_lon3 i+1_lat3 i+1_lon4 i+1_lat4 > i+2_lon1 i+2_lat1 i+2_lon2 i+2_lat2 i+2_lon3 i

[R] Autocorrelated error prediction correction

2010-02-01 Thread Ryan Whidden
I have done a hearty search and so far and I have not been able to find the answer to my question. For a model with auto-correlated errors, when you run GLS or ARIMA and fit() or predict(), you get the unconditional fitted values, as opposed to the conditional or dynamic values. Or in other words,

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread trece por ciento
David, In this link there is an excel file with the data dictionary ftp://www.ine.es/temas/epa/disereg_epa0509.zip If I understand the second part of the answer: do you mean to process the files, for example with MS Access, and then importing the result? (any examples?) Regards, Hug --- On Mon, 2

Re: [R] ggplot/time series with indicators question

2010-02-01 Thread Chuck White
Thanks Dennis. That is *exactly* what I am looking for. Two questions: 1. how can I get the markers to be filled? I see that geom_point has a property called fill which is the name of a color. Is there a way to get the color names from p? I tried to set fill to TRUE hoping it would infer from bo

[R] Is Least Squares the Best Approach?

2010-02-01 Thread Jason Rupert
Assuming I have two data sets that are two dimensional that should from similar functions, is Least Squares or a related approach the best way to compare these 2-D data sets? I guess I would like to know how related the two data sets are and if they are from the same function or close to being

[R] lme4 package and gamma family

2010-02-01 Thread cristina
Hello, I am trying to use the lmer function from the lme4 package I have installed today (lme4_0.999375-32.zip; R-2.10.1). According to the information, I should be able to use a generalized linear mixed model. However when I try to fit a model with Gamma distribution of the errors, it gives me

Re: [R] ggplot/time series with indicators question

2010-02-01 Thread Dennis Murphy
Hi: Try this: Your ind.df didn't include the values, so I redefined it such that it contained all of the data in data.all plus the indicators you set up in ind.df. ind.df <- cbind(data.all[,1:3],ind.df) # Using this ind.df as the data frame, set up the indicators so that all you # need to do is

Re: [R] Solving an optimization problem: selecting an &quot;optimal&quot; subset

2010-02-01 Thread Erwin Kalvelagen
Hans W Borchers googlemail.com> writes: > # Prepare inputs for MILP solver > obj <- c(rep(0, n), 0, 1, 1, 0) > typ <- c(rep("B", n), "B", "C", "C", "B") > mat <- matrix(c(s, -z, -1, 1, 0,# a = a_p + a_m > rep(0, n), 1, 0, 0, 0, # constant term >

[R] ggplot/time series with indicators question

2010-02-01 Thread Chuck White
Hello, I am trying to plot time-series data with certain weeks highlighted using symbols. require(ggplot2) #plotting time series data timescale <- seq(as.Date("01/01/09","%m/%d/%y"), length.out=12, by=7) data.all <- data.frame( id = c(rep('111',12),rep('222',12),rep('333',12)), week=c(ti

Re: [R] barplot y axis too short

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 7:48 PM, David Winsemius wrote: On Feb 1, 2010, at 7:11 PM, Jack Siegrist wrote: Hello, The function barplot automatically creates a y-axis that doesn't necessarily cover the range of y-values to be plotted. I know how to manually create my own y-axis so that it does

[R] Plot questions: grid line do not correspond to tick marks and 2 line axis label

2010-02-01 Thread Tam Le
Hello list, Thank you very much for replying to my earlier questions. I have a few new questions about R plots: Example: tempdata: RDate Price 2009-12-09 12:00 100 2009-12-09 15:00 99 2009-12-09 18:00 102 2009-12-10 8:00 120 2009-12-10 10:00 110 2009-12-10 16:00 105 My code: (RDate already

[R] Recommendations on nonparametric statistical inference textbooks

2010-02-01 Thread Peng Yu
Could somebody recommend some good nonparametric statistical inference textbooks for a beginner? And what are pros and cons of each book? Nonparametric statistical methods by Hollander seems to be more difficult for a beginner, but is great as a reference, right? Are there any books that are easie

[R] Seattle Area R User group

2010-02-01 Thread Stednick, Zach
A Seattle R User group has recently been started and will likely meet monthly rotating between Seattle and the Eastside. The next meeting will be on Feb. 17 on the Eastside and will cover package development. For more info and to RSVP, check out the meetup site at http://www.meetup.com/Seattl

[R] any R course this month in San Francisco?

2010-02-01 Thread eugene dalt
Hi folks, I will be on vacation with my parents in San Francisco the last 2 weeks of February and wondering if there are upcoming short R courses in San Francisco during that time so I could attend. Please send me the links - Thank you - Eugene __

Re: [R] barplot y axis too short

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 7:11 PM, Jack Siegrist wrote: Hello, The function barplot automatically creates a y-axis that doesn't necessarily cover the range of y-values to be plotted. I know how to manually create my own y-axis so that it does cover the range, but I was wondering if there is so

[R] Changing direction of an axis in cloud or wireframe plot

2010-02-01 Thread Ben Dean
Is there a way to change the direction in which an axis is plotted in cloud/wireframe? For example, for the following code: g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <- log((g$x^g$g + g$y^2) * g$gr) wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows = FALSE),

[R] Revolutions blog: January Roundup

2010-02-01 Thread David M Smith
I write about R every weekday at the Revolutions blog: http://blog.revolution-computing.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. http://bit.ly/a4iVi5 linked to slides and video from a 30-minute "Introduction to R" talk

[R] barplot y axis too short

2010-02-01 Thread Jack Siegrist
Hello, The function barplot automatically creates a y-axis that doesn't necessarily cover the range of y-values to be plotted. I know how to manually create my own y-axis so that it does cover the range, but I was wondering if there is some parameter to change so that the scale of the y-axis is a

Re: [R] playwith error message

2010-02-01 Thread Liviu Andronic
On 2/1/10, Sigbert Klinke wrote: > efaApp <- function(data, ...) > { > playwith (myplot(data[,8:9]), > click.mode = "Brush", > ) > } > This does work if you use plot() directly: efaApp <- function(data, ...) { playwith (plot(data[,1:2]), click.mode = "B

Re: [R] lmer, mcmcsamp, coda, HPDinterval

2010-02-01 Thread Doug Adams
Ah, that did it. Thank you! - Doug Adams MStat Student University of Utah -- View this message in context: http://n4.nabble.com/lmer-mcmcsamp-coda-HPDinterval-tp1457803p1459380.html Sent from the R help mailing list archive at Nabble.com. __ R-h

Re: [R] iterative regressions, adding a new line of data each time

2010-02-01 Thread D Kelly O'Day
I used rpanel() to do an interactive regression of a time series. My use was not as involved as yours, but it might give you an idea of how to approach. Here's a http://chartsgraphs.wordpress.com/2009/05/08/rpanel-package-adds-interactive-capabilites-to-r/ link to my blog post. -- View this m

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread Jim Holtman
you probably need to split your file into several files according to the format. you can use something like perl or do it within R by doing readline and then separating the lines. you can use grep, split and textConnection to do most of the work. What is the problem you are trying to solve?

Re: [R] merging data frames gives all NAs

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 5:16 PM, James Rome wrote: Dear kind R helpers, I have a vector of runway names in rwy ("31R", "31L",... the number is user selectable) arrgnd is a data frame with data for all flights and all runways, with a Runway column. I am trying to subset arrgnd into a dat frame

[R] merging data frames gives all NAs

2010-02-01 Thread James Rome
Dear kind R helpers, I have a vector of runway names in rwy ("31R", "31L",... the number is user selectable) arrgnd is a data frame with data for all flights and all runways, with a Runway column. I am trying to subset arrgnd into a dat frame for each selected runway, and then combine them b

Re: [R] Weighted SD

2010-02-01 Thread Peter Dalgaard
Thomas Lumley wrote: On Mon, 1 Feb 2010, David Winsemius wrote: On Feb 1, 2010, at 12:37 PM, Антон Морковин wrote: Dear all, what function can be used to calculate weighted SD or/and SE¿ There's no such stuff in 'base' package. Seems as though lm with a weights argument could be used fair

Re: [R] Fwd: Re: Graph color

2010-02-01 Thread Jose Narillos de Santos
Hi Greg, Many thanks¡¡¡ For the moment, as Jim suggested thigmophobe.labels in the plotrix package worked properly¡¡¡ Many thanks¡¡¡ 2010/2/1 Greg Snow > What you are asking (making labels of points not overlap the points) is > either very simple or very complicated, depending on your data

Re: [R] Comparing Variables and Writing a New Column

2010-02-01 Thread Jerry Floren
Hi David ( and Erik via e-mail), I think David's code is working. While using it I discovered there was an error in some previous code of mine that generated my df.soil table. After running David's code, nearly all lab results were flagged as **H. Then I looked at the df.soil table and found that

Re: [R] Weighted SD

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 3:32 PM, Thomas Lumley wrote: On Mon, 1 Feb 2010, David Winsemius wrote: On Feb 1, 2010, at 12:37 PM, Антон Морковин wrote: Dear all, what function can be used to calculate weighted SD or/and SE¿ There's no such stuff in 'base' package. Seems as though lm with a weigh

Re: [R] Missing names in LMER and GLM

2010-02-01 Thread Greg Snow
If your factor is something like classes then do > levels(classes) And whichever level is first is the default baseline. To change the base line you want to change the factor. You can do this using the factor function or the relevel or reorder functions (just be sure to save the result, they

Re: [R] iterative regressions, adding a new line of data each time

2010-02-01 Thread ace834
Thank you all for the help, and as a side note I'm not a student, so this isn't a homework assignement, I'm just new to R. -- View this message in context: http://n4.nabble.com/iterative-regressions-adding-a-new-line-of-data-each-time-tp1457725p1459260.html Sent from the R help mailing list arc

Re: [R] Weighted SD

2010-02-01 Thread Thomas Lumley
On Mon, 1 Feb 2010, David Winsemius wrote: On Feb 1, 2010, at 12:37 PM, Антон Морковин wrote: Dear all, what function can be used to calculate weighted SD or/and SE¿ There's no such stuff in 'base' package. Seems as though lm with a weights argument could be used fairly simply. As I hav

Re: [R] Missing names in LMER and GLM

2010-02-01 Thread vickih
I'm sure this is an equally obvious question, but how would you change that baseline? Suppose I need MN to be the baseline instead of MNX. I just can't work out why MNX is chosen as it. Thanks again -- View this message in context: http://n4.nabble.com/Missing-names-in-LMER-and-GLM-tp1459176p14

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 2:33 PM, trece por ciento wrote: Thanks David, but can read.fwf cope with different record types? For example, if recordtype is the 4th character, I could have: 011125678 ---> This is record Type 1 011136779 ---> This is record Type 1 011124943 ---> This is record Type 1 011

Re: [R] Missing names in LMER and GLM

2010-02-01 Thread vickih
Oh ok, that makes more sense now. Thank you very much! -- View this message in context: http://n4.nabble.com/Missing-names-in-LMER-and-GLM-tp1459176p1459247.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] iterative regressions, adding a new line of data each time

2010-02-01 Thread Greg Snow
Possibly something like: lapply( 100:200, function(i) { fit <- lm( y ~ x, data=mydata, subset=seq(length.out=i) ) ... do something with fit to return the desired prediction(s) ... } ) You can stop standing now :-) The process might be a little more efficient (or it might not be)

Re: [R] Missing names in LMER and GLM

2010-02-01 Thread Greg Snow
The default way that R deals with categorical variables is to choose one level as the baseline and measure everything else as differences from the baseline. Based on the information that you gave us, the reasonable explanation is that MNX is used as the baseline and is represented in the interc

Re: [R] Query on p-value

2010-02-01 Thread Greg Snow
We cannot answer the question of "what is a p-value?" in a way that would do justice to the concept (and not do more harm than good in the long run) in the amount of time/space that is reasonable for a mailing list. If you truly do not know what a p-value is, then you need to take an introducto

Re: [R] Constrained vector permutation

2010-02-01 Thread Andrew Rominger
Chuck, Thanks for the reference. MCMC with "swapping" was my original goal and I think I'll go with that in the long run--although using sample() has worked out for now. I was initially concerned that checking all choose(n,2) possible swaps would slow down the process, but in my case for choose(

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 2:33 PM, trece por ciento wrote: Thanks David, but can read.fwf cope with different record types? I do not see any facility for that goal. For example, if recordtype is the 4th character, I could have: 011125678 ---> This is record Type 1 011136779 ---> This is record Ty

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread trece por ciento
Thanks David, but can read.fwf cope with different record types? For example, if recordtype is the 4th character, I could have: 011125678 ---> This is record Type 1 011136779 ---> This is record Type 1 011124943 ---> This is record Type 1 011286711 ---> This is record Type 2 011234872 ---> This is

Re: [R] regular expression submatch?

2010-02-01 Thread sjaffe
Thanks for the suggestions. gsub("hello (.*)", "\\1", "hello world") seems simplest. Setting value=TRUE returns the whole match, not the subexpression. (I always read the man pages carefully before asking for help, gratuituous comments notwithstanding. I didn't see a solution using gregexpr;

Re: [R] Convert a column of numbers to a column of strings

2010-02-01 Thread Gabor Grothendieck
Issue this first: library(chron) On Mon, Feb 1, 2010 at 2:42 PM, Gabor Grothendieck wrote: > Try this > >> Lines <- "Date Time Data > + 20091209 1200 1 > + 20091209 1500 2 > + 20091209 1800 3 > + 20091210 800 4 > + 20091210 1000 5 > + 20091210 1600 6" >> >> toChron <- function(x) as.chron(sprint

Re: [R] iterative regressions, adding a new line of data each time

2010-02-01 Thread Rolf Turner
On 2/02/2010, at 8:38 AM, Steve Lianoglou wrote: > On Mon, Feb 1, 2010 at 2:16 PM, Rolf Turner wrote: >> >> On 31/01/2010, at 12:14 PM, ace834 wrote: >> >>> >>> Hi, I am pretty new to R. I'm trying run a regression repeatedly, adding a >>> new data point each time, and then storing the predic

Re: [R] Convert a column of numbers to a column of strings

2010-02-01 Thread Gabor Grothendieck
Try this > Lines <- "Date Time Data + 20091209 1200 1 + 20091209 1500 2 + 20091209 1800 3 + 20091210 800 4 + 20091210 1000 5 + 20091210 1600 6" > > toChron <- function(x) as.chron(sprintf("%d %04d", x[,1], x[,2]), "%Y%m%d > %H%M") > > DF <- read.table(textConnection(Lines), header = TRUE) > toChr

Re: [R] iterative regressions, adding a new line of data each time

2010-02-01 Thread Steve Lianoglou
On Mon, Feb 1, 2010 at 2:16 PM, Rolf Turner wrote: > > On 31/01/2010, at 12:14 PM, ace834 wrote: > >> >> Hi, I am pretty new to R. I'm trying run a regression repeatedly, adding a >> new data point each time, and then storing the predicted Y values. For >> example, let's say I have 500 data points

[R] Missing names in LMER and GLM

2010-02-01 Thread vickih
I'm having trouble with 'lmer' and would really appreciate it if anybody could help. I am trying to run generalized linear mixed effect model, and am using 'lmer', but some of the names inside the data do not show up in the summary after I compute the 'lmer'. As a close example of the data I have

Re: [R] regular expression submatch?

2010-02-01 Thread Gabor Grothendieck
Try this: > library(gsubfn) > strapply("hello world", "hello (.*)")[[1]] [1] "world" On Mon, Feb 1, 2010 at 1:57 PM, sjaffe wrote: > > What is the simplest way to extract a matched subexpression? > > Eg. in perl you can do > > "hello world" =~ m/hello (.*)/ > > which would return 1(true) and se

Re: [R] iterative regressions, adding a new line of data each time

2010-02-01 Thread Rolf Turner
On 31/01/2010, at 12:14 PM, ace834 wrote: > > Hi, I am pretty new to R. I'm trying run a regression repeatedly, adding a > new data point each time, and then storing the predicted Y values. For > example, let's say I have 500 data points and I run the regression. I would > then like to store the

Re: [R] Convert a column of numbers to a column of strings

2010-02-01 Thread Erik Iverson
Also, although you don't need it to accomplish what you want, you were probably looking for the as.character function instead of toString... Tam Le wrote: Hello, Please excuse me if this question has been asked before. I'm new to R, and have been trying to google the answers without any succes

Re: [R] Convert a column of numbers to a column of strings

2010-02-01 Thread Erik Iverson
Hello, Tam Le wrote: Hello, Please excuse me if this question has been asked before. I'm new to R, and have been trying to google the answers without any success. I would like to convert a set of date and time into R date-time class. Right now, the dates and times are in integer format, so I f

Re: [R] regular expression submatch?

2010-02-01 Thread Henrique Dallazuanna
Try this: gsub("hello (.*)", "\\1", "hello world") On Mon, Feb 1, 2010 at 4:57 PM, sjaffe wrote: > > What is the simplest way to extract a matched subexpression? > > Eg. in perl you can do > > "hello world" =~ m/hello (.*)/ > > which would return 1(true) and set $1 to the matched subexpression "

Re: [R] regular expression submatch?

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 1:57 PM, sjaffe wrote: What is the simplest way to extract a matched subexpression? Eg. in perl you can do "hello world" =~ m/hello (.*)/ which would return 1(true) and set $1 to the matched subexpression "world". If you wanted a logical value returned, then ?grep If

Re: [R] regular expression submatch?

2010-02-01 Thread Steve Lianoglou
Hi, On Mon, Feb 1, 2010 at 1:57 PM, sjaffe wrote: > > What is the simplest way to extract a matched subexpression? > > Eg. in perl you can do > > "hello world" =~ m/hello (.*)/ > > which would return 1(true) and set $1 to the matched subexpression "world". Read through the documentation and exam

[R] regular expression submatch?

2010-02-01 Thread sjaffe
What is the simplest way to extract a matched subexpression? Eg. in perl you can do "hello world" =~ m/hello (.*)/ which would return 1(true) and set $1 to the matched subexpression "world". -- View this message in context: http://n4.nabble.com/regular-expression-submatch-tp1459146p145914

[R] Convert a column of numbers to a column of strings

2010-02-01 Thread Tam Le
Hello, Please excuse me if this question has been asked before. I'm new to R, and have been trying to google the answers without any success. I would like to convert a set of date and time into R date-time class. Right now, the dates and times are in integer format, so I first need to convert the

Re: [R] Comparing Variables and Writing a New Column

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 1:35 PM, Jerry Floren wrote: Hi David, Once again, thanks for your help. I still need some help. My original post was quite simplified, and perhaps that was a mistake. Here is the actual code and screen output from R: # Set the working directory setwd("C:\\Documents a

[R] Query on p-value

2010-02-01 Thread Binaya Pasakhala
Dear All, I have been using RClimdex for indices calculation. After completion of indices calculation, I get few statistical information on each output. Such as R2=3.4 p-value=0.333 Slope estimate= -7.774 and Slope error= 7.891 Now I would like to know, what do they mean and how shall I inter

[R] xmlToDataFrame drops me into browser

2010-02-01 Thread sjaffe
Even using the example from the documentation: > f = system.file("exampleData", "size.xml", package = "XML") > xmlToDataFrame(f, c("integer", "integer", "numeric")) Called from: xmlToDataFrame(doc, colClasses, homogeneous, collectNames, nodes = xmlChildren(xmlRoot(doc))) Browse[1]> I haven't se

Re: [R] how to write a function that remembers its state across its calls

2010-02-01 Thread Greg Snow
Use "local" to create a local environment and save your information there: > f <- local( { + xx <- rep(NA,3) + function(x) { + xx <<- c(xx[-1],x) + mean(xx) + } } ) > > f(1) [1] NA > f(2) [1] NA > f(3) [1] 2 > f(4) [1] 3 > > xx Error: object 'xx' not found > Hope this helps, -- Gregory (Greg)

Re: [R] Comparing Variables and Writing a New Column

2010-02-01 Thread Jerry Floren
Hi David, Once again, thanks for your help. I still need some help. My original post was quite simplified, and perhaps that was a mistake. Here is the actual code and screen output from R: # Set the working directory setwd("C:\\Documents and Settings\\jfloren\\My Documents\\TestRSoil") # Read

Re: [R] Question about interpretation of paired t-tests

2010-02-01 Thread Greg Snow
I appears that you have the logic backwards. P-values less than alpha (0.05 in your example) mean that you can reject the null hypothesis that the true mean difference is 0. Also, for the 2 sided test you either compare the 1-tail p-value to alpha/2 or double the 1-tail p-value (what R does if

Re: [R] hiding/protecting utility functions in .Rprofile

2010-02-01 Thread Greg Snow
Instead of putting the functions into .Rprofile, save them as a package or use save to put them in a .Rdata file. Then in .Rprofile you can load the package or attach the .Rdata file. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@i

[R] hiding/protecting utility functions in .Rprofile

2010-02-01 Thread Michael Friendly
[Env: WinXp, R 2.9.2] In my .Rprofile, I define a number of utility functions I'd like to have available in my R session, but don't want them to be *normally* listed by ls(), or more importantly, saved if I save my session variables/functions. How can I do this? -- Michael Friendly Email:

Re: [R] Adding line plot to a barplot

2010-02-01 Thread Greg Snow
Instead of using par(new=T), use the lines function instead of plot to add to an existing plot. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bou

Re: [R] Weighted SD

2010-02-01 Thread Peter Ehlers
Антон Морковин wrote: Dear all, what function can be used to calculate weighted SD or/and SE¿ There's no such stuff in 'base' package. There's wtd.var() in the Hmisc package. Or you could make suitable use of stats::weighted.mean(). -Peter Ehlers Best regards, A.A.Morkovin __

Re: [R] assigning 'default' values

2010-02-01 Thread Duncan Murdoch
On 01/02/2010 12:33 PM, Richard Thompson wrote: Hi all, probably something really simple, that I've missed but I'm running this loop in my Rscript: for (i in 1:nrow(cells)){ if(plate == as.character(cells[i,1])){ plate2 <-cells[i,2]} } it's assigning the relevant data correctly as lo

Re: [R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 11:40 AM, trece por ciento wrote: I need to import several ascii files in fixed format with two different record types. The data comes from European Labor Force Surveys, wich is a household survey. The first record type is for people over 16 years, and the second much so

Re: [R] numerical subscripts in a loop in a plot

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 12:40 PM, Alexander Nervedi wrote: Hi R Graphics Gurus I am unable to figure out this issues with unevaluated expressions. I'm trying to create a graphic where I calculate the residual from a regression and want to mark each residual with its observation number. So so

[R] Biclust package: drawHeatmap()

2010-02-01 Thread Tim Smith
Hi, I was trying to draw a heatmap of the bicluster results. With the code given in the biclust package I can only get the heatmap for one cluster at a time (drawHeatmap function). Is there any way that I can get the heatmap for all the clusters at the same time? The code that I am using (biclu

Re: [R] Weighted SD

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 12:37 PM, Антон Морковин wrote: Dear all, what function can be used to calculate weighted SD or/and SE¿ There's no such stuff in 'base' package. Seems as though lm with a weights argument could be used fairly simply. Best regards, A.A.Morkovin David Winsemius, MD Heri

Re: [R] numerical subscripts in a loop in a plot

2010-02-01 Thread Eik Vettorazzi
Hi Alexander, there is a simple solution using bquote for(i in 1:10){ text(i, 0,bquote(epsilon[.(i)])) } hth. Alexander Nervedi schrieb: Hi R Graphics Gurus I am unable to figure out this issues with unevaluated expressions. I'm trying to create a graphic where I calculate the residual fro

Re: [R] create an object in a loop (v2)

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 12:33 PM, Ivan Calandra wrote: I have a follow-up question: I use assign() to store some value in my paste()-created object as suggested: for (i in 1:3) { assign(paste("object", i, sep=""), c("a", "b", "c")) } Then I would like to change the names of the elements of that

[R] Building a plotmath string in a function

2010-02-01 Thread dkStevens
I apologize if this has been asked before but I've look for a long time with no success. My problem is that I want to annotate a plot with an expression that combines parameter names with fitted values for from 1 to n parameters depending on the problem - something like R = 16.1, P[m] = 4.51, k[

[R] numerical subscripts in a loop in a plot

2010-02-01 Thread Alexander Nervedi
Hi R Graphics Gurus I am unable to figure out this issues with unevaluated expressions. I'm trying to create a graphic where I calculate the residual from a regression and want to mark each residual with its observation number. So something like plot(0,0, type = "n", xlim = c(0,10)) for(i in 1

[R] Weighted SD

2010-02-01 Thread Антон Морковин
Dear all, what function can be used to calculate weighted SD or/and SE¿ There's no such stuff in 'base' package. Best regards, A.A.Morkovin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] DRAW TWO REGRESSION CURVES IN ONE GRAPH

2010-02-01 Thread Greg Snow
To expand on Gabor's response, using type=c("p","smooth") will closer replicate the effect of the scatter.smooth function. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-pro

[R] assigning 'default' values

2010-02-01 Thread Richard Thompson
Hi all, probably something really simple, that I've missed but I'm running this loop in my Rscript: for (i in 1:nrow(cells)){ if(plate == as.character(cells[i,1])){ plate2 <-cells[i,2]} } it's assigning the relevant data correctly as long as plate exists somewhere in cells[i,1]. The pr

[R] (no subject)

2010-02-01 Thread Антон Морковин
-- Отправлено из мобильной Яндекс.Почты: http://m.ya.ru/ymail __ 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,

Re: [R] create an object in a loop (v2)

2010-02-01 Thread Ivan Calandra
I have a follow-up question: I use assign() to store some value in my paste()-created object as suggested: for (i in 1:3) { assign(paste("object", i, sep=""), c("a", "b", "c")) } Then I would like to change the names of the elements of that object within the loop. Since it is all in a loop,

Re: [R] Fwd: Re: Graph color

2010-02-01 Thread Greg Snow
What you are asking (making labels of points not overlap the points) is either very simple or very complicated, depending on your data and what you want the results to look like. It may be as simple as text(x, y-strheight('A'), labels). If that does not do what you want, then there is thigmopho

Re: [R] help

2010-02-01 Thread Thierno 12 Sow
> > Dear Madam, Sir, > Dear Madam, Sir, > I am a student in statistics at the Université Rennes 1 (France), I've used > the polr function in R to estimate an ordered probit model (consumer > preference) but the strange thing is that *I did not get the probabilities > which can tell me whether the v

Re: [R] Odp: How to repeat "for" function?

2010-02-01 Thread ayu2008
Dear Petr, The intention is to get a ratio value for every observations (1400 obs) for every variable (4 variables). And from the ratios, I would like to rank the variables based on how many times the variable being the highest among 4 of them (or the total number of being the highest ratios

[R] Import fixed-format ascii file with mixed record types

2010-02-01 Thread trece por ciento
I need to import several ascii files in fixed format with two different record types. The data comes from European Labor Force Surveys, wich is a household survey. The first record type is for people over 16 years, and the second much sorter is for people aged 15 or less (this record has a fille

Re: [R] Odp: how to generate data set with different length and calculate the mean?

2010-02-01 Thread aegea
Petr, Thanks for your suggestions. It makes sense, since I don't know how to make a matrix with different length of rows. I have a concern for this problem. I actually deal with a much bigger dataset e.g. 1000, and each dataset needs to change the number of data in it according a vector which ha

[R] Multiple items in menu()

2010-02-01 Thread James Rome
Is there a way to allow a user to select multiple items in a menu()? Thanks, Jim Rome __ 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 prov

Re: [R] Comparing Variables and Writing a New Column

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 11:36 AM, David Winsemius wrote: On Feb 1, 2010, at 11:11 AM, Jerry Floren wrote: HI, I am using Windows XP and R version 2.9.2. I have a data frame written by R similar to the following: Lab_IDAnalysis_SoilResults-4MAD -2.5MAD +2.5MAD

Re: [R] how to write a function that remembers its state across its calls

2010-02-01 Thread Charles C. Berry
On Mon, 1 Feb 2010, Hao Cen wrote: Hi, I wonder how to write a function that remembers its state across its calls. For example, I would like to compute the average of the pass three values the function has seen f(1) # NA f(2) # NA f(3) # 2 f(4) # 3 This would require f to keep track of th

Re: [R] create an object in a loop (v2)

2010-02-01 Thread Ivan Calandra
To answer to the problem, assign() does what I need, thanks a lot! In any case, for that kind of things, I don't think a sample dataset would be needed, and indeed it was not, which is why I didn't attach it. Honestly, I thought that you would need more info on what I intend to do, but it pro

Re: [R] Comparing Variables and Writing a New Column

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 11:11 AM, Jerry Floren wrote: HI, I am using Windows XP and R version 2.9.2. I have a data frame written by R similar to the following: Lab_IDAnalysis_SoilResults-4MAD -2.5MAD +2.5MAD+4MAD 55003Calcium-2008-116 900 9

[R] how to write a function that remembers its state across its calls

2010-02-01 Thread Hao Cen
Hi, I wonder how to write a function that remembers its state across its calls. For example, I would like to compute the average of the pass three values the function has seen f(1) # NA f(2) # NA f(3) # 2 f(4) # 3 This would require f to keep track of the values it has seen. In other lan

Re: [R] Solving an optimization problem: selecting an "optimal" subset

2010-02-01 Thread Hans W Borchers
Dimitri Shvorob gmail.com> writes: > > Given vector of numbers x, I wish to select an n-subset with sum closest > fixed value s. Can anyone advise me how to approach this, in R? > > I have considered Rcplex package, which handles integer/binary > linear/quadratic optimization problems, but have d

Re: [R] create an object in a loop (v2)

2010-02-01 Thread David Winsemius
Upon reading it yesterday, it appeared as it would have required some serious testing and there was no data on which to do any work. You were clearly not taking the time to isolate the problem and construct a dataset. But who knows? When you say "What I want to do is. ... ,I would like the

[R] Comparing Variables and Writing a New Column

2010-02-01 Thread Jerry Floren
HI, I am using Windows XP and R version 2.9.2. I have a data frame written by R similar to the following: Lab_IDAnalysis_SoilResults-4MAD -2.5MAD +2.5MAD+4MAD 55003Calcium-2008-116 900 9611121.5 1656.5 1817 55003

[R] Odp: create an object in a loop (v2)

2010-02-01 Thread Petr PIKAL
Hi I would recommend to create a dummy object of class list with names vvv<-vector("list", 5) > vvv [[1]] NULL [[2]] NULL [[3]] NULL ... names(vvv)<-paste(letters[1:5], "_", 1:5, "_some.thing", sep="") vvv $a_1_some.thing NULL $b_2_some.thing NULL $c_3_some.thing NULL ... Than you can call

[R] Odp: How to repeat "for" function?

2010-02-01 Thread Petr PIKAL
Hi few comments r-help-boun...@r-project.org napsal dne 01.02.2010 14:51:17: > > Dear Users, > > I have one problem here, I tried many time and even read a few notes on > writing function but still. > > > Can anyone help me on how to simplify Part B (please refer the programming > below

  1   2   >