[R] Help needed to clarify hclust and cutree algorithms

2009-09-21 Thread Dana Sevak
Dear R Helpers, I read carefully the documentation and all postings on the hclust and cutree functions, however some aspects of the tree ordering and cluster assignment performed by these functions remain unclear to me, so I would very much appreciate your help in making sure I get them right.

[R] Point Density calculation

2009-09-21 Thread claw73
Hello everyone, This is my first post but I really need help and think R could be the way to go. I have a question regarding R and finding the most points in a certain area. I am looking at various places that have a certain point value associated to each place. The data I will be reading in

[R] Selecting data based on date-Data manupulation

2009-09-21 Thread premmad
I have 70 columns and more than 400k rows .In the data date column will have values from 1900(01/01/1900) .How do i select only the data of recent two years?Help me in this regard -- View this message in context:

[R] Handling missing data

2009-09-21 Thread premmad
I have to remove missing data both in character and numeric datatype.I tried using NA condition but it is not working ,please help me to solve this. -- View this message in context: http://www.nabble.com/Handling-missing-data-tp25530192p25530192.html Sent from the R help mailing list archive at

[R] [R-pkgs] New version of QCA

2009-09-21 Thread Adrian Dusa
Hi, A new version of the QCA package (0.6-0) was submitted to CRAN. This is a major improvement, now working with multi-valued data (previous versions accepted binary data only). The classical function qmcc() still accepts only binary data, but the enhanced function eqmcc() is now ready for

Re: [R] Datetime conversion

2009-09-21 Thread premmad
Thanks to everyone for helping me overcome the problem faced .I have got over with the problem .once again thanks for the immediate response of all the members -- View this message in context: http://www.nabble.com/Datetime-conversion-tp25503138p25530176.html Sent from the R help mailing list

Re: [R] R on browser

2009-09-21 Thread vinay basavanal
want i meant was there is Rweb (web interface) http://bayes.math.montana.edu/Rweb/Rweb.general.html where we can type in r code and it gives u results ,so i just wanted to know if there r any other such sites -- View this message in context:

[R] sm color image

2009-09-21 Thread ogbos okike
Hi, I have used sm package ( sm.sphere(k$x, k$y, kappa = 20, hidden = FALSE, sphim = FALSE, addpoints = FALSE) to obtain global lightning distribution. But I am still in trouble with the color image - everything is thick black and therefore, difficult to note the regions of higher density. Could

Re: [R] Maximum No.of code in R

2009-09-21 Thread Petr PIKAL
Well, code with 50+ ifelse statements (probably nested) seems to me quite weird. I believe that such scheme could be solved differently but without real code it is nothing to suggest. r-help-boun...@r-project.org napsal dne 18.09.2009 13:51:45: On 9/18/2009 5:49 AM, premmad wrote: I tried

Re: [R] How to choose knots for GAM?

2009-09-21 Thread Simon Wood
Have you been plotting the columns of the model matrix against age, and finding differences between replicates? If so, the differences that you see are the differences induced by the *identifiability constraints* applied to the different replicates. The identifiability constraint is that the

Re: [R] Regarding Performance and Prediction routines of rattle library and XML package

2009-09-21 Thread Graham Williams
Try the ROCR package. Regards, Graham 2009/9/13 Abbas R. Ali abba...@yahoo.com Hi Can anybody tell me in which library Performance and Prediction routines exist to find AUC and I am unable to find a dependency of rattle library, XML, for Windows can any body tell me about that. Thanks

[R] Odp: Selecting data based on date-Data manupulation

2009-09-21 Thread Petr PIKAL
Hi see ?format output of format can be transferred to numeric and you can use logical operators to select only desired data. x[as.numeric(format(x, %Y)) 2008,] another option is to compare it to some date like x as.Date(2008-1-1) this assumes that x has class Date. If not you can change it

[R] Odp: Handling missing data

2009-09-21 Thread Petr PIKAL
Hi did you try ?complete.cases or ?na.omit? nadata[complete.cases(nadata),] Regards Petr r-help-boun...@r-project.org napsal dne 21.09.2009 08:16:04: I have to remove missing data both in character and numeric datatype.I tried using NA condition but it is not working ,please help me to

[R] How to run r and r GUIs

2009-09-21 Thread AJay Ohri
Apologize in advance for the question but could anyone tell how to run r Rattle and rcmdr on I Phone 3gs please regards ajay ohri u Tennessee At Knoxville Www.decisionstats.com Sent from my iPhone On Sep 21, 2009, at 4:44 AM, Graham Williams graham.willi...@togaware.com wrote: Try the

Re: [R] define a new family (and a new link function) for gam in gam package

2009-09-21 Thread Corrado
Dear Simon, I want a simple generalised additive model for regression which I can customise (force /define a certain basis, certain order for the splines, knots vector, generating new link functions, and force the regression through 0,0). What do you suggest? On Friday 18 September 2009

Re: [R] Replacing values in dataframes

2009-09-21 Thread Monna Nygård
Thank you so much for trying to help me. Thus, I still can't get it to work. I will clearify a bit. If you somehow have time helping me I would much appreciate it. NAD and Prot.amount are both data.frames. There are several different dataframes called NAD,NAD1, NAD2 etc. that I

[R] Putting a text box in a plot

2009-09-21 Thread Sergey Goriatchev
Hello everyone, I have a plot and I want to but a (formatted) box containing text and numbers, say: Mean: 0.1 St.Deviation: 1.1 Skewness: 1.1 Kurtosis: 0.5 I know there is a way to do this, there is a function in some library, but it's been years since I used this function, and I do not remember

Re: [R] Putting a text box in a plot

2009-09-21 Thread baptiste auguie
Hi, Maybe the textplot() function in the gplots package? HTH, baptiste 2009/9/21 Sergey Goriatchev serg...@gmail.com: Hello everyone, I have a plot and I want to but a (formatted) box containing text and numbers, say: Mean: 0.1 St.Deviation: 1.1 Skewness: 1.1 Kurtosis: 0.5 I know

Re: [R] Missing link(s) in documentation object

2009-09-21 Thread Jon Olav Skoien
Martin Morgan wrote: Jon Olav Skoien wrote: Hi, I want to cross-reference from the documentation of pkg1 to pkg2, which is imported in the NAMESPACE of pkg1, and under Depends in DESCRIPTION of pkg1. According to Writing R extensions, this can be done by: \code{\link{foo}} when foo is an

Re: [R] Replacing values in dataframes

2009-09-21 Thread Petr PIKAL
Hi I believe you are quite near. r-help-boun...@r-project.org napsal dne 21.09.2009 11:38:29: Thank you so much for trying to help me. Thus, I still can't get it to work. I will clearify a bit. If you somehow have time helping me I would much appreciate it. NAD and Prot.amount are

Re: [R] Putting a text box in a plot

2009-09-21 Thread baptiste auguie
Where do you want this text to be placed then? maybe a call to legend(), or mtext() would suffice, it's hard to say more without a reproducible example. baptiste 2009/9/21 Sergey Goriatchev serg...@gmail.com: Hi, Baptiste Yes, I've found textplot() function, but I doubt it is the one I

Re: [R] Putting a text box in a plot

2009-09-21 Thread Sergey Goriatchev
Hi, Baptiste Yes, I've found textplot() function, but I doubt it is the one I need. What I have is a density plot, and I want to add to this density plot a text box containing the stats I mentioned in previous email. I could do that kind of stuff with simple text() function, but then everytime x

Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread Werner Wernersen
Hi, I have to follow up my own question since this problem is getting quite disturbing and I fear that it also causes other functions to malfunction without notice. It occurs quite quite often when I manipulate the mentioned data set. It definitely is caused by the column entries which are

Re: [R] Putting a text box in a plot

2009-09-21 Thread Sergey Goriatchev
Here is a kind of example: plot(density(rnorm(1000))) text(c(2,2),c(0.2,0.21),labels=c(Skewness,Kurtosis), pos=4, cex=0.7) text(c(3,3),c(0.2, 0.21), labels=c(1.1, 2.2), pos=4, cex=0.7) There is a function in some library that produces text boxes (with borders) that can be placed inside a plot.

Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread Petr PIKAL
Hi I tried but describe(c(5,3,76,4/0)) Error: could not find function describe What shall I do? Quick search did not find function on CRAN and I do not have enough time to dig it from somewhere. Regards Petr r-help-boun...@r-project.org napsal dne 21.09.2009 12:06:09: Hi, I have to

Re: [R] Putting a text box in a plot

2009-09-21 Thread Gabor Grothendieck
Try this: plot(1:10) A - 1; B - 2 legend(topleft, leg = paste(c(A, B), c(A, B), sep = =)) or RSiteSearch(text box) RSiteSearch(text plot) On Mon, Sep 21, 2009 at 5:42 AM, Sergey Goriatchev serg...@gmail.com wrote: Hello everyone, I have a plot and I want to but a (formatted) box containing

[R] Specific criteria for color palette using heatmap.2

2009-09-21 Thread bioinformatics_guy
I'm trying to display the probability space of a function and wanted to see specifically where the maximum posterior probability is. data=read.table(PosteriorData,header=F) mat=as.matrix(data) heatmap.2(mat/max(mat,na.rm=T),dendrogram=c(none),trace=c(none),

Re: [R] R on browser

2009-09-21 Thread Elio Mineo
Try demo in http://dssm.unipa.it/R-php/ We have to fix a bug on the plots, but other things work. Bye, Elio Mineo Il giorno dom, 20/09/2009 alle 22.11 -0700, vinay basavanal ha scritto: want i meant was there is Rweb (web interface) http://bayes.math.montana.edu/Rweb/Rweb.general.html where

[R] Printing column names before each block of output

2009-09-21 Thread A Singh
Dear All, I need to print the column names of variables before each block of output, for a nested model with 2 levels (3 phenotypes * 10 markers). This is so that my output is labeled, and I know which combination of factors produces which set of REML estimates. Currently my output looks

[R] compute differences

2009-09-21 Thread alessandro carletti
Hi, I have a problem. I have a data frame looking like: ID val A  .3 B  1.2 C  3.4 D  2.2 E  2.0 I need to CREATE the following TABLE: CASE   DIFF A-A    0 A-B    -0.9 A-C    -3.1 A-D    -1.9 A-E    -1.7 B-A    ... B-B    ... B-C B-D B-E C-A C-B C-C C-D C-E D-A D-B D-C D-D D-E E-A E-B E-C E-D

Re: [R] Specific criteria for color palette using heatmap.2

2009-09-21 Thread Schalk Heunis
I think this is what you want, using the volcano dataset as an example: data(volcano) heatmap.2(volcano / max(volcano), col=c(heat.colors(16)[1:15],black)) Basically, setting the last color to be black. If you want better control over exactly what range should be black, you can set the breaks

Re: [R] compute differences

2009-09-21 Thread Henrique Dallazuanna
Try this: data.frame(ID = apply(expand.grid(x$ID, x$ID), 1, paste, collapse = '-'), diff = c(outer(x$val, x$val, '-'))) On Mon, Sep 21, 2009 at 9:39 AM, alessandro carletti alxmil...@yahoo.it wrote: Hi, I have a problem. I have a data frame looking like: ID val A  .3 B  1.2 C  3.4 D 

Re: [R] compute differences

2009-09-21 Thread Julian Burgos
Here is an approach...probably there are more elegant ways mydata=data.frame(ID=c(A,B,C,D,E),val=c(.3,1.2,3.4,2.2,2.0)) index=expand.grid(1:nrow(mydata),1:nrow(mydata)) dif=data.frame(difference=mydata$val[index$Var2]-mydata$val[index$Var1])

Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread johannes rara
This is probably a describe function from Hmisc-package. 2009/9/21 Petr PIKAL petr.pi...@precheza.cz: Hi I tried but describe(c(5,3,76,4/0)) Error: could not find function describe What shall I do? Quick search did not find function on CRAN and I do not have enough time to dig it from

[R] Four concurrent Markov chains

2009-09-21 Thread drlucyasher
Hi, I am trying to write a simulation of the movements of four animals between six patches. The movement between patches is based on a first-order Markov chain so that the next patch they visit depends on the patch they were in before. I have written code that allows me to simulate the movement

Re: [R] R on browser

2009-09-21 Thread niketya
Try http://www.sagemath.org/ You may have to register though. vinay basavanal wrote: Hi i can get sites that can r code on browser -- View this message in context: http://www.nabble.com/R-on-browser-tp25508719p25530291.html Sent from the R help mailing list archive at Nabble.com.

[R] How to handle missing values for the GeneMeta package?

2009-09-21 Thread Vassilis Golfinopoulos
Hello all, It seems that the GeneMeta passage returns NA in the respective row if any gene in the data sets to be synthesised are missing. Do you know of a way to overcome this problem? I tried using the 'impute' package to fill-in the missing values, but R crashes if 'impute' and 'GeneMeta'

[R] R crashes when packages 'impute' and 'GeneMeta' are used together.

2009-09-21 Thread Vassilis Golfinopoulos
Well, the title says all for this one. It seems to crash the R-console, so it happens whether I use the R-gui or R-console directly or Emacs with ESS. I have R 2.9.0 on Windows Vista. Thanks, Vassilis __ R-help@r-project.org mailing list

Re: [R] Four concurrent Markov chains

2009-09-21 Thread Rainer M Krug
A few comments below On Mon, Sep 21, 2009 at 3:10 PM, drlucyasher las...@rvc.ac.uk wrote: Hi, I am trying to write a simulation of the movements of four animals between six patches. The movement between patches is based on a first-order Markov chain so that the next patch they visit

[R] Printing column names before each block of output (fwd)

2009-09-21 Thread A Singh
Dear All, I need to print the column names of variables before each block of output, for a nested model with 2 levels (3 phenotypes * 10 markers). This is so that my output is labeled, and I know which combination of factors produces which set of REML estimates. Currently my output looks like

Re: [R] How to handle missing values for the GeneMeta package?

2009-09-21 Thread Martin Morgan
Hi Vassilis -- Vassilis Golfinopoulos wrote: Hello all, It seems that the GeneMeta passage returns NA in the respective row if any gene in the data sets to be synthesised are missing. Do you know of a way to overcome this problem? I tried using the 'impute' package to fill-in the missing

[R] Nested test

2009-09-21 Thread chatcrawler
Dear R users. I am analysing a parasite-host dataset which consists of the following samples collected from wild fish: 2 locations with 7 and 8 fish hosts each in which I retrieved and measured (length, weight, length/weight, pairwise relatedness) unequal and rather small (5-30) numbers of

Re: [R] Handling missing data

2009-09-21 Thread Greg Snow
Help us to help you, show us the code that you tried, what you expected, and what you saw. Does using NA condition mean: x == NA Which does not work Or is.na(x) Which should. -Original Message- From: premmad mtechp...@gmail.com To: r-help@r-project.org r-help@r-project.org Sent:

[R] Create directory and copy files in R

2009-09-21 Thread Tammy Ma
HI, All R users, My problem is: fn [1] C:/Documents and Settings/lma/Desktop/FamilyAEntrepreneurs/Entrepreneurs/Juha/book_log-20041210T095019.txt dpath [1] C:/Documents and Settings/lma/My Documents/Juha/book I want to make a function cyfun to copy all files in dir to deskdir but I

Re: [R] Handling missing data

2009-09-21 Thread Vassilis Golfinopoulos
Consider this sample dataset (displayed [1:3, 1:3]): T1053B T1102A T1129A AKT1 -0.02412174 0.1986057 NA AURKA -0.37109748 -0.4418542 0.04967051 BRAF -0.14589269 -0.1590310 -0.35483226 is.na(dataset[1, 3]) TRUE library(impute) library(GeneMeta) imputed.dataset -

[R] spplot and cex

2009-09-21 Thread Roberto Brunelli
Dear community, I'm using R 2.6.1 on a GNU/Linux Slackware box. I would like to obtain larger text when using spplot (from sp 0.9-43) using spplot(... cex=2) but I get no visible effect. Any help? Thanks, __ R-help@r-project.org mailing list

Re: [R] Create directory and copy files in R

2009-09-21 Thread Don MacQueen
In your file.copy() command you have deskfile, but deskfile does not appear anywhere else. Perhaps you meant deskdir? After the error occurs, type traceback() and try to discern exactly where things went wrong. -Don At 5:05 PM +0300 9/21/09, Tammy Ma wrote: Content-Type: text/plain

[R] plotmath

2009-09-21 Thread Jarrod Hadfield
Hi, I want to have a legend that is a mixture of numbers and symbols, and have found no way of achieving this. For example, if I want theta=x or theta=2 this is easily achieved. plot(0, xlab=expression(paste(theta, = x))) plot(0, xlab=expression(paste(theta, = 2))) However, if x is some

Re: [R] Four concurrent Markov chains

2009-09-21 Thread drlucyasher
Oh dear! Yes I see now that when I update j to i then this won't work... but I'm now stuck trying to think of a way round this. I've tried moving all script to before the i- j command and leaving it out all together but neither work. Any ideas? -- View this message in context:

Re: [R] Combine vectors in order to form matrixes with combn

2009-09-21 Thread Bryan Keller
Moreno, I don't understand exactly what it is you are trying to do. Can you explain what you want your matrices to look like? Perhaps give an example. Bryan - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of

[R] Three dimensional view of the profiles using 'rgl' package (example of 3 dimensional graphics using rgl package).

2009-09-21 Thread Ana Kolar
Hi there, Anyone has an idea how to put those two sets of code together so that I can get a 3-dimensional picture that includes points instead of 2 separate pictures which doesnt make that much sense at the end. #Let's say that these are the data we would like to plot: A-c(62,84,53)

Re: [R] Three dimensional view of the profiles using 'rgl' package (example of 3 dimensional graphics using rgl package).

2009-09-21 Thread Schalk Heunis
Ana Not sure if I understood your problem, but on my side, the lines and points are both on the same 3-d picture. However, the lines are just very small: by setting data = data/100, the lines and points are both visible. HTH Schalk Heunis On Mon, Sep 21, 2009 at 4:38 PM, Ana Kolar

Re: [R] plotmath

2009-09-21 Thread baptiste auguie
plot(0, xlab=bquote(theta * = * .(x))) ?substitute ?bquote HTH, baptiste 2009/9/21 Jarrod Hadfield j.hadfi...@ed.ac.uk: Hi, I want to have a legend that is a mixture of numbers and symbols, and have found no way of achieving this. For example, if I want theta=x or theta=2 this is easily

Re: [R] Three dimensional view of the profiles using 'rgl' package (example of 3 dimensional graphics using rgl package).

2009-09-21 Thread Ana Kolar
Ha. You understood my question perfectly ok and thank you for your answer. Haven't thought that this might be the case, and it is, indeed! Regards, Ana From: Schalk Heunis schalk.heu...@gmail.com Cc: R r-help@r-project.org Sent: Monday, September 21, 2009

Re: [R] spplot and cex

2009-09-21 Thread Ben Bolker
Roberto Brunelli roby.brunelli at gmail.com writes: Dear community, I'm using R 2.6.1 on a GNU/Linux Slackware box. I would like to obtain larger text when using spplot (from sp 0.9-43) using spplot(... cex=2) but I get no visible effect. Any help? We need a reproducible

Re: [R] R crashes when packages 'impute' and 'GeneMeta' are used together.

2009-09-21 Thread hadley wickham
Well, the title says all for this one. Not really. What do you mean by crash? What do you mean by used together? Hadley -- http://had.co.nz/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Pattern Matching within Vector?

2009-09-21 Thread Anne-Marie Ternes
Dear mailing list, I'm stuck with a tricky problem here - at least it seems tricky to me, being not really talented in pattern matching and regex matters. I'm analysing amino acid mutations by position and type of mutation. E.g. (fictitious example) in position 92, I can find L92V, L92MV,

Re: [R] Combine vectors in order to form matrixes with combn

2009-09-21 Thread Moreno Mancosu
Moreno, I don't understand exactly what it is you are trying to do. Can you explain what you want your matrices to look like? Perhaps give an example. Bryan Dear Bryan, let's try with an example: i have 8 column vectors v1-matrix(c(2,5,6,8)) v2-matrix(c(3,7,9,11))

Re: [R] R crashes when packages 'impute' and 'GeneMeta' are used together.

2009-09-21 Thread Duncan Murdoch
On 9/21/2009 9:18 AM, Vassilis Golfinopoulos wrote: Well, the title says all for this one. It seems to crash the R-console, so it happens whether I use the R-gui or R-console directly or Emacs with ESS. Not for me. (But as Hadley said, you didn't explain what you needed to do to trigger the

[R] Basic function output/scope question

2009-09-21 Thread David Young
Hello Group, I'm trying to learn R and am having a problem getting output from a function I'm trying to write. The problem is clearly one of scope, but I can't find the documentation that tells me how to get around the issue. Here is an example of my problem. testfunc-function(x) { y-10

Re: [R] Basic function output/scope question

2009-09-21 Thread Schalk Heunis
Don't know SAS, but you can use y-10 to make the answer available in the global environement. See ?'-' To define the output see ?return Schalk Heunis On Mon, Sep 21, 2009 at 5:29 PM, David Young dyo...@telefonica.net wrote: Hello Group, I'm trying to learn R and am having a problem getting

Re: [R] Basic function output/scope question

2009-09-21 Thread Erik Iverson
Hello, testfunc-function(x) { y-10 print(y) print(x) } testfunc(4) The variables x and y are accessible during execution of the function testfunc but not afterwards. In R, expressions return values. When you define a function, ?function says that, If the end of a function is

Re: [R] Basic function output/scope question

2009-09-21 Thread David Winsemius
On Sep 21, 2009, at 11:29 AM, David Young wrote: Hello Group, I'm trying to learn R and am having a problem getting output from a function I'm trying to write. The problem is clearly one of scope, but I can't find the documentation that tells me how to get around the issue. Here is an

Re: [R] Basic function output/scope question

2009-09-21 Thread Erik Iverson
I see you've already been told about -. The reason I (and presumably others?) stay away from that construct is that your function then has side effects that a user (even yourself) may not anticipate or want, namely possibly overwriting a previous variable in your global environment. The help

[R] Executing R scripts from another R script

2009-09-21 Thread Sergey Goriatchev
Hello, everyone I run Eclipse Ganymede and R 2.7.2 at work. I have one R script file where I open in memory a new xls file (using xlsReadWritePro), call other R scripts, which are in the same folder as the main R script, which get data from an existing xls file, process data, and output results

Re: [R] Executing R scripts from another R script

2009-09-21 Thread Sergey Goriatchev
Sorry everyone Disregard this email. I found the problem. I have xlsReadWritePro loaded automatically at start of R. Then I load package gplots, which also loads gdata gdata masks function read.xls() from xlsReadWritePro and that causes all the problems. Regards, Sergey On Mon, Sep 21, 2009 at

Re: [R] Executing R scripts from another R script

2009-09-21 Thread David Winsemius
On Sep 21, 2009, at 11:52 AM, Sergey Goriatchev wrote: Hello, everyone I run Eclipse Ganymede and R 2.7.2 at work. I have one R script file where I open in memory a new xls file (using xlsReadWritePro), call other R scripts, which are in the same folder as the main R script, which get data

Re: [R] Pattern Matching within Vector?

2009-09-21 Thread Charlie Sharpsteen
On Mon, Sep 21, 2009 at 8:07 AM, Anne-Marie Ternes amter...@gmail.comwrote: Dear mailing list, I'm stuck with a tricky problem here - at least it seems tricky to me, being not really talented in pattern matching and regex matters. I'm analysing amino acid mutations by position and type of

Re: [R] Combine vectors in order to form matrixes with combn

2009-09-21 Thread Phil Spector
Moreno - While it's possible to do what you want with 8 individual vectors, the problem is much easier to solve if you combine them into a list: v = list(c(2,5,6,8),c(3,7,9,11),c(13,4,2,7), c(3.4,6,11,21),c(1,9,45,3),c(2,76,4,2), c(34,7,8,1),c(2,6,1,9)) combs =

[R] Nested test

2009-09-21 Thread chatcrawler
Dear R users. I am analysing a parasite-host dataset which consists of the following samples collected from wild fish: 2 locations with 7 and 8 fish hosts, respectively, in which I retrieved and measured (length, weight, length/weight, pairwise relatedness) unequal and rather small (5-30)

[R] How to use nls when [selfStart] function returns NA or Inf??

2009-09-21 Thread Keith Jewell
Hi Everyone, I posted this a couple of weeks ago with no responses. My interface (via gmane) seemed a bit flakey at the time, so I'm venturing to repost with some additional information. I'm trying to write selfStart non-linear models for use with nls. In these models some combinations of

[R] Error in make.names when trying to read.table in if statement

2009-09-21 Thread Cynthia Sadler
Hi, I'm trying to read data from a collection of CSV files for processing and graphing. All of my files begin with modrate and end with .csv. I think I have the regex working but I am stumped at trying to get read.table to work within an if statement. This works: filepattern=modrate*

Re: [R] How to use nls when [selfStart] function returns NA or Inf??

2009-09-21 Thread Gabor Grothendieck
With a small number of parameters just use brute force on grid to calculate starting values. See nls2 package. On Mon, Sep 21, 2009 at 12:17 PM, Keith Jewell k.jew...@campden.co.uk wrote: Hi Everyone, I posted this a couple of weeks ago with no responses. My interface (via gmane) seemed a

[R] DF-GLS optimal lags

2009-09-21 Thread Karla hernández
I want to used the funtion ur.ers (DF-GLS unit root test) from the urca packet, but there is not a test which give me the optimal lags in the posibilities of the packet. I am interested in know if there is a program to calculed this optimal lag, or if someone know which one is the maximal

Re: [R] how to count occurrences of string?

2009-09-21 Thread Stefan Th. Gries
This should do what you want: set.seed(1) # cerating a vector with comments, in which d's will be counted comments-character(25) for (i in 1:25) { comments[i] - paste(sample(letters[1:10], 10, replace=T), collapse=) } # creating a vector to cross -tabulate age -sample(c(old, young), 25,

Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread Peter Ehlers
Werner, Thanks for sending the data. The problem does seem to lie with describe() in pkg:Hmisc. Frank may want to know that it can be triggered by f - function(n)describe(c(1:n,1/0)) f(18) #ok f(19) #triggers the error Perhaps it's related to the at least 20 unique values condition

[R] Problem in Installing packages in R 2.9.2

2009-09-21 Thread mohsin ali
Hi Sir When I use install.packages(cvt') for installing packages using R 2.9.2 I have the following problem install.packages(ctv) Warning in install.packages(ctv) : argument 'lib' is missing: using 'C:\Users\Amina\Documents/R/win-library/2.9' --- Please select a CRAN mirror for use in

Re: [R] Problem in Installing packages in R 2.9.2

2009-09-21 Thread Gabor Grothendieck
The first warning is just telling you which library its going to use. Unless you didn't want to use that library its of no concern. The second warning is a permissions problem with updating the help files. Try running R as Administrator (or install R into your user area). On Mon, Sep 21, 2009

Re: [R] plotmath

2009-09-21 Thread Uwe Ligges
baptiste auguie wrote: plot(0, xlab=bquote(theta * = * .(x))) or probably easier use == as in plot(0, xlab=bquote(theta == .(x))) Uwe Ligges ?substitute ?bquote HTH, baptiste 2009/9/21 Jarrod Hadfield j.hadfi...@ed.ac.uk: Hi, I want to have a legend that is a mixture of numbers and

Re: [R] truth (karnaugh) table

2009-09-21 Thread Henrique Dallazuanna
Try this: do.call(expand.grid, rep(list(0:1), 4)) On Mon, Sep 21, 2009 at 2:04 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Dear list, I think I'm being dense, but I can't get combn or expand.grid to give me this result. I need to generate a matrix of all 16 possible sequences

Re: [R] Handling missing data

2009-09-21 Thread Martin Morgan
Vassilis Golfinopoulos wrote: Consider this sample dataset (displayed [1:3, 1:3]): T1053B T1102A T1129A AKT1 -0.02412174 0.1986057 NA AURKA -0.37109748 -0.4418542 0.04967051 BRAF -0.14589269 -0.1590310 -0.35483226 is.na(dataset[1, 3]) TRUE

[R] truth (karnaugh) table

2009-09-21 Thread baptiste auguie
Dear list, I think I'm being dense, but I can't get combn or expand.grid to give me this result. I need to generate a matrix of all 16 possible sequences of 4 boolean elements, 0001 0010 0011 0100 . (in the end I'll have to assign NA to the 0s and some value to the 1s but let's

Re: [R] truth (karnaugh) table

2009-09-21 Thread baptiste auguie
I knew I was missing the obvious. And to think it's only Monday... Thanks everyone! baptiste 2009/9/21 Henrique Dallazuanna www...@gmail.com: Try this: do.call(expand.grid, rep(list(0:1), 4)) On Mon, Sep 21, 2009 at 2:04 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Dear

Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Ehlers Sent: Monday, September 21, 2009 9:29 AM To: Werner Wernersen Cc: r-h...@stat.math.ethz.ch Subject: Re: [R] weird vector size cannot be NA/NaN problem Werner,

Re: [R] RODBC : using and passing queries that use in some arguments

2009-09-21 Thread BOISSON, Pascal
Dear R users, I am trying to connect R to data that is in a Access Database but I have problem with the construction of queries using special characters. I am using RODBC package. The following is working : MyQuery-paste(SELECT first( (DateHeure) ) , avg(NNO3_AT322_OUT_moy) AS Cond FROM

[R] Regarding information on writing R scripts

2009-09-21 Thread Manuj Sharma
I need to run a set of R commands in batch mode. Can somebody please provide pointers to information on how to write R scripts to execute commands in batch mode? Thanks, Manuj Try the new Yahoo! India Homepage. Click here. http://in.yahoo.com/trynew [[alternative HTML version

[R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Dimitri Liakhovitski
Hello, dear R-ers! I built a data frame grid (below) with 4 columns. I want to exclude all rows that have equal values in ANY 2 columns. Here is how I am doing it: index-expand.grid(1:4,1:4,1:4,1:4) dim(index) # Deleting rows that have identical values in any two columns (1 line of code):

[R] missing level of a nested factor results in an NA in lm output

2009-09-21 Thread Timothy Clough
Dear All, I have posted to this list before regarding the same issue so I apologize for the multiple e-mails. I am still struggling with this issue so I thought I'd give it another try. This time I have included reproducible code and a subset of the data I am analyzing. I am running an

Re: [R] weird vector size cannot be NA/NaN problem

2009-09-21 Thread Peter Ehlers
Good spot Bill, and the error message comes from tabulate(). Peter Ehlers William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Ehlers Sent: Monday, September 21, 2009 9:29 AM To: Werner Wernersen Cc:

Re: [R] missing level of a nested factor results in an NA in lm output

2009-09-21 Thread Erik Iverson
estimable(fit, myEstimate) Estimate Std. Error t value DF Pr(|t|) test 12.18198 0.6694812 18.19615 10 5.395944e-09 Where are you getting this estimable function from? A package? Did you define it yourself? __ R-help@r-project.org

Re: [R] missing level of a nested factor results in an NA in lm output

2009-09-21 Thread Timothy Clough
I should have specified this before - it's part of the gmodels library. On Sep 21, 2009, at 2:31 PM, Erik Iverson wrote: estimable(fit, myEstimate) Estimate Std. Error t value DF Pr(|t|) test 12.18198 0.6694812 18.19615 10 5.395944e-09 Where are you getting this estimable function

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Dimitris Rizopoulos
one way is the following: index - expand.grid(1:4, 1:4, 1:4, 1:4) mat - data.matrix(index) keep - apply(mat, 1, function (x, d) length(unique(x)) == d, d = ncol(mat)) index[keep, ] I hope it helps. Best, Dimitris Dimitri Liakhovitski wrote: Hello, dear R-ers! I built a data frame

[R] logarithmic seq() ?

2009-09-21 Thread Oliver Bandel
Hello, in scilab /Matlab there are functions that can create linear sequences (like R's seq()) as well as logarithmic sequences. Is there a logarithmic aequivalent of seq()? Or maybe this would be an idea for newer R-releases, maybe a type-option with linear and logarithmic as parameters?!

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Erik Iverson
Hello, Do you mean exactly any 2 columns. What if the value is equal in more than 2 columns? I built a data frame grid (below) with 4 columns. I want to exclude all rows that have equal values in ANY 2 columns. Here is how I am doing it: index-expand.grid(1:4,1:4,1:4,1:4) If a value

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Dimitri Liakhovitski
Thank you very much, both Dimitris and Erik. Erik - you are right, I was trying to remove any duplication (i.e., if there are the same values in 2 or 3 or 4 columns). And it looks like that's what your solution does. But doesn't it do the same thing as Dimitris' solution? Dimitri On Mon, Sep 21,

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Erik Iverson
It probably does... I did not look at his until just now, my guess is they are equivalent. There are usually at least a couple ways to do things in R, no problem :). With massive datasets, it might make sense to try a couple different ways to see if one or the other is faster though. You

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread David Winsemius
On Sep 21, 2009, at 2:14 PM, Dimitri Liakhovitski wrote: Hello, dear R-ers! I built a data frame grid (below) with 4 columns. I want to exclude all rows that have equal values in ANY 2 columns. Here is how I am doing it: index-expand.grid(1:4,1:4,1:4,1:4) dim(index) # Deleting rows that have

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Erik Iverson
You could also replace !duplicated in my function with unique ... It turns out you can't, of course :). __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Jorge Ivan Velez
Hi Dimitri, Try also either index[apply(index, 1, function( x ) length( unique( x ) ) == 4 ),] or # install.packages('e1071') require(e1071) permutations(4) HTH, Jorge On Mon, Sep 21, 2009 at 2:14 PM, Dimitri Liakhovitski wrote: Hello, dear R-ers! I built a data frame grid (below) with

Re: [R] More elegant way of excluding rows with equal values in any 2 columns?

2009-09-21 Thread Dimitri Liakhovitski
Thanks a lot everyone - it's been extremely helpful! Dimitri On Mon, Sep 21, 2009 at 3:16 PM, Jorge Ivan Velez jorgeivanve...@gmail.com wrote: Hi Dimitri, Try also either index[apply(index, 1, function( x ) length( unique( x ) ) == 4 ),] or # install.packages('e1071') require(e1071)

  1   2   >