[R] Reshaping matrix of lists as dataframe

2010-02-01 Thread Oliver Gondring
Hello William, hello David, thanks a lot for helping and keeping me going on what sometimes seems to be a long way to R mastery! :) I found that the two solutions William proposed were in fact easier to understand for me at the moment as David's (and has the additional advantage of

[R] Number with fixed digit length - zero fill-up

2010-02-01 Thread Jägermeyr , Jonas
Dear R-help members, I'm quite new to R and I apologize for my basic question, but I haven't been able to find a solution yet. I try to interpret vector entries as a binary code, but unfortunately every first digit which is zero disappears. So how can I set any number (e.g. x = 10110) to a

[R] Sorting with NA skipped (not omitted)

2010-02-01 Thread Dieter Menne
As a C-programmer, doing complex sorting based on a callback function is fairly easy. After having read some messages on the forum, using a callback function for sorting is not that easy in R. Assume I want that in a comparison, NA should be treated as don't decide, leave decision to the next

Re: [R] Number with fixed digit length - zero fill-up

2010-02-01 Thread Romain Francois
Here is one way: sprintf( %08d, 10110 ) [1] 00010110 Romain On 02/01/2010 09:00 AM, Jägermeyr, Jonas wrote: Dear R-help members, I'm quite new to R and I apologize for my basic question, but I haven't been able to find a solution yet. I try to interpret vector entries as a binary code,

[R] Query on R-Climdex

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

[R] problem withrbind function

2010-02-01 Thread venkata kirankumar
Hi all, I am trying to to merge two data.frames(kk and ff) like kk a b d 1 1 4 7 2 2 5 8 3 3 6 9 ff a b d 1 2 5 8 2 3 6 9 3 4 7 1 and g-rbind(kk,ff) is working perfectly and giving results but if any of the column name changed then its giving Error in match.names(clabs, names(xi)) :

[R] matrix columns

2010-02-01 Thread ogbos okike
Hello. I am working with a set of variables which are in columns. Three of them are of the same length while one has a different length. Typing 'data-matrix(c(ca$value, mo$value,b2$value, y1), ncol = 3)' appears to read any three columns out of the four, though I can say exactly which of these

[R] Help with multiple poisson regression with MLE2

2010-02-01 Thread elena daniela concepcion
Hi, I'm trying to make multiple poisson regressions with the MLE2 command. I have used the following expression, but I receive an error message: poisfit - mle2(y ~ dpois(exp(b0 + b1*x1 + b2*x2)), start=list(b0=1, b1=1, b2=1), data=data1) Error in optim(par = c(1, 1, 1), fn = function (p) :

Re: [R] Help with R in ubuntu

2010-02-01 Thread Marianne Promberger
In a new karmik koala ubuntu installation I compile the last patched 2.10.1 version of R. This doesn't answer your question, but you do know you can get the (pretty much, I think) latest R via aptitude by adding a CRAN mirror to your /etc/apt/sources.list, right?

Re: [R] matrix columns

2010-02-01 Thread Jim Lemon
On 02/01/2010 07:52 PM, ogbos okike wrote: Hello. I am working with a set of variables which are in columns. Three of them are of the same length while one has a different length. Typing 'data-matrix(c(ca$value, mo$value,b2$value, y1), ncol = 3)' appears to read any three columns out of the

[R] Question about interpretation of paired t-tests

2010-02-01 Thread Beat Meier
hi there, i have a few questions about the correct interpretation of a paired t-test. (i don't think that this matters, but I'm using R 2.10.1 on Windows). to my questions: i've been using a lot of time about this minor concerns now and I hope you can help me... I use one- and two-sided

[R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Madhavi Bhave
Dear R helpers   I am calculating the 'Yield to Maturity' for the Bond with following characteristics.   Its a $1000 face value, 3 year bond with 10% annual coupon and is priced at 101. The yield to maturity can be calculated after solving the equation -   1010 = [100 / (1+ytm)]  + [100 /

[R] strings plots

2010-02-01 Thread A Z
Hi all ! I'm new in this list and newbie about R I'm trying to use R scripts (as in the attached file) for creating some distributions plots of data retrieved by a workflow(with Rserve, to be precise). I was able to do it (even if not in a beatiful way, I have to improve it especially about

Re: [R] Using tcltk or other graphical widgets to view zoo time series objects

2010-02-01 Thread Research
/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. __ Information from ESET Smart Security, version of virus signature database 4823 (20100201

Re: [R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Craig P. Pyrame
Madhavi Bhave wrote: Dear R helpers I am calculating the 'Yield to Maturity' for the Bond with following characteristics. Its a $1000 face value, 3 year bond with 10% annual coupon and is priced at 101. The yield to maturity can be calculated after solving the equation - 1010 = [100 /

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

2010-02-01 Thread aegea
Hello, This may be a rare question. I am struggling to solve it. I really appreciate any help or suggestions. Thanks a lot in advance! I put my questions between the code to make it clear. The problem I have is: I generated 10 data sets with 8 data for each set. Now I want to change the number

[R] Dear professor

2010-02-01 Thread Tian Xu
Dear professor: When I used s-plus to run a Buckley-James Multiple Regression Model, the program said Object na.delete not found. I found that Design package and Hmisc package have been installed. The database SDF1、program SCRIPT1 and a picture are in the attachment. Would you please give me

[R] Adding line plot to a barplot

2010-02-01 Thread Nadine Kilsby
Hi, I am trying to add a line plot of barplot, and while the following script works: barplot(DATA1,bty='c') par(new=T) plot(DATA2,type=l,axes=F,xlab=,ylab=,bty='c') axis(4) for some reason the y axis' do not align (the 0s are not in the same position). Is this because I am trying to overlay

Re: [R] Reshaping matrix of lists as dataframe

2010-02-01 Thread Henrique Dallazuanna
You can try this also: m - do.call(rbind, sapply(split(x, rep(seq(length(x)/3), each = 3)), do.call, what = cbind)) dimnames(m) - list(paste(Case, rep(1:3, unique(sapply(x, length))), sep = ), c(First, Length, Value)) On Mon, Feb 1, 2010 at 5:58 AM, Oliver Gondring oli...@gmx.de wrote: Hello

Re: [R] Adding line plot to a barplot

2010-02-01 Thread Jim Lemon
On 02/01/2010 05:40 PM, Nadine Kilsby wrote: Hi, I am trying to add a line plot of barplot, and while the following script works: barplot(DATA1,bty='c') par(new=T) plot(DATA2,type=l,axes=F,xlab=,ylab=,bty='c') axis(4) for some reason the y axis' do not align (the 0s are not in the same

Re: [R] strings plots

2010-02-01 Thread Jim Lemon
On 02/01/2010 08:50 PM, A Z wrote: Hi all ! I'm new in this list and newbie about R I'm trying to use R scripts (as in the attached file) for creating some distributions plots of data retrieved by a workflow(with Rserve, to be precise). I was able to do it (even if not in a beatiful way, I

[R] Pipe /shell - R does not wait

2010-02-01 Thread robbert blonk
Dear All, Within a large script, I try to invoke a second program (called e.g. XXX) from R using shell or pipe. e.g.: readLines(pipe(XXX)) or: shell(XXX,intern=TRUE, wait = TRUE) After running the program, the script reads a file with solutions produced by the second program (XXX.001).

[R] programing problem with for( )

2010-02-01 Thread marlene marchena
Hi R-users I'm writing a code to run a fuction but I found an error that I can't fix. I reproduced the error with a simple example. The correct answer is k but I can't fill my s matrix. What I'm doing wrong? s-matrix(data=NA,nrow=1,ncol=5 ) s for(i in 1:5) { k=sqrt(i)

Re: [R] Pipe /shell - R does not wait

2010-02-01 Thread Duncan Murdoch
robbert blonk wrote: Dear All, Within a large script, I try to invoke a second program (called e.g. XXX) from R using shell or pipe. e.g.: readLines(pipe(XXX)) or: shell(XXX,intern=TRUE, wait = TRUE) After running the program, the script reads a file with solutions

Re: [R] programing problem with for( )

2010-02-01 Thread Henrique Dallazuanna
Try this: s -matrix(data=NA,nrow=1,ncol=5 ) for( i in 1:5) { k - sqrt(i) s[,i] - k print(k) } Or: s[] - sqrt(1:5) On Mon, Feb 1, 2010 at 9:29 AM, marlene marchena marchenamarl...@gmail.com wrote: Hi R-users I'm writing a code to run a fuction but I found an error that I can't

Re: [R] programing problem with for( )

2010-02-01 Thread Ted Harding
On 01-Feb-10 11:29:40, marlene marchena wrote: Hi R-users I'm writing a code to run a fuction but I found an error that I can't fix. I reproduced the error with a simple example. The correct answer is k but I can't fill my s matrix. What I'm doing wrong?

Re: [R] 'R' and 'Yield to Maturity'

2010-02-01 Thread S Ellison
If you know the likely range, uniroot would do it. f.ytm-function(ytm) 100 / (1+ytm) +100 / ((1+ytm)^2) + 1100 / ((1 + ytm)^3) -1010 uniroot(f.ytm, interval=c(0,25)) #$root has the answer Craig P. Pyrame crap...@gmail.com 01/02/2010 10:19 Madhavi Bhave wrote: Dear R helpers I am

Re: [R] Using tcltk or other graphical widgets to view zoo time series objects

2010-02-01 Thread Felix Andrews
/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. __ Information from ESET Smart Security, version of virus signature database 4823 (20100201) __ The message

Re: [R] Pipe /shell - R does not wait

2010-02-01 Thread robbert blonk
Sorry, forgot to included the information. Working in Windows (although a try on linux gave the same problems) R 2.10.0 Do you suggest to update a newer version of R? regards, Robbert -- View this message in context: http://n4.nabble.com/Pipe-shell-R-does-not-wait-tp1458692p1458727.html

Re: [R] Pipe /shell - R does not wait

2010-02-01 Thread Duncan Murdoch
robbert blonk wrote: Sorry, forgot to included the information. Working in Windows (although a try on linux gave the same problems) R 2.10.0 Do you suggest to update a newer version of R? I don't think there were any changes to the system() code between 2.10.0 and 2.10.1, but there are

Re: [R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Madhavi Bhave
Dear Sir,   That was GREAT!!!. Thanks a lot for the solution. Once again it showed how powerful 'R' is otherwise I was breaking my head on Newton-Raphson method.   Thanks again Sir. That was really superb.   Madhavi --- On Mon, 1/2/10, S Ellison s.elli...@lgc.co.uk wrote: From: S Ellison

[R] working with taxonomic trees: sampling

2010-02-01 Thread Olga Lyashevska
Dear all, I am working with taxonomic data, represented as a list of classes, orders, families, genera and finally species. class(mydata) [1] data.frame mode(mydata) [1] list names(mydata) [1] tclass torder tfamily tgenus tspecies length(mydata$tclass) [1] 161590 The first 10

Re: [R] Merging vector data into one file

2010-02-01 Thread jim holtman
You never really said what your data structure looks like. It appears that the 'single row' might be a named vector. It would be good to follow the post policy and supply sample data. Here is one way of doing it, depending on exactly what your data looks like: # create sample data of a list

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

2010-02-01 Thread Petr PIKAL
Hi I have no idea how you could do what you want. I only recommend you to use list instead of matrix as list can incorporate objects with various size I am not sure if this is the most elegant way but you can make your matrix a data frame ddd- as.data.frame(data) and than use thist

Re: [R] problem withrbind function

2010-02-01 Thread jim holtman
You can change the column names with 'colnames'. If they have the same number of columns, then you can give them consistent names and they will 'rbind' together. In the case where they have different column names, do you want to create as output something with 4 columns with the missing rows

[R] playwith error message

2010-02-01 Thread Sigbert Klinke
Hi, I'am using the playwith library to write my own small GUI application. But I get the following error under Windows and Linux (Ubuntu): Error in if ((modeOK %in% c(Identify, Brush)) (actions$ident == : Fehlender Wert, wo TRUE/FALSE nötig ist Under linux my R program simply continues, but

Re: [R] Help with multiple poisson regression with MLE2

2010-02-01 Thread Ben Bolker
elena daniela concepcion elenadconcepcion at gmail.com writes: Hi, I'm trying to make multiple poisson regressions with the MLE2 command. I have used the following expression, but I receive an error message: poisfit - mle2(y ~ dpois(exp(b0 + b1*x1 + b2*x2)), start=list(b0=1, b1=1, b2=1),

Re: [R] playwith error message

2010-02-01 Thread Liviu Andronic
Hello On 2/1/10, Sigbert Klinke sigb...@wiwi.hu-berlin.de wrote: I'am using the playwith library to write my own small GUI application. But I get the following error under Windows and Linux (Ubuntu): Error in if ((modeOK %in% c(Identify, Brush)) (actions$ident == : Fehlender Wert, wo

Re: [R] programing problem with for( )

2010-02-01 Thread marlene marchena
Hi, Thanks a lot it works. But as Ted remarked it was a simple case of a more complex procedure. Here is what I trying to do (sorry I was not able to find another example) I wrote a fuction that I call bullexe(phi,theta,L) the code of this function is at the end of this mail. I want to run

Re: [R] Using tcltk or other graphical widgets to view zoo time series objects

2010-02-01 Thread Liviu Andronic
On 2/1/10, Research risk2...@ath.forthnet.gr wrote: do_something_else = function(playstate) ###Export here mean value of sequence playState$env$i### Would this do the trick? playwith(xyplot(dat[,c(1,i)]), parameters = list(i = 1:100, do_something = function(playState)

[R] Isolating a column within a loop

2010-02-01 Thread Steve Murray
Dear all, I am trying to calculate the mean of one column for many data frames. The code I am using is as follows: for (i in seq(nrow(index))) {         assign(paste(model, _mean_,index$year[i], index$month[i], sep=''),   mean(get(paste(model, index$year[i], index$month[i], [,3],

Re: [R] Using tcltk or other graphical widgets to view zoo time series objects

2010-02-01 Thread Research
) } ) ) Liviu __ Information from ESET Smart Security, version of virus signature database 4823 (20100201) __ The message was checked by ESET Smart Security. http://www.eset.com __ Information from ESET Smart Security, version of virus signature database 4823

Re: [R] Isolating a column within a loop

2010-02-01 Thread Henrique Dallazuanna
Try this: for (i in seq(nrow(index))) { assign(paste(model, _mean_,index$year[i], index$month[i], sep=''), mean(get(paste(model, index$year[i], index$month[i], sep=''))[,3])) } On Mon, Feb 1, 2010 at 11:49 AM, Steve Murray smurray...@hotmail.com wrote: Dear all, I am

Re: [R] AFT-model with time-varying covariates and left-truncation

2010-02-01 Thread Philipp Rappold
Thanks for your super-fast reply. I realized you're totally right: My problem is not left truncation but missing data of time-varying covariates. In my special case, two conditions are given by study design: (1) A lot of subjects are missing all of their (time-varying) covariates for a

Re: [R] Isolating a column within a loop

2010-02-01 Thread Steve Murray
Thanks! I've learnt something there! Steve _ We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now __

Re: [R] strings plots

2010-02-01 Thread A Z
HI thank you very much for the advice the result, in R console, is more or less what I tried to do but I'm not able to modify, in the right way, my script: -- ## read the data devinp - read.csv(textConnection(dev_input),header=FALSE,row.names=NULL) dev_inp - as.vector(devinp, mode=integer) ##

Re: [R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Craig P. Pyrame
Be sure to check $estim.prec and use the parameter tol as needed. Best regards, Craig Madhavi Bhave wrote: Dear Sir, That was GREAT!!!. Thanks a lot for the solution. Once again it showed how powerful 'R' is otherwise I was breaking my head on Newton-Raphson method. Thanks again Sir.

Re: [R] Create matrix with subset from unlist

2010-02-01 Thread Muhammad Rahiz
Hello all, Thanks for all your replies. Usually, when I make a post to the R-mailing list, I would keep on trying to get the solution myself rather than waiting for one. At times, I was able to derive my own solution. This would explain why my solution and that of Dennis's produces the same

[R] Issue with the package dyn used together with the function loess

2010-02-01 Thread Matthieu Cornec
Hi, I am trying to use package dyn together with loess. I have the following issue in the code below when I use predict while specifying the newdata argument. Any help is welcomed. Thanks in advance. Matthieu Cornec y - ts(1:12, start = c(2000,2), freq = 4)^3 x - ts(1:9, start = c(2000,3),

[R] Manipulating data, and performing repeated simple regressions, not multiple regression

2010-02-01 Thread Guy Green
I have a simple table of data: ResultVar1Var2Var3 1 0.100.780.120.38 2 0.200.660.390.12 3 0.100.830.090.52 4 0.150.410.630.95 5 0.600.880.910.86 6 -0.020.140.690.94 I am trying to achieve two

[R] How to repeat for function?

2010-02-01 Thread ayu2008
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), so that I don't have to repeat the calculation of num and r ? Thank you very much..every

Re: [R] Manipulating data, and performing repeated simple regressions, not multiple regression

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 6:29 AM, Guy Green wrote: I have a simple table of data: ResultVar1Var2Var3 1 0.100.780.120.38 2 0.200.660.390.12 3 0.100.830.090.52 4 0.150.410.630.95 5 0.600.880.910.86 6 -0.020.14

Re: [R] playwith error message

2010-02-01 Thread Sigbert Klinke
Hi, Can you post a reproducible example that leads to this error? myplot - function(x) { plot(x) } efaApp - function(data, ...) { playwith (myplot(data[,8:9]), click.mode = Brush, ) } efaApp(as.data.frame(Boston)) My plot routines even return invisibly a list

Re: [R] programing problem with for( )

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 8:20 AM, marlene marchena wrote: Hi, Thanks a lot it works. But as Ted remarked it was a simple case of a more complex procedure. Here is what I trying to do (sorry I was not able to find another example) I wrote a fuction that I call bullexe(phi,theta,L) the code

Re: [R] Help with multiple poisson regression with MLE2

2010-02-01 Thread elena daniela concepcion
Ben, thanks a lot for your quick reply. Scales of x1 and x2 covariates were too different and this fact may have caused some problem. I have made them similar by dividing one of them by 1000 and now the analysis works. Best regards, Elena 2010/2/1 Ben Bolker bol...@ufl.edu elena daniela

Re: [R] 'R' and 'Yield to Maturity'

2010-02-01 Thread Khanh Nguyen
You can look at package RQuantLib from here http://cran.r-project.org/web/views/Finance.html -k On Mon, Feb 1, 2010 at 4:43 AM, Madhavi Bhave madhavi_bh...@yahoo.com wrote: Dear R helpers I am calculating the 'Yield to Maturity' for the Bond with following characteristics. Its a $1000

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

2010-02-01 Thread Ivan Calandra
Hi everybody, I'm kind of surprised that I didn't get any answer to my question... Is it not interesting? Is it not well explained? Am I doing something wrong? Was it lost in the hundreds of other emails during the weekend? I hope it is because of my last guess. So I'll just send the email

Re: [R] strings plots

2010-02-01 Thread A Z
HI thank you very much for the advice the result, in R console, is more or less what I tried to do but I'm not able to modify, in the right way, my script: ## read the data devinp - read.csv(textConnection(dev_input),header=FALSE,row.names=NULL) dev_inp - as.vector(devinp, mode=integer) ## plot

Re: [R] Create matrix with subset from unlist

2010-02-01 Thread David Winsemius
On Feb 1, 2010, at 9:38 AM, Muhammad Rahiz wrote: Hello all, Thanks for all your replies. Usually, when I make a post to the R-mailing list, I would keep on trying to get the solution myself rather than waiting for one. At times, I was able to derive my own solution. This would explain

Re: [R] Simple question on replace a matrix row

2010-02-01 Thread anna
Hello guys, I wanted to thank you, each one of you led me step by step to the core of the problem. The matrix I was working on was made of rows obtained each one by the lapply function. So by using lapply I was getting a matrix which rows were not numeric vectors but lists. To solve this I used a

[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), so

[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 your list

[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

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

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

2010-02-01 Thread Hans W Borchers
Dimitri Shvorob dimitri.shvorob at 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

[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

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

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

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

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

[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

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

[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

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

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

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

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, I cannot

[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,

[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: code for (i in 1:nrow(cells)){ if(plate == as.character(cells[i,1])){ plate2 -cells[i,2]} } code it's assigning the relevant data correctly as long as plate exists somewhere in

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] 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

[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

[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,

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 object

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

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

[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

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

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

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: code for (i in 1:nrow(cells)){ if(plate == as.character(cells[i,1])){ plate2 -cells[i,2]} } code it's assigning the relevant data

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] 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

[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

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

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

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] 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) L. Snow Ph.D.

[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 set any debug()

[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

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

  1   2   >