Re: [R] Problem with parsing a dataset - help earnestly sought

2010-04-22 Thread Jan van der Laan
Something like this? # Remove everything after ; to give the status status<- sub(';.*$', '', data$cancer.problems) # Remove everything before the last ; to give tissue # In case a no ; in the string this goes wrong; correct tissue<- sub('^.*;[ \n]*', '', data$cancer.problems) tissue[! gre

Re: [R] Why does 'apply(.., 1, .., ..)' transpose result

2010-04-22 Thread Charles C. Berry
On Fri, 23 Apr 2010, Worik R wrote: I am sorry if this is documented in apply's dcumentation or completely obvious, I could not find or work it out. Well, try ?apply and focus on the 'Value:' section, first para. To me, that behavior seems consistent with other functions in the [ts

Re: [R] Unable to make bitmapdll files on windows 7 64 bit machine

2010-04-22 Thread Prof Brian Ripley
On Thu, 22 Apr 2010, arnhol...@appstate.edu wrote: I am trying to build a windows 32 bit version of R 2.11.0 from source on a machine running windows 7 - 64 bit while running as the machine's administrator. I am able to run "make all recommended"...However, once I attempt to build the bitmap f

[R] A distance measure between top-k list

2010-04-22 Thread sayan dasgupta
Hi folks, Here is the problem. I am giving an example .I want to find a measure of similarity or dissimilarity among ranking (of students of a same class of size say 50)by two judges. But instead of observing the rank of all the 50 students (Where we could have used rank correlation measures)in eac

Re: [R] transpose? reshape? flipping? challenge with data frame

2010-04-22 Thread David.Gobbett
Fabulous! I managed to get close with t(), but had obviously missed the step of setting the rownames first. Thanks for your help! David -Original Message- From: Ista Zahn [mailto:istaz...@gmail.com] Sent: Friday, 23 April 2010 2:29 PM To: Gobbett, David (CSE, Waite Campus) Cc: r-help@r

Re: [R] transpose? reshape? flipping? challenge with data frame

2010-04-22 Thread Ista Zahn
Hi David, There are many ways, including rownames(propsum) <- propsum$coverClass propsum$coverClass <- NULL t(propsum) Best, Ista On Fri, Apr 23, 2010 at 5:43 AM, wrote: > Greetings all, > > I am having difficulty transposing, reshaping, flipping (not sure which) a > data frame which is read

[R] transpose? reshape? flipping? challenge with data frame

2010-04-22 Thread David.Gobbett
Greetings all, I am having difficulty transposing, reshaping, flipping (not sure which) a data frame which is read from a DBF file. I have tried using t(), reshape() and other approaches without success. Can anyone please suggest an way (elegant or not) of flipping this data around ? The init

Re: [R] macro variable in R?

2010-04-22 Thread karena
Thank you all for the great help... I appreciate! -- View this message in context: http://r.789695.n4.nabble.com/macro-variable-in-R-tp2020772p2023108.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
Thank you! Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-in-R-tp2018822p2022832.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

[R] BACI analysis

2010-04-22 Thread Barry Noon
I need help in developing the R syntax for a before-after control intervention design (BACI). Each cell of the 2-way table has multiple replicates-i.e., each replicate, in both the treatment and control groups, is measured both before and after the treatment period. I am having trouble in specif

Re: [R] glmer with non integer weights

2010-04-22 Thread Emmanuel Charpentier
Sorry for this late answer (I've had a seriously nonmaskable interrupt). Since I have technical questions not related to R, I take the liberty to follow this up by e-mail. I might post a followup summary if another R problem arises... Emmanuel Charpentier

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
Abhishek: Thank you! Thomas: that worked out well, thank you again! I also tried to use lm, and as expected in this case, I almost got the same estimates of the parameters as in the MLE-case. Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-L

Re: [R] R loop.

2010-04-22 Thread mhalsham
Ok sorry for bad explanation from my side What I want. I have a txt file name is (table3.txt) this file contains 1293 rows and some of these row will have 1 column and some of them will have up to may be 40 column. For example

Re: [R] Maximum Likelihood Estimation in R

2010-04-22 Thread Henkep
that worked out well, thank you again! I also tried to use lm, and as expected in this case, I almost got the same estimates of the parameters as in the MLE-case. Best Regards Henrik -- View this message in context: http://r.789695.n4.nabble.com/Maximum-Likelihood-Estimation-in-R-tp201882

[R] Can merge function pick up mismatch part of two data set?

2010-04-22 Thread alex46015
SAS can merge two data set A, B in different way, A or B, A and B, A not B, Can R merge function do the same way? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Can-merge-function-pick-up-mismatch-part-of-two-data-set-tp2021024p2021024.html Sent from the R help mailing

[R] Unable to make bitmapdll files on windows 7 64 bit machine

2010-04-22 Thread arnholtat
I am trying to build a windows 32 bit version of R 2.11.0 from source on a machine running windows 7 - 64 bit while running as the machine's administrator. I am able to run "make all recommended"...However, once I attempt to build the bitmap files I get the following: C:\Rsource\R-2.11.0\src\gn

[R] Problem with parsing a dataset - help earnestly sought

2010-04-22 Thread Min-Han Tan
Dear fellow R-help members, I hope to seek your advice on how to parse/manage a dataset with hundreds of columns. Two examples of these columns, 'cancer.problems', and 'neuro.problems' are depicted below. Essentially, I need to parse this into a useful dataset, and unfortunately, I am not familiar

[R] help with plotting lines linking two sets of points?

2010-04-22 Thread Kristiina Hurme
Hello everyone, I'm trying to plot the initial and final size of some tadpoles and look at their growth rates (slope of line). They are divided into 6 densities, and so far I have plotted the initial and final sizes (these are means for a pool), and color coded for the 6 densities, but I want a l

Re: [R] Practical work with logistic regression

2010-04-22 Thread Frank E Harrell Jr
Claus O'Rourke wrote: Dear all, I have a couple of short noob questions for whoever can take them. I'm from a very non-stats background so sorry for offending anybody with stupid questions ! :-) I have been using logistic regression care of glm to analyse a binary dependent variable against a c

[R] packages gdata / gtools - installation in R 2.11.0

2010-04-22 Thread Paulo Barata
Dear R-list members, I have just downloaded R version 2.11.0. Then I installed package gdata. At the end of the installation, a warning message said that package gtools could not be found. Package gdata was, after the installation, included in the "Package Index" in the help files. Messages duri

Re: [R] time difference

2010-04-22 Thread Carol Gao
thank you! this really helps! On Thu, Apr 22, 2010 at 7:00 PM, jim holtman wrote: > ?strptime > > Read the documentation and you will find reference to "%OSn" > > > x <- strptime('13:45:34.123', format="%H:%M:%OS") > > x > [1] "2010-04-22 13:45:34" > > format(x, format="%H:%M:%OS3") > [1] "13:45

Re: [R] User inputs

2010-04-22 Thread chrisli1223
Thank you very much Dieter and Don. This solves my problem. :) -- View this message in context: http://r.789695.n4.nabble.com/User-inputs-tp2018251p2023067.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing l

Re: [R] Practical work with logistic regression

2010-04-22 Thread Gabor Grothendieck
confusionMatrix in the caret package can be used to replace your manual procedure. You could try using RWeka, the R interface to the java Weka software. Once you have it working you could then directly interface your java program to Weka without involving R. On Thu, Apr 22, 2010 at 9:29 PM, Claus

[R] Remove duplicated rows

2010-04-22 Thread chrisli1223
Hi all, I have a dataset similar to the following NameDateValue A 1/01/2000 4 A 2/01/2000 4 A 3/01/2000 5 A 4/01/2000 4 A 5/01/2000 1 B 6/01/2000 2 B 7/01/2000 1 B 8/01/2000 1 I would like R

Re: [R] problem of R CMD check

2010-04-22 Thread rusers.sh
Hi , This maybe a bug. I checked my another package, the same problem occurred. See below for detailed information. ##check log## * using log directory 'D:/StatSoft/R/MyPackage/sbar.Rcheck' * using R version 2.10.1 (2009-12-14) * using session charset: ISO8859-1 * checking for file 'sbar/DESCRIPT

[R] Practical work with logistic regression

2010-04-22 Thread Claus O'Rourke
Dear all, I have a couple of short noob questions for whoever can take them. I'm from a very non-stats background so sorry for offending anybody with stupid questions ! :-) I have been using logistic regression care of glm to analyse a binary dependent variable against a couple of independent var

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Felix Andrews
You are plotting the entire lattice plot (including axes, margins etc) in the grid viewport. What you want to do is to call the panel function, panel.levelplot(), instead. However, why not just mm <- map('worldHires', plot = FALSE) levelplot(z~x+y,xyz, mm = mm, panel = function(..., mm) { pan

[R] cell-based high-throughput chemical compound screens package?

2010-04-22 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hi I'm looking for a package to perform quality control, normalization and analysis of high throughput cell-based chemical screens. I know that the cellHTS2 package provides this for siRNA screens. Does anybody know if something like what I'm looking for exists? Thank you! Gabriele Zoppoli,

Re: [R] how to reorder of groups and specify ylim for each row in lattice barchart

2010-04-22 Thread Peter Ehlers
On 2010-04-21 21:13, zhenjiang xu wrote: R experts, Is there anyway to reorder inside each group? In the following example, the bar of year 1932 is always plotted before the bar of year 1931, may I change the order inside each groups of bars? Do you mean a different order in different panels?

Re: [R] simple question

2010-04-22 Thread Carl Witthoft
Or use this handy-dandy function: smode<-function(x){ xtab<-table(x) modes<-xtab[max(xtab)==xtab] mag<-as.numeric(modes[1]) #in case mult. modes, this is safer themodes<-names(modes) mout<-list(themodes=themodes,modeval=mag) return(mout) }

[R] Why does 'apply(.., 1, .., ..)' transpose result

2010-04-22 Thread Worik R
I am sorry if this is documented in apply's dcumentation or completely obvious, I could not find or work it out. Given an matricies Q: 2x3, R:1x3 and S:1x2 apply(Q, 1, '-', R) is 3x2 and apply(Q, 2, '-', S) is 2x3 Why? cheers Worik > Q [,1] [,2] [,3] [1,]123 [2,] 10 11 1

[R] ROC curve in randomSurvivalForest

2010-04-22 Thread Nick Fankhauser
I'm using randomSurvivalForest to predict survival from a rather small sample. As it's not enough data to have training and validation set, I rely on the "Estimate of error rate" computed by the randomForest. If I understand the method correctly, it repeatedly partitions the data into varying t

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Felix Andrews
You don't have to use map() to draw the map. m <- map(..., plot = FALSE) xyplot(y ~ x, m, type = "l", aspect = "iso", par.settings = list(axis.line = list(col = "transparent"))) or inside a panel function, assuming appropriate scales: panel.xyplot(m$x, m$y, ...) On 23 April 2010 04:38, David

[R] How to insert gridlines in lattice density plot

2010-04-22 Thread Giles
Thank you Burt Gunter and David Winsemius, I confirmed David's comment. One must use type=c("p","g") in order to get both the grid and points. So, to use densityplot well, we must be quite aware of the options for panel.xyplot! Cordially, Giles Crane

Re: [R] How to insert gridlines in lattice density plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 4:52 PM, Bert Gunter wrote: " Must one compose a panel function?" Depending on what you want exactly, no. Add the argument type="g" to your call. (e.g. densityplot(~fallrates, groups = prepost,type="g",... ) See ?panel.xyplot and recall that lattice passes down argum

Re: [R] using which to select range of values

2010-04-22 Thread Greg Snow
Another solution (whether this is better/worse, prettier/uglier, etc./etc. is in the eye of the beholder): library(TeachingDemos) x0 <- rnorm(100) x0[ 0 %<% x0 %<% 1.5 ] Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.40

Re: [R] How to insert gridlines in lattice density plot

2010-04-22 Thread Bert Gunter
" Must one compose a panel function?" Depending on what you want exactly, no. Add the argument type="g" to your call. (e.g. densityplot(~fallrates, groups = prepost,type="g",... ) See ?panel.xyplot and recall that lattice passes down arguments that it does not know what to do with to the p

[R] legend problem

2010-04-22 Thread Nilza BARROS
Dear R users, I have been plotting several graphics in only one page. I intend to plot only one legend in each page. Since the graphics are inside a loop I have to do it automatically. The main problem is that inside the loop I work with differente types of variables, I mean , the range is differe

[R] How to insert gridlines in lattice density plot

2010-04-22 Thread Giles
Greetings. How can I insert gridlines in the following density plot call? Must one compose a panel function? 'data.frame': 46 obs. of 2 variables: $ fallrates: num 5.2 7.1 7.1 9.8 3.7 7.5 5 6.2 1.5 2.9 ... $ prepost : Factor w/ 2 levels "post","pre": 2 2 2 2 2 2 2 2 2 2 ... library(latt

Re: [R] Compare two data frames

2010-04-22 Thread Bert Gunter
Why does: nm <- intersect(names(d1),names(d2)) identical(d1[,nm], d2[,nm]) not do it? -- Bert Bert Gunter Nonclinical Biostatistics 467-7374 http://devo.gene.com/groups/devo/depts/ncb/home.shtml -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-proje

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Simon Goodman
Thanks for those pointers making some progress now The following will put the levelplot on to the map, but the not with the co-ordinates aligned... The level plot appears on a slightly larger scale compared to the underlying map. In both the map and levelplot, the coordinates are in lon, lat

Re: [R] Subject: R and S-Plus: Two programs separated by a common language?

2010-04-22 Thread John James
Paul Just as in your implied analogy there are significant differences beneath the surface between these programs despite superficial similarities. You will soon get frustrated trying to use both simultaneously as you will not be sure that the critical step you've discovered in one will wor

Re: [R] index ordering

2010-04-22 Thread Tal Galili
Ah. Close to what David suggested... Try: ?which.max Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English

Re: [R] R2.11.0 - rasterImage() and barplot fill-patterns

2010-04-22 Thread Paul Murrell
Hi On 23/04/2010 12:10 a.m., Tal Galili wrote: Hello Peter, Thank you, and the R core team, for the new release. I see that in R 2.11.0 there is now support for rendering of raster (bitmap) images through rasterImage(). I am wondering - can this be used to create a texture/fill-pattern for hi

Re: [R] Compare two data frames

2010-04-22 Thread Paul Murrell
Hi Sounds like the 'compare' package might do some of what you want. Paul On 23/04/2010 1:41 a.m., Doran, Harold wrote: I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1<- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2<- d1[, c('y'

Re: [R] index ordering

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 3:45 PM, tamas barjak wrote: Hi All! I have a problem that I do not know it how it is necessary to query an index belonging to a given value. I bit hard to tell without an example but suspect you want: ?which -- David Winsemius, MD West Hartford, CT ___

[R] index ordering

2010-04-22 Thread tamas barjak
Hi All! I have a problem that I do not know it how it is necessary to query an index belonging to a given value. Somebody would help? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listin

[R] What is the test statistics in perm.test

2010-04-22 Thread Xiang Gao
Hi, The permutation test for two samples in R is function perm.test(). I could not figure out what is the statistics it estimate and how many permutation it did in default? Thanks, [[alternative HTML version deleted]] __ R-help@r-project.org m

[R] mixed model with subject-specific variance structure

2010-04-22 Thread Jiang, Yonghua
Hi All, I built a mixed model with subject-specific variance structure in SAS and it works quite well. Now I intended to implement the same model in R using lme with "weights" option. Following is the SAS code and the corresponding R code: SAS: proc mixed data=source; class id trial group valen

Re: [R] read.table understands comment field and ignores text

2010-04-22 Thread Jack T.
Oh man, totally missed that one! Thanks so much for the reminder. -- View this message in context: http://r.789695.n4.nabble.com/read-table-understands-comment-field-and-ignores-text-tp2021036p2021055.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] read.table understands comment field and ignores text

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 3:05 PM, Jack T. wrote: Hi I'm trying to import a large csv file without quotes around each field. This creates some problems when there are "#" characters in certain strings as R understands its comment field and ignores the rest of the line. Here's an example: var1

Re: [R] read.table understands comment field and ignores text

2010-04-22 Thread Marc Schwartz
On Apr 22, 2010, at 2:05 PM, Jack T. wrote: > > Hi I'm trying to import a large csv file without quotes around each field. > This creates some problems when there are "#" characters in certain strings > as R understands its comment field and ignores the rest of the line. > > Here's an example:

[R] read.table understands comment field and ignores text

2010-04-22 Thread Jack T.
Hi I'm trying to import a large csv file without quotes around each field. This creates some problems when there are "#" characters in certain strings as R understands its comment field and ignores the rest of the line. Here's an example: var1, var2, var3, var4 one, two, three, four Use this

[R] R and S-Plus: Two programs separated by a common language?

2010-04-22 Thread Paul Miller
Hello Everyone,   My company purchased S-Plus before it was bought out by Tibco. My understanding is that we own version 7.0 outright.   So far, I've been learning in R but thought I might also try working in S-Plus. My understanding is that S-Plus has some useful extra features. Another potent

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 2:24 PM, Kevin Wright wrote: Mixing base/lattice graphics can be tricky, but is possible. http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf That could be quite useful in the future. Thanks for that. Also, did you look at Chapter 13 of the la

[R] Accessing outside data sources for stock data?

2010-04-22 Thread Brigid Mooney
Hi All, I apologize if this is not the right forum for this question. I know there used to be a package for R that connected to opentick's (open source) stock market data. However, opentick closed up about a year ago. Does anyone know of a similar package that connects to IQfeed's stock market

Re: [R] Multicolor main title in a plot or mtext

2010-04-22 Thread Kevin Wright
Perhaps this helps? http://blog.revolution-computing.com/2009/01/multicolor-text-in-r.html Kevin On Thu, Apr 22, 2010 at 11:18 AM, Ottorino-Luca Pantani < ottorino-luca.pant...@unifi.it> wrote: > Dear R-users, the problem I'm facing today is to write a > multicolor main title in a plot. > > I w

Re: [R] compare variables and take largest value?

2010-04-22 Thread Henrique Dallazuanna
Try this: apply(replace(v <- rbind(v1, v2, v3), is.nan(v), 0), 2, max) On Thu, Apr 22, 2010 at 12:24 PM, Vlatka Matkovic Puljic < v.matkovic.pul...@gmail.com> wrote: > Only thing that when I put na.rm=FALSE, > R is puting in v4 NA (as is largest) > and I want to see NA as zero (0, smallest val

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread Kevin Wright
Mixing base/lattice graphics can be tricky, but is possible. http://www.bioconductor.org/CRAN/web/packages/gridBase/vignettes/gridBase.pdf Also, did you look at Chapter 13 of the lattice book? http://lmdvr.r-forge.r-project.org/figures/figures.html Kevin On Wed, Apr 21, 2010 at 2:08 PM, David

Re: [R] simple question

2010-04-22 Thread Lee.Adams
Gabriele - How about this: > data<-c("A","A","A","B","B","C","D") > data [1] "A" "A" "A" "B" "B" "C" "D" > table(data) data A B C D 3 2 1 1 Thanks, Lee ". . . people who focus only on 'what is' will create more of 'what is.' People who focus mostly on 'what could be' will begin to create 'wh

Re: [R] Error in plotting non-linear regression

2010-04-22 Thread Muhammad Rahiz
It now works. Thanks both. Muhammad Peter Ehlers wrote: On 2010-04-22 11:09, Muhammad Rahiz wrote: Hello everyone, I'm trying to draw the non-linear regression curve to look at the distance decay relationship between distance and correlation values. But I'm not able to plot the curve a

Re: [R] simple question

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 1:36 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: Hi how can I find, in a vector of characters, which is the most frequent one? > a <- sample(letters[1:10], 100, replace=TRUE) > table(a) a a b c d e f g h i j 10 7 7 13 7 12 1 14 15 14 > max(table(a)) [1] 15

Re: [R] simple question

2010-04-22 Thread Muhammad Rahiz
Hi Gabriele, This is one way but I'm sure that there is an optimal way of doing so... x <- c("A","B","C","C","C","C","C","B","B") name <- unique(x) # get unique characters freq <- c() for (a in 1:length(name)){ freq[a] <- sum(x==name[a])}# get frequency out <- cbind(name,freq)

Re: [R] simple question

2010-04-22 Thread Joshua Wiley
Hello, What about test <- c(rep(c("A","C","G","T"), 20),"C") table(test) I am not sure that is an apt representation of the data and problem you are trying to solve. It also occurred to me that each character may not be its own element in the vector. If that is so, you would need to do somethi

Re: [R] Amusing coincidence

2010-04-22 Thread Marc Schwartz
On Apr 22, 2010, at 10:34 AM, Ted Harding wrote: > On 22-Apr-10 15:19:45, Barry Rowlingson wrote: >> On Thu, Apr 22, 2010 at 3:27 PM, peter dalgaard >> wrote: >>> ...that this Danish movie would have an official release today: >>> >>> http://www.imdb.com/title/tt1434443/ >> >> Does it have musi

Re: [R] Error in plotting non-linear regression

2010-04-22 Thread Peter Ehlers
On 2010-04-22 11:09, Muhammad Rahiz wrote: Hello everyone, I'm trying to draw the non-linear regression curve to look at the distance decay relationship between distance and correlation values. But I'm not able to plot the curve as I'm struggling with the following error ("parameters without sta

[R] simple question

2010-04-22 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hi how can I find, in a vector of characters, which is the most frequent one? Thanks Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest Researcher, LMP, NCI, NIH, Bethesda MD Work: 301-451-8575 Mobile: 301-204-5642 Em

Re: [R] R crashing oddly

2010-04-22 Thread Michael Steven Rooney
Hi Uwe, I downloaded R 2.11.0 and the latest version of nlme. I am still getting the problem. I should also note that I got a message from Viechtbauer Wolfgang saying that he had experienced a similar problem using nlme. I have pasted the code below. (The data is generated in the first ~15 lines)

Re: [R] macro variable in R?

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 12:24 PM, Steve Lianoglou wrote: Hi, On Thu, Apr 22, 2010 at 12:08 PM, karena wrote: I need to create 10 matrices. say matrix 1-10. matrix_1 is 1 by 1 matrix_2 is 2 by 2 matrix_3 is 3 by 3 . . . matrix_10 is 10 by 10 I am just wondering if there are some function

[R] Error in plotting non-linear regression

2010-04-22 Thread Muhammad Rahiz
Hello everyone, I'm trying to draw the non-linear regression curve to look at the distance decay relationship between distance and correlation values. But I'm not able to plot the curve as I'm struggling with the following error ("parameters without starting value in 'data': x") and found no

[R] Arima online forecasting

2010-04-22 Thread Matteo Bertini
I'd like to have an online horizon=k forecast with Arima, something like: library(forecast) air.model = Arima(AirPassengers[0:100], c(1,0,1), seasonal=list(order=c(0,1,1), period=12)) for(i in 0:(length(AirPassengers)-100)) { air.model2 = Arima(AirPassengers[0:(100+i)], model=air.model)

Re: [R] R loop.

2010-04-22 Thread jim holtman
You did not give a good description of your problem, or what you wanted as a solution (what is a 'button'), or a reasonable idea of what you data is. Here is one solution x <- read.table(textConnection("Deafness, EYA4, DIAPH1, MYO7A, TECTA, COL11A2, POU4F3, MYH9, ACTG1, MYO6"), as.is=TRUE, se

Re: [R] macro variable in R?

2010-04-22 Thread Steve Lianoglou
Hi, On Thu, Apr 22, 2010 at 12:08 PM, karena wrote: > > I need to create 10 matrices. say matrix 1-10. > > matrix_1 is 1 by 1 > matrix_2 is 2 by 2 > matrix_3 is 3 by 3 >   . >   . >   . > matrix_10 is 10 by 10 > > I am just wondering if there are some functions in R that are similar to the > macr

Re: [R] macro variable in R?

2010-04-22 Thread Benilton Carvalho
maybe for (i in 1:10) assign(paste("matrix", i, sep="_"), matrix(nrow=i, ncol=i)) suffices? On Thu, Apr 22, 2010 at 5:08 PM, karena wrote: > > I need to create 10 matrices. say matrix 1-10. > > matrix_1 is 1 by 1 > matrix_2 is 2 by 2 > matrix_3 is 3 by 3 >   . >   . >   . > matrix_10 is 10 by 1

Re: [R] macro variable in R?

2010-04-22 Thread Mario Valle
Why don't use a list? m <- list() for(i in 1:10) { m[[i]] <- matrix(NA, i, i) } then access them as m[[7]][1,6] Ciao! mario On 22-Apr-10 18:08, karena wrote: I need to create 10 matrices. say matrix 1-10. matrix_1 is 1 by 1 matrix_2 is 2 by 2 matrix_3 is 3 by 3 . .

[R] Multicolor main title in a plot or mtext

2010-04-22 Thread Ottorino-Luca Pantani
Dear R-users, the problem I'm facing today is to write a multicolor main title in a plot. I would like to have 3/4 colors to help people in the audience to visually realize what is what in a 4x2 plot array On top of each plot I would like to have two lines. The 1st line will indicate what is plo

[R] macro variable in R?

2010-04-22 Thread karena
I need to create 10 matrices. say matrix 1-10. matrix_1 is 1 by 1 matrix_2 is 2 by 2 matrix_3 is 3 by 3 . . . matrix_10 is 10 by 10 I am just wondering if there are some functions in R that are similar to the macro variables in SAS. so I can create these 10 matrices by doing: for (i in

Re: [R] using which to select range of values

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 11:21 AM, Muhammad Rahiz wrote: Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(100) x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") x2 <- which(x1=="t"

Re: [R] using which to select range of values

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 11:39 AM, Steve Lianoglou wrote: Hi, On Thu, Apr 22, 2010 at 11:21 AM, Muhammad Rahiz wrote: Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(

Re: [R] using which to select range of values

2010-04-22 Thread Steve Lianoglou
Hi, On Thu, Apr 22, 2010 at 11:21 AM, Muhammad Rahiz wrote: > Hi all, > > I would like to get the array index for a range of values, say  0 < x < 1.5. > I'm wondering if there is an alternative for the following which I've done > > x0 <- rnorm(100) > x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") > x2 <

Re: [R] Amusing coincidence

2010-04-22 Thread Ted Harding
On 22-Apr-10 15:19:45, Barry Rowlingson wrote: > On Thu, Apr 22, 2010 at 3:27 PM, peter dalgaard > wrote: >> ...that this Danish movie would have an official release today: >> >> http://www.imdb.com/title/tt1434443/ > > Does it have music by this composer: > > http://www.imdb.com/name/nm1731203

Re: [R] compare variables and take largest value?

2010-04-22 Thread Vlatka Matkovic Puljic
Only thing that when I put na.rm=FALSE, R is puting in v4 NA (as is largest) and I want to see NA as zero (0, smallest value) 2010/4/22 Vlatka Matkovic Puljic > Thanx a lot! That's it! > > 2010/4/22 Duncan Murdoch > > On 22/04/2010 11:07 AM, Vlatka Matkovic Puljic wrote: >> >>> Hi! >>> >>> I h

[R] using which to select range of values

2010-04-22 Thread Muhammad Rahiz
Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(100) x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") x2 <- which(x1=="t",arr.ind=TRUE) x0[x2] Thanks. -- Muhammad ___

Re: [R] compare variables and take largest value?

2010-04-22 Thread Vlatka Matkovic Puljic
Thanx a lot! That's it! 2010/4/22 Duncan Murdoch > On 22/04/2010 11:07 AM, Vlatka Matkovic Puljic wrote: > >> Hi! >> >> I have v1, v2 and v3 (data in v. ranges 1 to 4) >> >> v1 >> [1] 1 1 1 1 NaN 1 1 4 1 1 3 >> v2 >> [1] 1 1 1 1 1 1 1 1 1 1 1 >> v3 >

Re: [R] Amusing coincidence

2010-04-22 Thread Barry Rowlingson
On Thu, Apr 22, 2010 at 3:27 PM, peter dalgaard wrote: > ...that this Danish movie would have an official release today: > > http://www.imdb.com/title/tt1434443/ Does it have music by this composer: http://www.imdb.com/name/nm1731203/ and stills photography by: http://www.imdb.com/name/nm208

[R] cell-based high-throughput chemical compound screens package?

2010-04-22 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Hi I'm looking for a package to perform quality control, normalization and analysis of high throughput cell-base chemical screens. I know that the cellHTS2 package provides this for siRNA screens. Does anybody know if something like what I'm looking for exists? Thank you! Gabriele Zoppoli,

Re: [R] compare variables and take largest value?

2010-04-22 Thread Duncan Murdoch
On 22/04/2010 11:07 AM, Vlatka Matkovic Puljic wrote: Hi! I have v1, v2 and v3 (data in v. ranges 1 to 4) v1 [1] 1 1 1 1 NaN 1 1 4 1 1 3 v2 [1] 1 1 1 1 1 1 1 1 1 1 1 v3 [1] 1 1 1 1 1 1 1 1 1 1 1 I want R to compare entrie

[R] compare variables and take largest value?

2010-04-22 Thread Vlatka Matkovic Puljic
Hi! I have v1, v2 and v3 (data in v. ranges 1 to 4) v1 [1] 1 1 1 1 NaN 1 1 4 1 1 3 v2 [1] 1 1 1 1 1 1 1 1 1 1 1 v3 [1] 1 1 1 1 1 1 1 1 1 1 1 I want R to compare entries in v1,v2,v3 and in v4 to put largest value (NA=0). For

[R] Amusing coincidence

2010-04-22 Thread peter dalgaard
...that this Danish movie would have an official release today: http://www.imdb.com/title/tt1434443/ http://filmz.dk/film/r/trailers/24836 -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk

Re: [R] R loop.

2010-04-22 Thread mhalsham
Thanks a lot for the help, but it’s not what I needed. -- View this message in context: http://r.789695.n4.nabble.com/R-loop-tp1979620p2020386.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

Re: [R] Jonckheere-Terpstra test using coin package?

2010-04-22 Thread GlenB
I am unfamiliar with how to use coin, but it looks like it should be doable - the vignette in coin.pdf does a Page test. The wikipedia page for Page's test explains how this is related to the Jonckheere-Terpstra test, which seems to suggest if it can do one it should be able to do the other. Add t

Re: [R] densCols: what are the computed densities and how to create a legend

2010-04-22 Thread Florian Hahne
Hi Kate, the function does not directly return the calculated density values, however those can be recomputed through the internal function .smoothScatterCalcDensity This function is not exported from the grDevices name space, so you need to use the full qualifier: dat <- cbind(rnorm(100), rnorm

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread Duncan Murdoch
On 22/04/2010 8:09 AM, carol white wrote: Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed under windows (unzip under windows instead of gunzip). H

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread Uwe Ligges
On 22.04.2010 15:34, David Winsemius wrote: On Apr 22, 2010, at 8:09 AM, carol white wrote: Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed unde

Re: [R] Compare two data frames

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 9:41 AM, Doran, Harold wrote: I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1 <- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2 <- d1[, c('y', 'x')] The first dataframe d1 has more variables than d2 and the

Re: [R] R2.11.0 - rasterImage() and barplot fill-patterns

2010-04-22 Thread baptiste auguie
Hi, This idea was also discussed when Paul Murrell first announced the grid.raster function to R-devel, http://tolstoy.newcastle.edu.au/R/e8/devel/09/12/0912.html My personal conclusion was that vector fill patterns are generally better in terms of resolution and speed. Of course the situation mi

Re: [R] How to stamp my graphs with date and time

2010-04-22 Thread Kevin Wright
Jun, I created a function called "pageNum" that does exactly what you want for both 'base' and 'lattice' graphics. You can find it here: http://ryouready.wordpress.com/2009/02/17/r-good-practice-adding-footnotes-to-graphics/ Kevin On Wed, Apr 21, 2010 at 7:23 PM, Jun Shen wrote: > David, Dun

[R] Compare two data frames

2010-04-22 Thread Doran, Harold
I wonder if there is a more efficient way to do this task. Suppose I have two data frames, such as d1 <- data.frame(x = c(1,2,3), y = c(4,5,6), z = c(7,8,9)) d2 <- d1[, c('y', 'x')] The first dataframe d1 has more variables than d2 and the variable columns are in a different order. So, what I

Re: [R] overlaying a levelplot on a map plot

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 5:33 AM, Simon Goodman wrote: Thanks for the suggestions Unfortunately contour won't in this case as it expects the x,y values to be in an ascending sequence. ?order David Winsemius, MD West Hartford, CT __ R-help@r

Re: [R] install or uncompress package build in one platform in another platform

2010-04-22 Thread David Winsemius
On Apr 22, 2010, at 8:09 AM, carol white wrote: Hi, Is an R package built under Unix (package.tar.gz) could be installed on other platforms like windows or Mac? The compressed tar file (.tar.gz) built under Unix doesn't seem to be uncompressed under windows (unzip under windows instead of

  1   2   >