Re: [R] One-to-one matching?

2008-06-23 Thread Alec.Zwart
My thanks to Gabor Grothendieck, Charles C. Berry and Moshe Olshansky for their suggested solutions. The upshot of which is that a nice one-line solution to my one-to-one exact matching problem is the Grothendieck-Berry collaboration of match(make.unique(matchSample), make.unique(lookupTable))

Re: [R] R help

2008-06-23 Thread Moshe Olshansky
You can use split(x$Snp_ID,x$Gene) where x is your data.frame (see ?split). --- On Tue, 24/6/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] R help > To: r-help@r-project.org > Received: Tuesday, 24 June, 2008, 2:27 PM > Hi there, > > I

Re: [R] after setting auto.key=TRUE, legend become inconsistent with the graph

2008-06-23 Thread Deepayan Sarkar
On 6/23/08, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Set the various plotting parameters in par.settings= in which > case both the legend and the plot itself will be taken from there. > See for example: > > http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90432.html > > where superpose.li

[R] R help

2008-06-23 Thread Rajasekaramya
Hi there, I am very new to R.I have to write the code for the following scenario Snp_Id Gene name score 1 a 2 b 3 a 4b are the three columns in my table.There are many snp,s for a particular gene.I have to group all the snp to its corresponding genname

Re: [R] after setting auto.key=TRUE, legend become inconsistent with the graph

2008-06-23 Thread Gabor Grothendieck
Set the various plotting parameters in par.settings= in which case both the legend and the plot itself will be taken from there. See for example: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/90432.html where superpose.line parameters are set. Similarly you can set superpose.symbol parameters.

[R] transform a table into a matrix

2008-06-23 Thread Maria Gavilanez
Hi. is there a way to transform a table that has numeric and categorical variables into a matrix? thanks Maria Mercedes Gavilanez Department of Biological Sciences 107 Life Sciences Building Louisiana State University Baton Rouge, LA 70803 (225)578-4284 ___

[R] after setting auto.key=TRUE, legend become inconsistent with the graph

2008-06-23 Thread Mark Farnell
When I use xyplot (from package lattice) to produce a multi-series graph: xyplot(linear+quadratic+sqrt~x, data=df, main="complexity of different functions", ylab="y", col=c("red", "black", "orange"), type="b", lty=c(1,2,3), pch=c(1,2,3), auto.key=TRUE) where I changed the default colour, line typ

[R] R help

2008-06-23 Thread Xu, Ke-Li
Dear Sir/Madam, I found your email address and your correspondence with R-users. I hope you could help me with this question about the function "ur.ers" in the package of "urca". It is an improved unit root test (Elliott et al. 1996 Econometrica). Do you know how to extract the value of the test s

Re: [R] Binding result of a function to a data frame

2008-06-23 Thread jim holtman
is this what you are looking for: > x <- read.table(textConnection(" V1 > V2 V3 V4 V5 + 1 1007_s_at DDR1 2865.1 2901.3 1978.3 + 2 1053_at RFC2 103.681.6 108.0

[R] Binding result of a function to a data frame

2008-06-23 Thread Gundala Viswanath
Hi, I have the following function: > kurtosis <-function(x) (mean((x-mean(x))^4))/(sd(x)^4) #x is a vector and data > print(mydata) V1 V2 V3 V4 V5 1 1007_s_at DDR1 2865.1 2901.3 1978.3 2

Re: [R] How to get row index of sorted matrix

2008-06-23 Thread Gundala Viswanath
Thanks Jim. That's does exactly what I am looking for. - Gundala Viswanath Jakarta - Indonesia On Tue, Jun 24, 2008 at 11:13 AM, jim holtman <[EMAIL PROTECTED]> wrote: > Is this what you were looking for: > >> x <- scan(textConnection(" 1372.23718 2.277450e+04 > +74.48333 5.494448e+01 > +

[R] Hessian in box-constraint problem - concern OPTIM function

2008-06-23 Thread Cleber Nogueira Borges
Hello all useRs, I am using the OPTIM function with particular interest in the method L-BFGS-B, because it is a box-constraint method. I have interest in the errors estimates too. I make: s.e. <- sqrt( diag( solve( optim(...,method='L-BFGS-B', hessian=TRUE)$hessian ))) but in help say:

Re: [R] How to get row index of sorted matrix

2008-06-23 Thread jim holtman
Is this what you were looking for: > x <- scan(textConnection(" 1372.23718 2.277450e+04 +74.48333 5.494448e+01 + 226.63590 6.023199e+02 + 1947.17564 4.044391e+04 + 178.79615 3.970006e+02 + 657.56857 3.396852e+04 + 251.60519 1.239538e+03 +78.53846 7.473607e+01 + 140.37564 2.39583

Re: [R] Accessing Named Column in a Matrix

2008-06-23 Thread jim holtman
It does not appear that the 'print' statment agrees with the output of 'str'. It appears that you only have a 3x2 matrix in the 'print', while the 'str' indicates a 150x80 matrix. Can you "provide commented, minimal, self-contained, reproducible code" so it is easier to see what the problem might

[R] How to get row index of sorted matrix

2008-06-23 Thread Gundala Viswanath
Hi, How can I get the top-3 index (sorted by "var") of the following matrix? > print(mydata) var [1,] 1372.23718 2.277450e+04 [2,]74.48333 5.494448e+01 [3,] 226.63590 6.023199e+02 [4,] 1947.17564 4.044391e+04 [5,] 178.79615 3.970006e+02 [6,]

[R] Accessing Named Column in a Matrix

2008-06-23 Thread Gundala Viswanath
Hi, How can I access the "var" column in this matrix >print(data) var [1,] 1372.23718 2.277450e+04 [2,]74.48333 5.494448e+01 [3,] 226.63590 6.023199e+02 I've had a look with > str(data) num [1:150, 1:80] 30.9 8.6 8.5 159.7 1.7 ... - attr(*

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-23 Thread Bryan Hanson
Thanks Deepayan. That's the conclusion I have gradually reaching! Bryan On 6/23/08 5:57 PM, "Deepayan Sarkar" <[EMAIL PROTECTED]> wrote: > On 6/22/08, Bryan Hanson <[EMAIL PROTECTED]> wrote: >> Thanks Gabor, I'm getting closer. >> >> Is there a way to spread out resp values vertically for a g

Re: [R] levelplot question

2008-06-23 Thread Pedro Mardones
thanks for the replies, however z1 (range 300-800) and z2 (range 0-50) are measured in different units and scales and the approach suggested by Bert and Deepayan creates a single colorkey (0-800) and some of the plots for z2 really don't show anything...is there any way to specify separate colorkey

Re: [R] levelplot question

2008-06-23 Thread Deepayan Sarkar
On 6/23/08, Pedro Mardones <[EMAIL PROTECTED]> wrote: > Dear all; > I have a data set with 3 groups and 2 response variables, say z1 and > z2, and I would like to create a single plot (using the levelplot > function) showing on the first row the leveplots for z1 for each group > and on the seco

Re: [R] Coloring Stripchart Points, or Better, Lattice Equivalent

2008-06-23 Thread Deepayan Sarkar
On 6/22/08, Bryan Hanson <[EMAIL PROTECTED]> wrote: > Thanks Gabor, I'm getting closer. > > Is there a way to spread out resp values vertically for a given value of > index? In base graphics, stripchart does this with method = "stack". But > in lattice, stack = TRUE does something rather diffe

[R] levelplot question

2008-06-23 Thread Pedro Mardones
Dear all; I have a data set with 3 groups and 2 response variables, say z1 and z2, and I would like to create a single plot (using the levelplot function) showing on the first row the leveplots for z1 for each group and on the second row levelplots for z2 for the same groups. I tried plot.trellis u

Re: [R] Controlling the length of line with abline(lm())

2008-06-23 Thread Greg Snow
You can use the clipplot function in the TeachingDemos package to limit the range of the line (the 2nd example in the help page shows an example of 3 lines for 3 subgroups of data with each line limited to the x-range of the data). There is also the clip function in the graphics package (no ext

Re: [R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-23 Thread Daniel Folkinshteyn
on 06/23/2008 03:40 PM Thomas Frööjd said the following: 1. Shift the mean and std on the reference dataset to the mean and std of my clinic birth weight data. to shift the mean by any distance, just add or subtract that distance from each observation (e.g., to move mean from m1 to m2, t

Re: [R] Correlation Help

2008-06-23 Thread milton ruser
Hi Michael, May be you have NA on your dataset. x<-runif(20) y<-runif(20) cor(x,y) x[10]<-NA x cor(x,y) # SEE the error because NA cor(x,y, use = "pairwise.complete.obs") Good luck, miltinho brazil On 6/23/08, Tong, Michael <[EMAIL PROTECTED]> wrote: > > Hi, > > I have recently been usin

Re: [R] ggplot2-barplot

2008-06-23 Thread Felipe Carrillo
Thierry: That's exactly what I wanted, Thanks > Dear Felipe, > > Is this what you want? > > library(ggplot2) > mydata <- data.frame(PondName = factor(LETTERS[1:5]), > avgWt = rnorm(5, > mean = 10, sd = 3)) > ggplot(mydata, aes(x = PondName, y = avgWt)) + geom_bar() > ggplot(mydata, aes(x = PondN

Re: [R] Extracting "row.names"

2008-06-23 Thread Richard Pearson
As a further aside, names is also not the best choice for a variable name for the same reason. Richard. Erik Iverson wrote: row.names is a function that takes a data.frame as an argument. So how about > row.names(data) ? As an aside, 'data' is not the best choice for a variable name in

[R] Need ideas on how to show spikes in my data and how to code it in R

2008-06-23 Thread Thomas Frööjd
Hi I have recently been analyzing birthweight data from a clinic. The data has obvious defects in that there is digit preference on certain weights making them overrepresented. This shows as spikes in the histogram on certain well rounded weights like 2, 2.5, 3, etc. I would like to show this t

Re: [R] Correlation Help

2008-06-23 Thread stephen sefick
?cor you can't calculate a correlation on a missing data point. I think you need to use the argument use=pairwise.complete.obs in the cor call, but look at the function description it will tell you what you need to know (I think). Also, search the list-R nabble, Rsitsearch, or ... Good Luck Steph

[R] Correlation Help

2008-06-23 Thread Tong, Michael
Hi, I have recently been using the R program and encountered a recurring problem. I have been trying calculate the correlation of a 16 column table. Everytime I type in cor(test), where test is data that I uploaded into R using the read.table function, I get an error: Error in cor(test) : miss

Re: [R] subset with multiple criteria

2008-06-23 Thread Gabor Grothendieck
Just add a column to E.corr that is 1, 2, ... E.coor$id <- 1:nrow(E.coor) and now repeat the merge and SQL solutions. On Mon, Jun 23, 2008 at 1:49 PM, <[EMAIL PROTECTED]> wrote: > Thanks for your answers. > I'm sorry. I'm afraid I didn't pose correctly the question , and the use > os "subset"

Re: [R] Extracting "row.names"

2008-06-23 Thread Erik Iverson
row.names is a function that takes a data.frame as an argument. So how about > row.names(data) ? As an aside, 'data' is not the best choice for a variable name in R, since there is a function called 'data' that will get overridden if you do this ... Patrick Richardson wrote: List, I'm t

Re: [R] Extracting "row.names"

2008-06-23 Thread Jorge Ivan Velez
Dear Patrick, Try this: NAMES=rownames(yourdata) NAMES See ?rownames for more information. HTH, Jorge On Mon, Jun 23, 2008 at 12:09 PM, Patrick Richardson <[EMAIL PROTECTED]> wrote: > > List, > > I'm trying to extract the row names of a table I have read into R. > > > data <- read.table("me

Re: [R] LR Decomposition?

2008-06-23 Thread Duncan Murdoch
On 6/23/2008 12:12 PM, Jeffrey Spies wrote: Hi all, Is there an LR decomposition function in R and, if not, how can we get the non-compact representation of Q from QR decomposition? I think LR and LU decompositions are different names for the same thing; the latter is available through lu() i

[R] Extracting "row.names"

2008-06-23 Thread Patrick Richardson
List, I'm trying to extract the row names of a table I have read into R. > data <- read.table("mesodata.txt", header=TRUE, row.names=1) When I try to extract them using, > names <- data$row.names I get, > names NULL I've tried changing to a matrix, data frame, etc. and still get "NULL". I'

Re: [R] subset with multiple criteria

2008-06-23 Thread jgarcia
Thanks for your answers. I'm sorry. I'm afraid I didn't pose correctly the question , and the use os "subset" was misleading. What I need is to obtain the index of the corresponding rows in E.coor, to subtitute the corresponding values by new updated values. The closest answer to what I really nee

Re: [R] Short courses for beginners?

2008-06-23 Thread Roberto Laforgia
See the following link: http://www.xlsolutions-corp.com/courselist.htm here you can find some courses in the U.S. Regards, R.L. David Hewitt wrote: > > Recently I've had a couple folks ask me whether there are short courses or > tutorials offered to help them get started in R. They're think

Re: [R] R vs. Bugs

2008-06-23 Thread Peter Muhlberg
Hi Paul & Brian: Thanks for your replies! Paul: Thank you for the encouragement. You're right that I don't need the working examples or Doodle generator in WinBugs. I'm wondering what open-source components could easily substitute for the core Bugs functionality? Do you know if any of these w

Re: [R] LR Decomposition?

2008-06-23 Thread Berend Hasselman
Roy Mendelssohn wrote: > > Hi All: > > > On Jun 23, 2008, at 9:53 AM, Berend Hasselman wrote: > >> Jeffrey Spies wrote: >>> >>> Hi all, >>> >>> Is there an LR decomposition function in R and, if not, how can we >>> get the >>> non-compact representation of Q from QR decomposition? >>> >>> T

Re: [R] LR Decomposition?

2008-06-23 Thread Roy Mendelssohn
Hi All: On Jun 23, 2008, at 9:53 AM, Berend Hasselman wrote: Jeffrey Spies wrote: Hi all, Is there an LR decomposition function in R and, if not, how can we get the non-compact representation of Q from QR decomposition? Thanks, Jeff. I assume you mean a QR decomposition (I don't kno

Re: [R] subset with multiple criteria

2008-06-23 Thread Gabor Grothendieck
Here are two solutions: # 1 merge(subset.coor, E.coor) # 2 # note that we changed the names of the data frames # for this solution since dot is an operator in SQL library(sqldf) sqldf("select * from subset_coor natural join E_coor") On Mon, Jun 23, 2008 at 12:32 PM, <[EMAIL PROTECTED]> wrote:

Re: [R] LR Decomposition?

2008-06-23 Thread Berend Hasselman
Jeffrey Spies wrote: > > Hi all, > > Is there an LR decomposition function in R and, if not, how can we get the > non-compact representation of Q from QR decomposition? > > Thanks, > > Jeff. > I assume you mean a QR decomposition (I don't know what an LR decomposition is). You can get the

Re: [R] Cannot find JRI native library! in Solaris 10

2008-06-23 Thread stephen sefick
http://www.rforge.net/JRI/ how about this? that is about as far as I can help (assuming I did in the first place). good luck Stephen On Mon, Jun 23, 2008 at 11:10 AM, Manjit Barman <[EMAIL PROTECTED]> wrote: > Dear Stephen, > First of all thank for your response. > But i am having the issue with

Re: [R] subset with multiple criteria

2008-06-23 Thread jim holtman
?merge > E <- read.table(textConnection("east north dat + 1 582650 4248850 0.8316848 + 2 582750 4248850 0.7230272 + 3 582850 4248850 0.3250818 + 4 582950 4248850 0.6144006 + 5 583050 4248850 0.8706312 + 6 583150 4248850 0.2149651 + 7 583250 4248850 0.1659519 + 8 583350 4248850

Re: [R] Odp: Unexpected Behavior (potentially) in t.test

2008-06-23 Thread Russell Pierce
Thank you Peter and Petr, I tried it again eliminating some of the t-tests I don't really use (e.g. the transformed ones), and it hasn't crashed yet. I know that looping (esp nested looping) in R isn't efficient, but I was having trouble coming up with alternatives, if you have any suggestions or

Re: [R] subset with multiple criteria

2008-06-23 Thread jim holtman
You can also do this: > E[(E$east %in% sub$east) & (E$north %in% sub$north),] east north dat 1 582650 4248850 0.8316848 7 583250 4248850 0.1659519 > On Mon, Jun 23, 2008 at 12:32 PM, <[EMAIL PROTECTED]> wrote: > This should be theoretically very simple, but I dont get the elegant >

[R] LR Decomposition?

2008-06-23 Thread Jeffrey Spies
Hi all, Is there an LR decomposition function in R and, if not, how can we get the non-compact representation of Q from QR decomposition? Thanks, Jeff. -- View this message in context: http://www.nabble.com/LR-Decomposition--tp18072588p18072588.html Sent from the R help mailing list archive a

[R] Short courses for beginners?

2008-06-23 Thread David Hewitt
Recently I've had a couple folks ask me whether there are short courses or tutorials offered to help them get started in R. They're thinking of small-ish courses that they could travel to (in the US) and spend a few days focused on the basics of data manipulation and modeling in R. I've seen annou

[R] subset with multiple criteria

2008-06-23 Thread jgarcia
This should be theoretically very simple, but I dont get the elegant answer (without looping). I've got a long (thousands of rows) data frame: > E.coor[1:10,] east north dat 1 582650 4248850 0.8316848 2 582750 4248850 0.7230272 3 582850 4248850 0.3250818 4 582950 4248850 0.614400

[R] Possible cause of the error: unknown c standard 'gnu99'

2008-06-23 Thread Vidhu Choudhary
Hi All, I am getting error "unknown c standard 'gnu99'. I have attached the screen shot. Can anyone suggest what is causing this error thank you Best regards Vidhu __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

[R] Problem when building a test R package on PC

2008-06-23 Thread Xiaohui Wang
I followed the instruction of building R package on PC by Peter Rossi. I got problem when I tried to build a R package from his example, test.zip. The problem occurs when I tried to R CMD check test the screen stops at D:\Rpackagebuild\Rossi_test>R CMD check test * checking for working pdflatex

Re: [R] Cannot find JRI native library! in Solaris 10

2008-06-23 Thread Manjit Barman
Dear Stephen, First of all thank for your response. But i am having the issue with jri library not java library. This is the error that pops up every time i try to execute a R program from Java "Cannot find JRI native library!Please make sure that the JRI native library is in a directory listed

Re: [R] Odp: Unexpected Behavior (potentially) in t.test

2008-06-23 Thread Peter Dalgaard
Petr PIKAL wrote: > Hi > > I tried your code with R 2.8.0 devel, gave up after about 4 hours (more > or less t1N was 18) but until i interrupted it manually there was no > problem neither error. Maybe you could try it with new R version. Besides > I did not debug or profile your code so maybe y

Re: [R] Cannot find JRI native library! in Solaris 10

2008-06-23 Thread stephen sefick
not having a clue It looks like you are missing the java library. I would imagine that you can get this from sun relatively easily. Stephen On Mon, Jun 23, 2008 at 10:36 AM, Manjit Barman <[EMAIL PROTECTED]> wrote: > Hi , > I am getting these errors in Solaris 10. Can anyone help me on these? I

[R] Cannot find JRI native library! in Solaris 10

2008-06-23 Thread Manjit Barman
Hi , I am getting these errors in Solaris 10. Can anyone help me on these? I have unpacked and compiled all the required source files into a Solaris 10 server. i could see the libjri.so and R.so created. Even if i defined those in my LD_LIBRARY_PATH still these errors pops up. I would really be

[R] Odp: Unexpected Behavior (potentially) in t.test

2008-06-23 Thread Petr PIKAL
Hi I tried your code with R 2.8.0 devel, gave up after about 4 hours (more or less t1N was 18) but until i interrupted it manually there was no problem neither error. Maybe you could try it with new R version. Besides I did not debug or profile your code so maybe you could try to debug it you

Re: [R] expand.grid() function

2008-06-23 Thread Wacek Kusnierczyk
Ken Knoblauch wrote: > > How about > > do.call("expand.grid", rep(list(c("u", "l")), 3)) > Var1 Var2 Var3 > 1uuu > 2luu > 3ulu > 4llu > 5uul > 6lul > 7ull > 8lll > > ... which can now be nicely gen

Re: [R] expand.grid() function

2008-06-23 Thread Gavin Simpson
On Mon, 2008-06-23 at 16:07 +0200, ONKELINX, Thierry wrote: > Expand.grid works with lists too. > > > expand.grid(rep(list(c("u", "l")), 3)) > Var1 Var2 Var3 > 1uuu > 2luu > 3ulu > 4llu > 5uul > 6lul > 7ull > 8

Re: [R] expand.grid() function

2008-06-23 Thread ONKELINX, Thierry
Expand.grid works with lists too. > expand.grid(rep(list(c("u", "l")), 3)) Var1 Var2 Var3 1uuu 2luu 3ulu 4llu 5uul 6lul 7ull 8lll This is probably as concise as is can get. HTH, Thierry --

Re: [R] expand.grid() function

2008-06-23 Thread Ken Knoblauch
Megh Dal yahoo.com> writes: > I have one question on expand.grid() function. > When I write following syntax :expand.grid(c("u", "l"), >c("u", "l"), c("u", "l")) I get following as > desired : > Var1 Var2 Var3 > 1uuu > 2luu > 3ulu > 4llu > 5

Re: [R] grouping values

2008-06-23 Thread Daren Tan
Any solution to my problem ?> To: [EMAIL PROTECTED]> From: [EMAIL PROTECTED]> Date: Mon, 23 Jun 2008 13:25:02 +> Subject: Re: [R] grouping values> > Daren Tan hotmail.com> writes:> > I tried aggregate, apply etc, but can't get the right result. > > > > For example, > > > > m <- cbind(c(LE

Re: [R] Writing Vector to a File

2008-06-23 Thread Duncan Murdoch
On 6/23/2008 9:15 AM, Gundala Viswanath wrote: Dear Philipp and Duncan, I've tried write(as.character(myvec), "output.txt", sep="\n") and writeLines(as.character(myvec), "output.txt", sep="\n") Both yielding same result. 1 1 1 1 1 6241 Is there any other possible explanation, why it

Re: [R] grouping values

2008-06-23 Thread Henrique Dallazuanna
Try this: m <- as.data.frame(m) m.new <- sapply(split(m, m$V2), function(x)paste(x$V1, collapse="|")) On Mon, Jun 23, 2008 at 10:10 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > > I tried aggregate, apply etc, but can't get the right result. > > For example, > > m <- cbind(c(LETTERS[1:5]), c("aa"

[R] R

2008-06-23 Thread Jordi Roquer Sanagustin
Can anybody send me the list of R classes and the Hierarchic relations among them?? Please I can't find it.. Thanksss a lot -- Jordi Roquer Sanagustin 620 722 656 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

Re: [R] expand.grid() function

2008-06-23 Thread Gavin Simpson
On Mon, 2008-06-23 at 06:16 -0700, Megh Dal wrote: > Hi, > > I have one question on expand.grid() function. > > When I write following syntax :expand.grid(c("u", "l"), c("u", "l"), > c("u", "l")) I get following as desired : > Var1 Var2 Var3 > 1uuu > 2luu > 3

Re: [R] Need help to draw a plot

2008-06-23 Thread Barry Rowlingson
Ron Michael wrote: can i have some instruction on how to draw this type of plot in R : http://sitmo.com/doc/Image:Ll_ou_conpron.png#filelinks ? Regards, The black curve and it's grey friends are probably easily done with plot or matplot, but you need to make sure the X-axis extends far enou

Re: [R] grouping values

2008-06-23 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > Daren Tan hotmail.com> writes: > > I tried aggregate, apply etc, but can't get the right result. > do.call("expand.grid", rep(list(c("u", "l")), 3)) > Var1 Var2 Var3 > 1uuu > 2luu > 3ulu > 4llu > 5uu

[R] expand.grid() function

2008-06-23 Thread Megh Dal
Hi, I have one question on expand.grid() function. When I write following syntax :expand.grid(c("u", "l"), c("u", "l"), c("u", "l")) I get following as desired : Var1 Var2 Var3 1uuu 2luu 3ulu 4llu 5uul 6lul 7

Re: [R] Writing Vector to a File

2008-06-23 Thread Philipp Pagel
On Mon, Jun 23, 2008 at 10:15:53PM +0900, Gundala Viswanath wrote: > I've tried > > > write(as.character(myvec), "output.txt", sep="\n") > > and > > > writeLines(as.character(myvec), "output.txt", sep="\n") > > Both yielding same result. > > >> 1 > >> 1 > >> 1 > >> 1 > >> 1 > >> 6241 > > Is

Re: [R] Writing Vector to a File

2008-06-23 Thread Gundala Viswanath
Dear Philipp and Duncan, I've tried > write(as.character(myvec), "output.txt", sep="\n") and > writeLines(as.character(myvec), "output.txt", sep="\n") Both yielding same result. >> 1 >> 1 >> 1 >> 1 >> 1 >> 6241 Is there any other possible explanation, why it still went wrong? - Gundala Vis

Re: [R] grouping values

2008-06-23 Thread Ken Knoblauch
Daren Tan hotmail.com> writes: > I tried aggregate, apply etc, but can't get the right result. > > For example, > > m <- cbind(c(LETTERS[1:5]), c("aa", "bb", "cc", "aa", "cc")) > "cc"[4,] "D" "aa"[5,] "E" "cc" > how to obtain m.new where "aa", "bb", and "cc" are groups, belonging to the

[R] grouping values

2008-06-23 Thread Daren Tan
I tried aggregate, apply etc, but can't get the right result. For example, m <- cbind(c(LETTERS[1:5]), c("aa", "bb", "cc", "aa", "cc")) [,1] [,2][1,] "A" "aa"[2,] "B" "bb"[3,] "C" "cc"[4,] "D" "aa"[5,] "E" "cc" how to obtain m.new where "aa", "bb", and "cc" are groups, and more t

Re: [R] Programming Concepts and Philosophy

2008-06-23 Thread stephen sefick
This is a lot like music- a good musician knows better when not to play than when to (guitar teacher I had 15+ years ago). stephen On Mon, Jun 23, 2008 at 8:33 AM, jim holtman <[EMAIL PROTECTED]> wrote: > To quote Jon Bentley (Programming Pearls): > > "The fastest, cheapest, most reliable piece

Re: [R] handling the output of strsplit

2008-06-23 Thread jim holtman
One way, if you are unsure of your data, is to append two additional zeros on to the strings: > strptime("23h", format="%Hh%M") [1] NA > strptime(paste("23h", "00", sep=""), format="%Hh%M") [1] "2008-06-23 23:00:00 GMT" > strptime(paste("23h04", "00", sep=""), format="%Hh%M") [1] "2008-06-23 23:04

Re: [R] Programming Concepts and Philosophy

2008-06-23 Thread jim holtman
To quote Jon Bentley (Programming Pearls): "The fastest, cheapest, most reliable piece of code is that which isn't there; design as much out of your code as you design in." On Mon, Jun 23, 2008 at 3:57 AM, Philipp Pagel <[EMAIL PROTECTED]> wrote: > On Fri, Jun 20, 2008 at 10:04:46AM -0500, hadley

[R] Need help to draw a plot

2008-06-23 Thread Ron Michael
can i have some instruction on how to draw this type of plot in R : http://sitmo.com/doc/Image:Ll_ou_conpron.png#filelinks ? Regards, Send instant messages to your online friends http://uk.messenger.yahoo.com [[alternative HTML version deleted]]

[R] Documentation about htest?

2008-06-23 Thread Matthieu Stigler
Hello I saw in many packages and functions a class "htest". I wanted to study it and maybe use for a package instead of writing new classes, but did not find any documentation about this class in the official manuals. Are there some information available about it? How can I see how to use it?

Re: [R] Writing Vector to a File

2008-06-23 Thread Philipp Pagel
> I want to print this vector into a file > > > myvec > [1] --Control --Control --Control --Control --Control HBA2 HBA1 > [8] HBA1 --Control HBB --Control HBB HBA1 MBP [...] > > However using this command: > write(myvec, "output.txt", sep="\n") > > I get this inste

Re: [R] Writing Vector to a File

2008-06-23 Thread Duncan Murdoch
Gundala Viswanath wrote: Dear experts, I try not to trouble the list again after this question. I want to print this vector into a file myvec [1] --Control --Control --Control --Control --Control HBA2 HBA1 [8] HBA1 --Control HBB --Control HBB HBA1 MBP

Re: [R] Handle missing values

2008-06-23 Thread Francisco Pastor
Hi Ted I think I understand what you say. Maybe I should reformat my data and then divide my single annual file in twelve monthly files. But maybe then I miss the possibility of making an anual analysis but retain more valid data, I have to think about it. Hope any expert in clustering can h

[R] Writing Vector to a File

2008-06-23 Thread Gundala Viswanath
Dear experts, I try not to trouble the list again after this question. I want to print this vector into a file > myvec [1] --Control --Control --Control --Control --Control HBA2 HBA1 [8] HBA1 --Control HBB --Control HBB HBA1 MBP [15] --Control HBA1 HBA2

Re: [R] handling the output of strsplit

2008-06-23 Thread Patrick Connolly
On Sat, 21-Jun-2008 at 05:33AM -0700, Mark Difford wrote: |> |> Hi Denis, |> |> >> h = c("3h30", "6h30", "9h40", "11h25", "14h00", |> >> "15h55", "23h") |> |> >> I could not figure out how to use chron to import this into times, so |> >> I tried to extract the hours

Re: [R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Peter Dalgaard
Gavin Simpson wrote: > On Mon, 2008-06-23 at 17:47 +0900, Gundala Viswanath wrote: > >> Hi, >> >> Given this vector: >> >> >>> x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , >>> 113.9) >>> >> [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113

[R] R 2.7.1 re-released

2008-06-23 Thread Peter Dalgaard
There was a minor problem with the date in the previously released version. It has been replaced with a new file. The updated md5sums are 565b06a1f3f11020399934cc7b47a59d R-2.7.1.tar.gz 565b06a1f3f11020399934cc7b47a59d R-latest.tar.gz -- O__ Peter Dalgaard Øster Farimagsg

Re: [R] I need help with eofs

2008-06-23 Thread Gavin Simpson
On Mon, 2008-06-23 at 10:13 +0200, Francisco Javier Santos Alamillos wrote: > Hello, > > I'm a beginner in R. I'm learning to use this fantastic program, but I have > some problems in how to use it. > > First of all, I have a txt file witch I am able to load to the program. I'm > very interested

Re: [R] Handle missing values

2008-06-23 Thread Ted Harding
On 23-Jun-08 09:35:10, Francisco Pastor wrote: > Hi everyone > I am new to R and have a question about missing values. I am > trying to do a cluster analysis of monthly temperatures and > my data are 14 columns with spatial coordinates (lat,lon) > and 12 monthly values: > > /lat - lon - temp1

Re: [R] How to return multiple values in a function

2008-06-23 Thread Ted Harding
On 23-Jun-08 09:04:42, Wacek Kusnierczyk wrote: > Hans-Joerg Bibiko wrote: >> On 23 Jun 2008, at 10:23, Gundala Viswanath wrote: >>> I apologize for this newbie question. But I can't seem >>> to find in R online manual. >>> >>> 1. How can I return two values in a function? >>> 2. How can I capture

[R] Handle missing values

2008-06-23 Thread Francisco Pastor
Hi everyone I am new to R and have a question about missing values. I am trying to do a cluster analysis of monthly temperatures and my data are 14 columns with spatial coordinates (lat,lon) and 12 monthly values: /lat - lon - temp1 - //temp2 - temp3 - - //temp12/ If I omit m

[R] [R-pkgs] AdMit 1.00-02

2008-06-23 Thread Ardia David
'AdMit' 1.00-02 is a contributed R package which provides functions to perform the fitting of an adaptive mixture of Student-t distributions to a target density through its kernel function. The mixture approximation can then be used as the importance density in importance sampling or as the cand

Re: [R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Gavin Simpson
On Mon, 2008-06-23 at 17:47 +0900, Gundala Viswanath wrote: > Hi, > > Given this vector: > > > x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , > > 113.9) > [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 > > > mean.x <- mean(x) > [1] 79.63 > > I wis

[R] I need help with eofs

2008-06-23 Thread Francisco Javier Santos Alamillos
Hello, I'm a beginner in R. I'm learning to use this fantastic program, but I have some problems in how to use it. First of all, I have a txt file witch I am able to load to the program. I'm very interested in PCA, and I have a lot of packages, but I haven't got the results that I want. I would l

Re: [R] Question about copula-GARCH model

2008-06-23 Thread [EMAIL PROTECTED]
A simple approach is to assume that dependence structure between variables (which is characterized by copula) is constant throughout the process. In this case, you may apply log-likelihood estimation of copula parameters to ranked AR-GARCH process residuals. A more complicated approach is to inven

[R] I need help with eofs

2008-06-23 Thread Francisco Javier Santos Alamillos
Hello, I'm a beginner in R. I'm learning to use this fantastic program, but I have some problems in how to use it. First of all, I have a txt file witch I am able to load to the program. I'm very interested in PCA, and I have a lot of packages, but I haven't got the results that I want. I have g

Re: [R] How to return multiple values in a function

2008-06-23 Thread Wacek Kusnierczyk
Hans-Joerg Bibiko wrote: > > On 23 Jun 2008, at 10:23, Gundala Viswanath wrote: >> I apologize for this newbie question. But I can't seem >> to find in R online manual. >> >> 1. How can I return two values in a function? >> 2. How can I capture the values again of this function? >> >> myfunc <- fun

Re: [R] ggplot2-barplot

2008-06-23 Thread ONKELINX, Thierry
Dear Felipe, Is this what you want? library(ggplot2) mydata <- data.frame(PondName = factor(LETTERS[1:5]), avgWt = rnorm(5, mean = 10, sd = 3)) ggplot(mydata, aes(x = PondName, y = avgWt)) + geom_bar() ggplot(mydata, aes(x = PondName, y = avgWt, fill = PondName)) + geom_bar() HTH, Thierry --

Re: [R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Hans-Joerg Bibiko
On 23 Jun 2008, at 10:47, Gundala Viswanath wrote: Hi, Given this vector: x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , 113.9) [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 mean.x <- mean(x) [1] 79.63 I wish to: 1. Create a new vector (n

[R] [R-pkgs] scuba 1.2-1

2008-06-23 Thread adrian
scuba 1.2-1 ** now with added Helium ** 'scuba' is a contributed R package that performs theoretical calculations about scuba diving --- dive profiles, decompression models, gas toxicity and so on. New features in version 1.2-1: . Breathing gases may now contain Helium

[R] Create a new vector with filled with mean value of original vector

2008-06-23 Thread Gundala Viswanath
Hi, Given this vector: > x <- c(30.9, 60.1 , 70.0 , 73.0 , 75.0 , 83.9 , 93.1 , 97.6 , 98.8 , > 113.9) [1] 30.9 60.1 70.0 73.0 75.0 83.9 93.1 97.6 98.8 113.9 > mean.x <- mean(x) [1] 79.63 I wish to: 1. Create a new vector (nx) with the same size as "x" 2. Fill "nx" with the m

Re: [R] How to return multiple values in a function

2008-06-23 Thread Hans-Joerg Bibiko
On 23 Jun 2008, at 10:23, Gundala Viswanath wrote: I apologize for this newbie question. But I can't seem to find in R online manual. 1. How can I return two values in a function? 2. How can I capture the values again of this function? myfunc <- function (array) { # do something with array

[R] How to return multiple values in a function

2008-06-23 Thread Gundala Viswanath
Hi, I apologize for this newbie question. But I can't seem to find in R online manual. 1. How can I return two values in a function? 2. How can I capture the values again of this function? myfunc <- function (array) { # do something with array # get something assign to "foo" and "bar"

[R] R 2.7.1 is released

2008-06-23 Thread Peter Dalgaard
I've rolled up R-2.7.1.tar.gz a short while ago. This is a maintenance release and fixes a number of mostly minor bugs and platform issues. Notably, the numeric interpretation of "-", "+", and "." has reverted to pre-2.7.0 behaviour See the full list of changes below. You can get it (in a short

  1   2   >