Re: [R] calculating p-values from t-values for a Bonferroni adjustment

2009-07-27 Thread Dieter Menne
NativeBuff2003 wrote: > > > Sorry I'm new to the list and not great with R. My advisor performed > several for me but I am getting a different output when I try to reproduce > it. > >> 2*(1-pt(-3.59,598)) > 0.000358 <-his answer > [1] 1.999642 <-my answer > > I was working with a different d

[R] Sort a dataframe on the column Date

2009-07-27 Thread Meenu Sahi
Dear Users I have a dataframe called mydata4 of the following order with the first column as a date and the rest of the columns are numeric with rate. Column 1 Rate1 : Rate 20 (PxMid) 01/01/2003 07/01/2001 -- I wish to sort this dataframe on the first col in ascending order. I t

Re: [R] storing output in html or pdf table format.

2009-07-27 Thread Liviu Andronic
Hello, On 7/28/09, Albert EINstEIN wrote: > clarification on output in R. I have generated summary statistics output for > dataset (E.g. sales) in output window. Now i want to store that output in a > html or pdf in a table format. if possible can any one provide code for this > one. > http:

Re: [R] Split rownames into factors

2009-07-27 Thread Bill.Venables
?substring Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jimdare Sent: Tuesday, 28 July 2009 8:10 AM To: r-help@r-project.org Subject: [R] Split rownames into factors Hi

Re: [R] Splitting matrix into several small matrices

2009-07-27 Thread Bill.Venables
I take it you want to split the matrix into sub-matrices for which some collection of columns is constant. In your case this is the last four columns. Here's an idea: > z <- matrix(c(13,1,1,1,1,12,0,0,0,0,8,1,0,1,1,8,0,1,0,0, + 10,1,1,1,1,3,0,1,0,0,3,1,0,1,1,6,1,1,1,1),8,5,byr

Re: [R] Making a sub data.frame

2009-07-27 Thread Bill.Venables
Suppose DF is the data frame and someIDs is the vector subDF <- subset(DF, ID %in% someIDs) Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of desper Sent: Tuesday, 28 July 200

Re: [R] Get bearing for cartesian coordinates

2009-07-27 Thread Bill.Venables
I think all you need is bearing <- function(x, y) atan2(y, x)*180/pi This gives the bearing in degrees from the origin. If you wanted the bearing from some other point, just take the differences: bearing <- function(x, y, origin = c(x=0,y=0)) atan2(y-origin["y"], x-origin["x"])*180/p

Re: [R] storing output in html or pdf table format.

2009-07-27 Thread cls59
Albert EINstEIN wrote: > > Hi every one, > Thanks for every one who are all supporting to us. we want some > clarification on output in R. I have generated summary statistics output > for dataset (E.g. sales) in output window. Now i want to store that > output in a html or pdf in a table format

[R] storing output in html or pdf table format.

2009-07-27 Thread Albert EINstEIN
Hi every one, Thanks for every one who are all supporting to us. we want some clarification on output in R. I have generated summary statistics output for dataset (E.g. sales) in output window. Now i want to store that output in a html or pdf in a table format. if possible can any one provide cod

Re: [R] dataframe to list conversion

2009-07-27 Thread Jorge Ivan Velez
Dear voidobscura, Try also Csum <- function(x) apply(x, 2, sum) Csum(m) HTH, Jorge On Mon, Jul 27, 2009 at 11:03 AM, voidobscura <> wrote: > > Hi all, I have been experimenting with writing my own matrix column sum > function. I want it to return a list. > > csum<-function(m) > { >a = da

Re: [R] dataframe to list conversion

2009-07-27 Thread Bill.Venables
All you need is csum <- function(m) sapply(m, sum) (in which case making csum a function does not achieve very much). If for some reason you want to hang on to your code and just modify the last line (though I cannot think why, but still...) you could do csum <- function(m) { a <- data.fr

Re: [R] calculating p-values from t-values for a Bonferroni adjustment

2009-07-27 Thread NativeBuff2003
> Ben Bolker wrote: > > > > NativeBuff2003 wrote: >> >> I am performing a sequential bonferroni adjustment on the results of an >> ANCOVA but the equation I have for calculating p-values from the t-values >> is not working. I can't seem to find it anywhere else. This is the code >> I have n

Re: [R] calculating p-values from t-values for a Bonferroni adjustment

2009-07-27 Thread Ben Bolker
NativeBuff2003 wrote: > > I am performing a sequential bonferroni adjustment on the results of an > ANCOVA but the equation I have for calculating p-values from the t-values > is not working. I can't seem to find it anywhere else. This is the code I > have now: 2*(1-pt(t,df)) where t=t-value a

Re: [R] local regression using loess

2009-07-27 Thread cindy Guo
Hi, Ryan, Thank you for the information. I tried it. But there are some error messages. When I use fit <- locfit(Y~X1*X2,family='binomial'), the error message is error lfproc(x, y, weights = weights, cens = cens, base = base, geth = geth, : compparcomp: parameters out of bounds And when I use

Re: [R] How should i change the SAS Codes into R Codes?

2009-07-27 Thread zhijie zhang
Thanks a lot. Matt's code works very well. Could i use several 'for' arguments to get the results as what i think first? 2009/7/28 John Kane > > I see Matt Aldridge has given you the answers to your specific questions. > > If you are used to using SAS you might find Bob Meunchen's book "Muenche

Re: [R] Confirmatory factor analysis problems using sem package (works in Amos)

2009-07-27 Thread John Fox
Dear Solomon, When I originally programmed the sem() function, I used optim() and experimented with the different methods provided, settling on "BFGS" as the default. Shortly after that, I compared optim() to nlm() for a range of problems and found that the latter performed better. It would not be

Re: [R] Assigning rank based on total count

2009-07-27 Thread ws
> I am using ACS micro data (PUMS) with one of the columns as a > factor for the place of birth (POBPF). I would like to create > a column (POBR) containing a rank > corresponding to the place of the observation > in the POBPF rankings. I wrote a blog entry on my solution: http://oregondem

Re: [R] Forumla format?

2009-07-27 Thread Bernd Kreuss
Steve Lianoglou wrote: > Is it possible to build up your formula as a string, and then convert > to formula w/ as.formula? what about simply using it this way instead: svm(label ~ ., data=mydata[,-c(22,23,25,31)]) __ R-help@r-project.org mailing lis

Re: [R] local regression using loess

2009-07-27 Thread Ryan
> > > > Hi, All, > > > > I have a dataset with binary response ( 0 and 1) and some numerical > > covariates. I know I can use logistic regression to fit the data. But I > > want > > to consider more locally. So I am wondering how can I fit the data with > > 'loess' function in R? And what will be t

Re: [R] Confirmatory factor analysis problems using sem package (works in Amos)

2009-07-27 Thread Solomon Messing
Dear John, Would it possible to use a different optimizer with the sem package? Perhaps optim(..., method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN"),...) for example? Thank you very much, -Solomon > -Original Message- > From: John Fox [mailto:j...@mcmaster.ca] > Sent: Friday

Re: [R] Multiple graphs

2009-07-27 Thread Cedrick Johnson
Try dev.new() after each graph is generated. Example code from my setup (adapted a bit to fit your situation): Alternate Method 1: Generate images and insert into PPT png(file = "chart1.png", width=800, height=800) #do something pretty dev.off() Alternate Method 2: Generate images with new wi

Re: [R] Making a sub data.frame

2009-07-27 Thread jim holtman
Try this: > x ID VAR1 1 11 blaaal 2 121 blalda 3 121 adada 4 234 baada 5 231 ddaaa 6 231 baada > idm <- c(121,234,231) > subset(x, ID %in% idm) ID VAR1 2 121 blalda 3 121 adada 4 234 baada 5 231 ddaaa 6 231 baada > On Mon, Jul 27, 2009 at 4:40 PM, desper wrote: > > Dear all, >

Re: [R] Splitting matrix into several small matrices

2009-07-27 Thread jim holtman
Here is one way to do it: > x V1 V2 V3 V4 V5 [1,] 13 1 1 1 1 [2,] 12 0 0 0 0 [3,] 8 1 0 1 1 [4,] 9 0 1 0 0 [5,] 10 1 1 1 1 [6,] 3 0 1 0 0 [7,] 3 1 0 1 1 [8,] 6 1 1 1 1 > # create the row indices based on columns 2-3 > x.i <- split(seq(nrow(x)), paste(x[,2]

[R] Multiple graphs

2009-07-27 Thread Data Analytics Corp.
Hi, I wrote a simple master function, run(), that has inside six qplot functions. The goal is to type run() and have all six graphs appear as separate windows so that I can copy them into PowerPoint for a client. When I type run(), only the last graph appears, the first five apparently being

Re: [R] skip plot/blank plot on purpose (multi-plot question)

2009-07-27 Thread Greg Snow
Also look at the frame and plot.new functions. -Original Message- From: "Mark Knecht" To: "Bert Gunter" Cc: "r-help" Sent: 7/27/09 1:56 PM Subject: Re: [R] skip plot/blank plot on purpose (multi-plot question) On Mon, Jul 27, 2009 at 12:21 PM, Bert Gunter wrote: > Well, all of this ca

[R] Get bearing for cartesian coordinates

2009-07-27 Thread pecardoso
Is it possible to get bearing in degrees from Cartesian (not lat long) coordinates? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] local regression using loess

2009-07-27 Thread cindy Guo
Hi, Bert, Thanks for the response. But then in this case, can I use loess to fit the data? If yes, then how to interpret the results? Cindy On Mon, Jul 27, 2009 at 4:32 PM, Bert Gunter wrote: > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.or

Re: [R] local regression using loess

2009-07-27 Thread Bert Gunter
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of cindy Guo Sent: Monday, July 27, 2009 4:06 PM To: r-help@r-project.org Subject: [R] local regression using loess Hi, All, I have a dataset with binary response ( 0 and 1) and some nume

Re: [R] Writing to a UDP server from R?

2009-07-27 Thread Warren Young
Saptarshi Guha wrote: This does not work u <- socketConnection('localhost',9000) UDP and TCP are entirely different worlds. They don't share the same port space; TCP port 9000 and UDP port 9000 are different things. Plus, UDP is connectionless, so you can't "connect" to a UDP port. All

[R] calculating p-values from t-values for a Bonferroni adjustment

2009-07-27 Thread NativeBuff2003
I am performing a sequential bonferroni adjustment on the results of an ANCOVA but the equation I have for calculating p-values from the t-values is not working. I can't seem to find it anywhere else. This is the code I have now: 2*(1-pt(t,df)) where t=t-value and df=degrees of freedom from the A

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Mehdi Khan
Even when choosing a value from the first few rows, it doesn't work. okay here it goes: > rearranged[1:10, 1:5] xy band1 VSCAT.001 soiltype 1 -124.3949 40.42468NANA CD 2 -124.3463 40.27358NANA CD 3 -124.3357 40.25226NANA C

[R] Making a sub data.frame

2009-07-27 Thread desper
Dear all, I have a data.frame like this ID VAR1 11 blaaal 121 blalda 121 adada 234baada 231 ddaaa 231 baada ... ... and I have another vector of ID, say, c(121,234,231) How could I collect all the observations start with ID f

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Mehdi Khan
it worked! thank you so much!! On Mon, Jul 27, 2009 at 3:16 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Ahh .. > > On Jul 27, 2009, at 6:01 PM, Mehdi Khan wrote: > > Even when choosing a value from the first few rows, it doesn't work. okay >> here it goes: >> >> > rearranged[1

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Mehdi Khan
no luck, it's okay, i will figure it out! i might isolate and recombine all the columns, maybe that will work. thanks for the help! On Mon, Jul 27, 2009 at 1:00 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > > On Jul 27, 2009, at 3:50 PM, Mehdi Khan wrote: > > the problem is, i

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Mehdi Khan
the problem is, it works with the example data i gave. however, it does NOT work with the data set i have, which is 600,000 rows. the class is still a data frame. On Mon, Jul 27, 2009 at 12:15 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > > On Jul 27, 2009, at 2:54 PM, Mehdi Kh

Re: [R] Non-Linear Regression with two Predictors

2009-07-27 Thread Berlinerfee
Hi and thank you for your reply, in my new regression formular the parameter delta is inserted: fit <- nls(dataset$V2~(( alpha / ( 1 + exp( beta - gamma* dataset$V1 ) ) ) + (dataset$V6*delta)),data=dataset,start=startparam) The sense is, that dataset$V6 is a dummy variable that represents the g

[R] frequent sequences

2009-07-27 Thread jgant
Hello, I'm having a few issues mining frequent sequences. I've read the documentation and played around with arules and arulesSequences with little success. For example if I have a vector, a = t(t(c(1,2,3,0,1,2,3,5,6,7))); I'd like to be able mine the association rules {1,2}-->{3}, {2}-->{3}, {1

Re: [R] Split rownames into factors

2009-07-27 Thread Christopher Bare
Hi, I'm not an R expert, but I thought I'd give your question a shot anyway. First, it looks like you're starting with a matrix, rather than a list. Let's hope I guessed that right: > m = matrix(c(324, 65, 543, 23, 54, 8765, 213, 43, 65)) > rownames(m) = c('X1Jan08', 'X1Jun08', 'X1Dec08', 'X2Jan

[R] local regression using loess

2009-07-27 Thread cindy Guo
Hi, All, I have a dataset with binary response ( 0 and 1) and some numerical covariates. I know I can use logistic regression to fit the data. But I want to consider more locally. So I am wondering how can I fit the data with 'loess' function in R? And what will be the response: 0/1 or the probabi

[R] Double Truncation Fit??

2009-07-27 Thread Vivek Ayer
Hey guys, Do you all know of a function that provides fitting for double-sided truncation? truncreg accounts for one-sided truncation, but not two, or at least I don't how to. Our outlier values are -115 on the left side and -55 on the right. Help appreciated, Vivek _

[R] Draw plot.table axis on right hand side

2009-07-27 Thread Sean Carmody
With an ordinary plot, to customise the axis it is possible to suppress drawing the axis and then call Axis. I have been trying to change the location of the y-axis on a plot.table plot to the right hand side, but cannot even work out how to suppress drawing the labels. Here is a toy example of th

[R] Splitting matrix into several small matrices

2009-07-27 Thread kathie
Dear R users... I need to split this matrix(or dataframe), for example, z <- matrix(c(13,1,1,1,1,12,0,0,0,0,8,1,0,1,1,8,0,1,0,0, 10,1,1,1,1,3,0,1,0,0,3,1,0,1,1,6,1,1,1,1),8,5,byrow = T) > z [,1] [,2] [,3] [,4] [,5] [1,] 131111 [2,] 12000

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Bert Gunter
Nothing wrong with rolling your own, but see ?all.equal for R's built-in "almost.equal" version. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Steve Lianoglou Sent: Monday, July 27,

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Steve Lianoglou
Ahh .. On Jul 27, 2009, at 6:01 PM, Mehdi Khan wrote: Even when choosing a value from the first few rows, it doesn't work. okay here it goes: > rearranged[1:10, 1:5] xy band1 VSCAT.001 soiltype 1 -124.3949 40.42468NANA CD 2 -124.3463 40.27358NA

[R] Split rownames into factors

2009-07-27 Thread jimdare
Hi Guys, I was wondering how you would go about solving the following problem: I have a list where the grouping information is in the row names. Rowname [,1] X1Jan08 324 X1Jun08 65 X1Dec08 543 X2Jan08 23 X2Jun08 54 X2Dec08 8765 X3Jan08 213 X3Jun08 43 X3Dec08 65 How can I create the f

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Steve Lianoglou
no luck, it's okay, i will figure it out! i might isolate and recombine all the columns, maybe that will work. thanks for the help! No, wait .. no luck in being able to select out rows from your data.frame using values you see somewhere in the top 10 rows? Can you just paste in some key l

Re: [R] Reordering the columns of my dataframe

2009-07-27 Thread Rolf Turner
On 28/07/2009, at 9:45 AM, Mark Na wrote: Hi R-helpers, I have written this line of code: data<-cbind(data[,1],data[,2:6],data[,18],data[,7:17]) to reorder the columns of my dataframe, but I'm losing the column names of my 1st and 18th columns (they are now named data[,1] and data[,18]

[R] Reordering the columns of my dataframe

2009-07-27 Thread Mark Na
Hi R-helpers, I have written this line of code: > data<-cbind(data[,1],data[,2:6],data[,18],data[,7:17]) to reorder the columns of my dataframe, but I'm losing the column names of my 1st and 18th columns (they are now named data[,1] and data[,18] respectively). Can I use cbind to do this (witho

Re: [R] how to correlate nominal variables?

2009-07-27 Thread Mark Difford
Hi Timo, >> I need functions to calculate Yule's Y or Cramérs Index... Are such >> functions existing? Also look at assocstats() in package vcd. Regards, Mark. Timo Stolz wrote: > > Dear R-Users, > > I need functions to calculate Yule's Y or Cramérs Index, in order to > correlate variables

Re: [R] create dataset permanently in package (i.e. default or our own package)

2009-07-27 Thread cls59
Albert EINstEIN wrote: > > Hi, > actually while opening R console and R commander we see some packages like > car and datasets. in this packages we have default datasets are available. > example: women and prestige like that. now i created a sales dataset > importing from excel, xml or text file

Re: [R] computing the radius of an arc

2009-07-27 Thread Nair, Murlidharan T
Alex Brenning, the developer of the RSAGA package told me that and I quote "the RSAGA package (which uses functions from the free geographical information system [GIS] SAGA GIS) has a curvature function that is designed to calculate the curvature of surfaces, in particular raster (i.e. gridded)

Re: [R] probability on a barplot

2009-07-27 Thread Nair, Murlidharan T
Kindly, post the solution to the problem, so that it will benefit others. An example could would be great. Cheers../Murli -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erin Hodgess Sent: Monday, July 27, 2009 1:33 PM To: R help

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Steve Lianoglou
On Jul 27, 2009, at 3:50 PM, Mehdi Khan wrote: the problem is, it works with the example data i gave. however, it does NOT work with the data set i have, which is 600,000 rows. the class is still a data frame. So the problem must be in your data, or what you think is in your data. Some

Re: [R] Working with tables with missing levels

2009-07-27 Thread Andre Nathan
On Mon, 2009-07-27 at 16:34 -0300, Henrique Dallazuanna wrote: > Try this: > > t1 <- prop.table(table(factor(c(0,0,2,4,4), levels = 0:4))) > t2 <- prop.table(table(factor(c(0,2,2,2,3), levels = 0:4))) Is there a way to do this given an already existing table? The problem is that I actually build

Re: [R] Forumla format?

2009-07-27 Thread Steve Lianoglou
Hi, On Jul 27, 2009, at 3:47 PM, Noah Silverman wrote: Hi, I'm not sure that would work for the "formula" format of an SVM function. the idea is normally svm(label ~ c1 + c2 +c3, data=mydata); It doesn't work to say svm(label ~ -c(22,23,24), data=mydata) You're quite right. Sorry, I m

Re: [R] skip plot/blank plot on purpose (multi-plot question)

2009-07-27 Thread Mark Knecht
On Mon, Jul 27, 2009 at 12:21 PM, Bert Gunter wrote: > Well, all of this can be done quite nicely with lattice graphics: ?xyplot > (See, e.g. the "skip" argument) > > > 1) Is there some generic way to call plot and have it plot, but it > plots nothing so I don't see anything at all in position 12?

Re: [R] Forumla format?

2009-07-27 Thread Noah Silverman
Hi, I'm not sure that would work for the "formula" format of an SVM function. the idea is normally svm(label ~ c1 + c2 +c3, data=mydata); It doesn't work to say svm(label ~ -c(22,23,24), data=mydata) On 7/27/09 12:17 PM, Steve Lianoglou wrote: > Hi, > > On Jul 27, 2009, at 3:01 PM, Noah Silv

Re: [R] Working with tables with missing levels

2009-07-27 Thread Henrique Dallazuanna
Try this: t1 <- prop.table(table(factor(c(0,0,2,4,4), levels = 0:4))) t2 <- prop.table(table(factor(c(0,2,2,2,3), levels = 0:4))) On Mon, Jul 27, 2009 at 4:21 PM, Andre Nathan wrote: > Hello > > I'm trying to write a function to calculate the relative entropy between > two distributions. The da

Re: [R] Cross-validating two matrices

2009-07-27 Thread Steve Lianoglou
Hi, On Jul 27, 2009, at 3:29 PM, Brian McCarthy wrote: Hello, I am trying to help a colleague with an R problem (see below) to whit I can only generate a very inelegant solution. Any advice would be welcome. Thanks, Brian If you have two matrices, say a species by trait matrix (Matrix 1

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Steve Lianoglou
On Jul 27, 2009, at 2:54 PM, Mehdi Khan wrote: i am able to return the first column, but anything else returns this: <0 rows> (or 0-length row.names) any idea? I'm not sure what you're doing. The result you're getting happens when no rows "pass" the logical test that you are using to inde

Re: [R] Working with tables with missing levels

2009-07-27 Thread Tal Galili
Hi Andre, Just about expending the table, The way you could do this is by using factors, for example: t1 <- prop.table(table(factor(c(0,0,2,4,4 t2 <- prop.table(table(factor( c(0,2,2,2,3 The rest is for more knowledgeable people then me to say... On Mon, Jul 27, 2009 at 10:21 PM, And

[R] Cross-validating two matrices

2009-07-27 Thread Brian McCarthy
Hello, I am trying to help a colleague with an R problem (see below) to whit I can only generate a very inelegant solution. Any advice would be welcome. Thanks, Brian If you have two matrices, say a species by trait matrix (Matrix 1 below) and a plot by species matrix (Matrix 2 below), i

[R] Working with tables with missing levels

2009-07-27 Thread Andre Nathan
Hello I'm trying to write a function to calculate the relative entropy between two distributions. The data I have is in table format, for example: > t1 <- prop.table(table(c(0,0,2,4,4))) > t2 <- prop.table(table(c(0,2,2,2,3))) > t1 0 2 4 0.4 0.2 0.4 > t2 0 2 3 0.2 0.6 0.2 The re

Re: [R] skip plot/blank plot on purpose (multi-plot question)

2009-07-27 Thread Bert Gunter
Well, all of this can be done quite nicely with lattice graphics: ?xyplot (See, e.g. the "skip" argument) 1) Is there some generic way to call plot and have it plot, but it plots nothing so I don't see anything at all in position 12? This could be a blank plot function I call when I notice the d

Re: [R] Forumla format?

2009-07-27 Thread Steve Lianoglou
Hi, On Jul 27, 2009, at 3:01 PM, Noah Silverman wrote: Hi, Quick question. I'm working on training an SVM. I have a dataframe with about 50 columns. I want to train on 46 of them. Is there a way to say "All except columns 22,23,25 and 31"? Assume your dataframe is called "my.data": m

Re: [R] Searching for specific values in a matrix

2009-07-27 Thread Mehdi Khan
i am able to return the first column, but anything else returns this: <0 rows> (or 0-length row.names) any idea? On Tue, Jul 21, 2009 at 12:49 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > > On Jul 21, 2009, at 3:27 PM, Mehdi Khan wrote: > > I understand your explanation about

[R] Forumla format?

2009-07-27 Thread Noah Silverman
Hi, Quick question. I'm working on training an SVM. I have a dataframe with about 50 columns. I want to train on 46 of them. Is there a way to say "All except columns 22,23,25 and 31"? It would be nice to not have to do +c1 +c2 +c3 +c4, etc for all 48 columns. Thanks! -N [[alternat

Re: [R] how to correlate nominal variables?

2009-07-27 Thread Daniel Malter
Benoit Vaillant made me aware of an indexing mistake in the computation of Cramer's V. The col.sum indexes rows instead of columns. This is a correction of the code: cramers.v=function(x){ x=as.data.frame(x) chisq=0 row.sum=NULL col.sum=NULL row.sum=rowSums(table(x)) col.s

[R] skip plot/blank plot on purpose (multi-plot question)

2009-07-27 Thread Mark Knecht
Hi, Say that I've got a function that has the following code in it: X11(width=10, height=10) layout(rbind(c(1,1,1,2,2,2), c(3,4,5,6,7,8), c(9,10,11,12,13,14)), height=c(3,1,1)) layout.show(14) Sometimes when I call this function it will turn out by design that one or more of the data sets that

Re: [R] Entire Organization Switching from SAS to R - Any experience?

2009-07-27 Thread Kelvin Lam
We've decided not to proceed with the change but the senior management has been alerted with the uprising SAS license cost. Thank you so much for all the comments!!! Frank E Harrell Jr wrote: > > Jeffrey J. Hallman wrote: >> Hmmm, I sense a story in the offing. Was that an accidental emergen

Re: [R] How to deal with this random variable?

2009-07-27 Thread Bert Gunter
This sounds way too complicated for this forum, which is designed to provide help to users on the use of the R language, not remote statistical consulting. While you may receive replies, I would argue that you would do better to find a local statistical expert with whom to work -- not least becaus

Re: [R] dataframe to list conversion

2009-07-27 Thread Jorge Ivan Velez
Hi voidobscura, Try either csum2 <- function(m){ a = data.frame(m) s = lapply(a,sum) do.call(c, s) } or colSums(m) See ?do.call and ?colSums for more details. HTH, Jorge On Mon, Jul 27, 2009 at 11:03 AM, voidobscura wrote: > > Hi all, I have been experimenting with writing my own

Re: [R] dataframe to list conversion

2009-07-27 Thread Dimitris Rizopoulos
have a look at ?unlist(); you can also use sapply() in this case instead of lapply(). Best, Dimitris voidobscura wrote: Hi all, I have been experimenting with writing my own matrix column sum function. I want it to return a list. csum<-function(m) { a = data.frame(m) s = lapply(a,s

[R] Superscripts and rounding

2009-07-27 Thread ehux
I am new to the world of R/programming so this may be a really easy question. I thank you for your patience and help in advance I would like the characters km^2 to be displayed on the plot subtitle as km squared - two as a superscript. I would also like to have the numbers from the data set fo

[R] How to deal with this random variable?

2009-07-27 Thread Manuel Ramon
Hello to everybody, I have a data frame with 100 measures of quality for 3 variables: A, B and C. These quality variables are measured in diferent times along the productive process. My data comes from 5 experiments (5 replicates with 20 measures for replicate). I also have a final measure (Z) but

[R] dataframe to list conversion

2009-07-27 Thread voidobscura
Hi all, I have been experimenting with writing my own matrix column sum function. I want it to return a list. csum<-function(m) { a = data.frame(m) s = lapply(a,sum) return(s) } I wish to use the same code up until the return(s) that I have listed above. The problem is that s,

[R] probability on a barplot

2009-07-27 Thread Erin Hodgess
Please ignore the previous email I figured it out. -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com __ R-help@r-project.org mailing list https://stat

[R] probability on a barplot

2009-07-27 Thread Erin Hodgess
Dear R People: I have a barplot created from a table. What is the best way to set up the barplot such that is shows probability rather totals, please? I've tried plot also but it shows horizontal bars rather than vertical bars. Thanks, Erin -- Erin Hodgess Associate Professor Department of C

[R] plotting a PNG from an in-memory object

2009-07-27 Thread Rajarshi Guha
Hi, I have code which, via rJava can bring up a JFrame to display an image. What I'd like to be able to is to capture that image and make an R plot out of it (analogous to plotting a PNG file, but not from an actual file). I can rite Java code that could be called from R to take a snapshot of the

Re: [R] Determine the dimension-names of an element in an array in R

2009-07-27 Thread Sauvik De
Hi there, Thanks again for your reply. I know for-loop is always a solution to my problem and I had already coded using for-loop. But the number of levels for each dimension is large enough in actual problem and hence it was time-consuming. So, I was just wondering if there are any other alternati

[R] Should nlme's augPred work with a factor covariate?

2009-07-27 Thread Gavin Kelly
I'm having difficulty getting the augPred function from the nlme package to work when the primary covariate is a factor. I don't know if it is intended to work in these situations, but I can't immediately see anything in the documentation that forbids this - ideally I'd like to be able to plot the

Re: [R] Creating new data frame using loop

2009-07-27 Thread Steve Lianoglou
Hi Andy, On Jul 27, 2009, at 12:18 PM, Andrew Aldersley wrote: Hi all, I sent a request round last week asking for help with using a "for" loop to read and separate a large dataset. The response I got worked great, but now I have another problem with using my loop. Basically I have a nu

Re: [R] normal mixture model

2009-07-27 Thread cindy Guo
Hi, Christian, Yes, it works. Thank you very much. It's really helpful. Cindy On Mon, Jul 27, 2009 at 5:39 AM, Christian Hennig wrote: > Hi Cindy, > > you need the summary function > >> mclustsummary <- summary(mclustBICoutputobject,data) >> > to get all the information. Some (like best model)

Re: [R] How should i change the SAS Codes into R Codes?

2009-07-27 Thread John Kane
I see Matt Aldridge has given you the answers to your specific questions. If you are used to using SAS you might find Bob Meunchen's book "Muenchen, R. A. (2008). R for SAS and SPSS Users (1st ed.). Springer." useful. A shorter version is available as a pdf at http://rforsasandspssusers.co

Re: [R] pairs plot

2009-07-27 Thread Greg Snow
Look at the pairs2 function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Jos

Re: [R] numbers on barplot

2009-07-27 Thread Greg Snow
Unless you are intentionally trying to distort your data and make the graph harder to read (you don't want to do that), it is better to put the numbers in the margin rather than at the top of the bars. Try the following line after the barplot: > mtext( dat$NumberOfPeople, side=1, line=1.5, at=

[R] Creating new data frame using loop

2009-07-27 Thread Andrew Aldersley
Hi all, I sent a request round last week asking for help with using a "for" loop to read and separate a large dataset. The response I got worked great, but now I have another problem with using my loop. Basically I have a number of different files containing columned data. There are 132 datas

Re: [R] create dataset permanently in package (i.e. default or our own package)

2009-07-27 Thread Steve Lianoglou
Mr. Einstein, On Jul 27, 2009, at 7:27 AM, Albert EINstEIN wrote: Hi, actually while opening R console and R commander we see some packages like car and datasets. in this packages we have default datasets are available. example: women and prestige like that. now i created a sales dataset i

Re: [R] offset and poisson regression

2009-07-27 Thread Renaud Lancelot
You should use offset(log(Gpc)) instead of offset(Gpc) > options(width = 65) > fm <- glm(NPe ~ 1 + offset(log(GPc)), family = poisson,data = tab) > fitted(fm) 1234678 3.181818 3.818182 3.818182 4.454545 3.181818 3.818182 3.181818 9

Re: [R] How should i change the SAS Codes into R Codes?

2009-07-27 Thread Matt Aldridge
singleSim <- expand.grid(se = 0:100/100, sp = 0:100/100, DR = 0:100/100) singleSim <- within(singleSim, { TR <- (DR+sp-1)/(se+sp-1+1.0e-12) AdjustFactor <- TR/(DR+1.0e-12) }) sampleData <- subset(singleSim, DR == .02 & sp == 1) write.csv(sampleData, "output.csv") Hope this helps

[R] How should i change the SAS Codes into R Codes?

2009-07-27 Thread zhijie zhang
Dear R users, I have a SAS codes with several loops in it, and i hope to use R to do the same task. The SAS codes are as follows, /*to generate the dataset*/ DATA Single_Simulation; DO se=0 to 1 by 0.01; DO sp=0 to 1 by 0.01; DO DR=0 to 1 by 0.01; TR=(DR+sp-1)/(se+sp-1+1.0e-12); Adj

[R] pairs plot

2009-07-27 Thread Jose Narillos de Santos
Hi all, I want to plot trough pairs() plot a matrix with 4 columns. I want to make a trhee plot in a graph. Plotting pairs colum 2,3,4 on y axis and 1 on X axis. You mean (a plot with three graphs) ommitting the first pair with itself. And only the pairs with colum 1 with the other not all pairs.

Re: [R] numbers on barplot

2009-07-27 Thread John Kane
names(dat)<-c("NumberOfPeople","Average") Graph<-barplot(dat$Average) barplot(dat$Average, ylim=c(0,max(dat[,2]+.2))) text(Graph, dat[,2], dat[,1], pos=3) The reason for the ylim is so that the number for the righthand bar does not go outside the plot area. --- On Mon, 7/27/09, Mohsen Jafariki

[R] offset and poisson regression

2009-07-27 Thread Renaud Scheifler
Not sure that the list is the best place for this question, but we are going mad with this... We are trying to fit a poisson regression to count data, eg the number of fledged youngs of blue tits (NPe) as a function of the clutch size (GPc) and other environment variables. Here are the original

Re: [R] downsampling

2009-07-27 Thread Philipp Pagel
On Mon, Jul 27, 2009 at 02:42:33PM +0200, Jan M. Wiener wrote: > However, both approx() and spline() seem to select the number of > required data points from the original data (at the correct positions, > of course) and ignore the remaining data points, as the following > example demonstrates: > >

Re: [R] numbers on barplot

2009-07-27 Thread Nutter, Benjamin
The only thing you're missing is the midpoints of the bars. Since you specified > Graph <- barplot(dat$Average) You can get the midpoints from the Graph object. So to put the number on top of each bar you might use something like: > text(Graph, dat$Average, dat$Average) -Original Message

[R] numbers on barplot

2009-07-27 Thread Mohsen Jafarikia
Hello all, I have this simple barplot code: ifn <- "id.dat" dat <- read.table(ifn) ofn <- "id.png" bitmap(ofn, type = "png256", width = 30, height = 30, pointsize = 30, bg = "white",res=50) par(mar=c(5, 5, 3, 2),lwd=5) par(cex.main=1.6,cex.lab=1.6,cex.axis=1.6) names(dat)<-c("NumberOfPeople","Av

Re: [R] downsampling

2009-07-27 Thread Jan M. Wiener
Dear Philipp and R-Users, thank you very much for the help. However, both approx() and spline() seem to select the number of required data points from the original data (at the correct positions, of course) and ignore the remaining data points, as the following example demonstrates: > a= c(1,0,2

[R] nnet library and FANN package'm

2009-07-27 Thread lucmoulinier
Hello ! I'd like to know to which of the FANN package network corresponds the R nnet network ? In more details, what is the R nnet activation function, what is the training algorithm (rprop, quickprop, ...) ? Also, it seems that the R nnet "decay" parameter in nnet corresponds to the "learning_ra

Re: [R] FW: Qury Related With R

2009-07-27 Thread bed.si...@oracle.com
Hi Romain, Exactly this is the script which I need. Thanks a lot for helping. Romain, Is there any way to modified a particular line in the property file through R script? If yes then please explain how. Cheers! BS -Original Message- From: Romain Francois [mailto:romain.franc

  1   2   >