Re: [R] unique combinations

2011-12-22 Thread Jeff Newmiller
On Wed, 21 Dec 2011, Keith Jewell wrote: Thanks Uwe, I was happy that my 2 lines gave what the OP asked for, albeit in a different order. My puzzlement arose from Jeff Newmillers comment: You could read the help for expand.grid very carefully for the answer to this question. ... which I

[R] Indexing multi-dimensional table

2011-12-22 Thread David A Vavra
I want to take slices of a multi-dimensional table (or array) without knowing the number of dimensions in advance. As a test I tried using (in this example a 3d table): do.call(`[`, list(tbl, x,NULL,NULL)] where I built the list on the fly. It works great as long as I only want

[R] Union/Intersect two continuous sets

2011-12-22 Thread 谢一鸣
Dear All, It is my first time using this mail list to post a question. And I sincerely hope that this will not bother any subscribers. So far as I know, there are functions like union( ), which can help to combine two sets of discrete data. But what if the data sets are with continuous data. For

[R] Processing time on clogit

2011-12-22 Thread Vincent Yau
Hi All, I'm trying to run a conditional logistic regression in R (2.14.0) using clogit from the survival package. The dataset I have is relatively small (300 observations) with 25 matched strata- there are roughly 2 controls for each case, and some strata have multiple case/control groups. When I

Re: [R] Help with code

2011-12-22 Thread 1Rnwb
here is the dump and the code once again, sorry for creating so much noise. c1-structure(list(HTN = structure(c(2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c(, Y), class = factor), HTN_FDR = structure(c(2L, 1L, 1L, 1L, 2L, 1L,

[R] black and white in qplot? layout 4 graphs in one screen

2011-12-22 Thread rachaelohde
Hello, I am trying to plot means and standard errors conditioned by a factor, using qplot. I am successful at getting the bar graph I want with a error bar, however I have tried many things and cannot get the bars to change colors. Currently showing as red and blue, but need it to be black and

Re: [R] column permutation of sparse matrix

2011-12-22 Thread khai
Sorry. I erred somewhere in making the original M1 matrix using sampling call in the spMatrix function. I still don't really understand why the matrix values do not match exactly with M1@x. If I regenerate M1 this way... i=c(1:5,5:1) j=c(1:5,2:6) x=rnorm(10,2) M1 -

[R] Diptest- I'm getting significant values when I shouldn't?

2011-12-22 Thread kbrownk
From library(diptest): Shouldn't the following almost always be non-significant for Hartigan's dip test? dip(x = rnorm(1000)) I get dip scores of around 0.0008 which based on p values taken from the table (at N=1000), using the command: qDiptab, are 0.02 p 0.05. Anyone familiar with

[R] NEWTON ALGORITHM

2011-12-22 Thread Curtis Moyo
Hi, My name is Curtis and I'm a 1st year student in Biochemistry at the University of Geneva. I need some help completing the code for my NEWTON ALGORITHM. It is a bonus exercice to our autumn semester maths exam and we can hand it in or not. Usually people copy and paste but I decided to sit

Re: [R] Non-negativity constraints for logistic regression

2011-12-22 Thread tw
Dear R users, I am currently attempting to fit logistic regression models in R, where the slopes should be restricted to positive values. Although I am aware I guess non-negative, as in the subject line, so there actually is a solution. Indeed, I meant non-negative, zero slopes are also

[R] Trying to use chartSeries in quantmod

2011-12-22 Thread Adrian Berg
colnames = c(date,price) data = read.csv(file=data.csv, sep=,, header=F, nrows=261, skip=5, col.names=colnames) library(quantmod) data date price 1 2011-12-18 13.7825 2 2011-12-11 13.5500 ... ... ... 259 2007-01-07 10.8256 260 2006-12-31 10.8531 261 2006-12-24 10.8169 #

Re: [R] Trying to use chartSeries in quantmod

2011-12-22 Thread Adrian Berg
Thanks to mrflick on Freenode, I was able to get chartSeries to plot the data. data$date-strptime(data$date, format=%Y-%m-%d) dataxts-xts(data$price, order.by=data$date) chartSeries(dataxts) chartSeries(dataxts, type=candlesticks) plots the same graph though: http://i.imgur.com/P0Jh0.png Why is

Re: [R] Trying to use chartSeries in quantmod

2011-12-22 Thread Adrian Berg
Both barChart(dataxts,bar.type='hlc') candleChart(dataxts) give the same results as well. On Wed, Dec 21, 2011 at 11:15 PM, Adrian Berg adrian.ber...@gmail.com wrote: Thanks to mrflick on Freenode, I was able to get chartSeries to plot the data. data$date-strptime(data$date, format=%Y-%m-%d)

Re: [R] Help with code

2011-12-22 Thread 1Rnwb
Thanks Bill, the output of dput was very similar to your example, I was not sure so did not put it on the post. however i uploaded the foo.txt file which contains the part of the data. sharad -- View this message in context: http://r.789695.n4.nabble.com/Help-with-code-tp4218989p4222947.html

Re: [R] NEWTON ALGORITHM

2011-12-22 Thread Uwe Ligges
On 21.12.2011 22:43, Curtis Moyo wrote: Hi, My name is Curtis and I'm a 1st year student in Biochemistry at the University of Geneva. I need some help completing the code for my NEWTON ALGORITHM. It is a bonus exercice to our autumn semester maths exam and we can hand it in or not. Usually

[R] ff object in lapply function

2011-12-22 Thread khai
Hello. I'm using as.ffdf(mydataframe) to create ffdf objects inside an lapply loop and returning that. I then use crbind to combine the lapply results into allData. So...simplified flow looks like this. res - lapply(1:nchunks, function(n) { blah blah with nth chunk

[R] can't find 'predict.loess' in a loop

2011-12-22 Thread Stuart Leask
Season's Greetings. I am using 'predict' in a loop, but it is behaving unexpectedly, so I am more explicit and use 'predict.loess', and R says it can't find it. Even if I explicitly load the stats library, which is already in the search path. Any ideas? This is odd, because if I use RB LB

Re: [R] constrOptim and further arguments

2011-12-22 Thread Uwe Ligges
On 21.12.2011 18:08, Michael Griffiths wrote: Dear List, I have the code below, where I am using the constrained optimisation package, 'constrOptim.nl' to find the values of two values, b0 and b1. I have no problems when I enter further variable information DIRECTLY into the functions, fn,

Re: [R] black and white in qplot? layout 4 graphs in one screen

2011-12-22 Thread Uwe Ligges
On 21.12.2011 21:16, rachaelohde wrote: Hello, I am trying to plot means and standard errors conditioned by a factor, using qplot. I am successful at getting the bar graph I want with a error bar, however I have tried many things and cannot get the bars to change colors. Currently showing as

Re: [R] ff object in lapply function

2011-12-22 Thread Uwe Ligges
On 22.12.2011 07:56, khai wrote: Hello. I'm using as.ffdf(mydataframe) to create ffdf objects inside an lapply loop and returning that. I then use crbind to combine the lapply results into allData. So...simplified flow looks like this. res- lapply(1:nchunks, function(n) {

Re: [R] can't find 'predict.loess' in a loop

2011-12-22 Thread Uwe Ligges
See methods(predict) and find that methods are hidden in the Namespaces and are ought to be accessed by the generic. If you really want to access it explicitly (which i not intended by design), see help(:::) Your code is not reproducible, hence we cannot help in detail. Uwe Ligges On

[R] (no subject)

2011-12-22 Thread Kristi Shoemaker
http://santoencanto.com/next2012.php?did=94cyf=55yp=354i=39 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] can't find 'predict.loess' in a loop

2011-12-22 Thread Prof Brian Ripley
On 22/12/2011 08:55, Uwe Ligges wrote: See methods(predict) and find that methods are hidden in the Namespaces and are ought to be accessed by the generic. If you really want to access it explicitly (which i not intended by design), see help(:::) Your code is not reproducible, hence we cannot

[R] randomforest and AUC using 10 fold CV - Plotting results

2011-12-22 Thread David martin
Here is a snippet to show what i'm trying to do. library(randomForest) library(ROCR) library(caret) data(iris) iris - iris[(iris$Species != setosa),] fit - randomForest(factor(Species) ~ ., data=iris, ntree=50) train.predict - predict(fit,iris,type=prob)[,2]

Re: [R] Indexing multi-dimensional table

2011-12-22 Thread Henrik Bengtsson
On Thu, Dec 22, 2011 at 4:34 AM, David A Vavra dava...@verizon.net wrote: I want to take slices of a multi-dimensional table (or array) without knowing the number of dimensions in advance. As a test I tried using (in this example a 3d table):     do.call(`[`, list(tbl, x,NULL,NULL)]

[R] split with lists

2011-12-22 Thread Stravs, Michael
Hi, I have a list called spec in which a variable foundOK indicates whether or not the given element contains data and must be processed. I have to split the list and process only the good elements, and do something different later on with the bad elements. The code below works. However, is

[R] Stepwise in lme

2011-12-22 Thread Pablo
I'm manually doing a form of stepwise regression in a mixed model but with many variables, it is time consuming. I thought I'd try to use an automated approach. stepAIC gave me false convergence when I used it with my model, so I thought it can't be hard to set up a basic program to do it based

Re: [R] NEWTON ALGORITHM

2011-12-22 Thread Berend Hasselman
delongman wrote Hi, My name is Curtis and I'm a 1st year student in Biochemistry at the University of Geneva. I need some help completing the code for my NEWTON ALGORITHM. It is a bonus exercice to our autumn semester maths exam and we can hand it in or not. Usually people copy and paste

[R] R 2.14.1 is released

2011-12-22 Thread Peter Dalgaard
The byte pixies have rolled up R-2.14.1.tar.gz (codename December Snowflakes) at 9:00 this morning. This is a maintenance release; see the list below for details. You can get it from http://cran.r-project.org/src/base/R-2/R-2.14.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to

[R] levelplot + cut() for custom color palette

2011-12-22 Thread Alex Reynolds
I have the following data as input, from which I would like to make a lattice levelplot: - x y level 1 m3134 m3134 1.000 2 m3134 m416B 0.4189057 3 m416B m3134 0.2696508 4 m3134 mA20 0.3322170 5 mA20 m3134 0.2454191 6 m3134mB 0.3176792 ...

Re: [R] NEWTON ALGORITHM

2011-12-22 Thread Berend Hasselman
Berend Hasselman wrote . g - function(x){ out - (2/(3))*exp(x^2)-(20)*log(x) return(out) } gp - function(x) { out - (4/3)*exp(x) - 20/x return(out) } function gp is incorrect. It should be gp - function(x) { out - (4/3)*x*exp(x^2) - 20/x

Re: [R] Stepwise in lme

2011-12-22 Thread Ben Bolker
Pablo pschatfield at gmail.com writes: I'm manually doing a form of stepwise regression in a mixed model but with many variables, it is time consuming. I thought I'd try to use an automated approach. stepAIC gave me false convergence when I used it with my model, so I thought it can't be

Re: [R] Stepwise in lme

2011-12-22 Thread Frank Harrell
Stepwise regression without proper penalization is invalid. Frank Pablo wrote I'm manually doing a form of stepwise regression in a mixed model but with many variables, it is time consuming. I thought I'd try to use an automated approach. stepAIC gave me false convergence when I used it

[R] overlaid filled contour plots

2011-12-22 Thread Michael Friendly
I'm trying to make a set of contour plots of bivariate kernel density estimates, showing three such plots overlaid, similar to this plot http://euclid.psych.yorku.ca/SCS/Private/Test/ridge-boot2.pdf except that I would like to have the contours *filled* (using transparent colors). To make

Re: [R] Indexing multi-dimensional table

2011-12-22 Thread David Winsemius
On Dec 21, 2011, at 10:34 PM, David A Vavra wrote: I want to take slices of a multi-dimensional table (or array) without knowing the number of dimensions in advance. As a test I tried using (in this example a 3d table): do.call(`[`, list(tbl, x,NULL,NULL)] Surely that was meant to be:

[R] Error message with glm

2011-12-22 Thread Abraham Mathew
I'm working on a logistic regression in R with the car package but keep getting the following error message. It's only and warning and not an error, but I'm just not sure how to resolve the issues. glm.fit: algorithm did not converge glm.fit: fitted probabilities numerically 0 or 1 occurred d1

[R] Calling R functions from C++ under VS2005

2011-12-22 Thread Jawad Elomari
Hi, I'm trying to call some of R's statistical functions within my C++ code, developed under VS2005, but I can't seem to find out how to do it. I tried RInside and Rcpp, but they either don't work on Windows or with VS. Is there a way to do this? Appreciate the help. Regards,

[R] finding overlapping regions

2011-12-22 Thread Naveen Thota
Dear All, I am trying to finding overlapping regions in two diff datasets for that I am using IRanges. But I am getting an error in the process of doing the overlap. Advance thanks df3.rl-RangedData(IRanges(start=df3$V3,width=1), + space=df3$start) Error in .normargSEW0(start, start) : 'start'

Re: [R] Using wdTable() within R2wd package‏

2011-12-22 Thread Joann Zhuo
Hi Tal, Thank you very much! I ran your codes in the example session, but if you see the output by the codes of wdTable(format(head(mtcars))) and wdTable(head(mtcars)) in the word file, the two tables have the same kind of problems. If you drag the bottom line of the first row down to make the

Re: [R] Union/Intersect two continuous sets

2011-12-22 Thread Hans W Borchers
谢一鸣 cutexym at gmail.com writes: Dear All, It is my first time using this mail list to post a question. And I sincerely hope that this will not bother any subscribers. So far as I know, there are functions like union( ), which can help to combine two sets of discrete data. But what if the

Re: [R] Trying to use chartSeries in quantmod

2011-12-22 Thread R. Michael Weylandt michael.weyla...@gmail.com
I believe (unchecked) that you need OHLC data for candlesticks. You can use to.TTT functions to make some from your daily data. Michael On Dec 21, 2011, at 11:52 PM, Adrian Berg adrian.ber...@gmail.com wrote: Both barChart(dataxts,bar.type='hlc') candleChart(dataxts) give the same results

Re: [R] Calling R functions from C++ under VS2005

2011-12-22 Thread Dirk Eddelbuettel
On 22 December 2011 at 15:25, Jawad Elomari wrote: | I'm trying to call some of R's statistical functions within my C++ | code, developed under VS2005, but I can't seem to find out how to do i) As has been stated fairly frequently, R itself does not build under VS* making the linking of C

[R] mtrace function

2011-12-22 Thread Enio Jelihovschi
I use windows xp. When trying to use the function mtrace from package debug the window that should open with the function to be debugged do not show any text at all. It shows only a part of my desktop. Does anyone know why. Is there any imcompatibility between windows xp and debug package. Thanks

Re: [R] qqnorm huge datasets

2011-12-22 Thread Sam Steingold
* peter dalgaard cqn...@tznvy.pbz [2011-12-21 23:59:18 +0100]: On Dec 21, 2011, at 23:10 , Sam Steingold wrote: When qqnorm on a vector of length 10M+ I get a huge pdf file which cannot be loaded by acroread or evince. Any suggestions? (apart from sampling the data). Sample intelligently?

Re: [R] finding overlapping regions

2011-12-22 Thread Martin Morgan
On 12/22/2011 05:50 AM, Naveen Thota wrote: Dear All, I am trying to finding overlapping regions in two diff datasets for that I am using IRanges. But I am getting an error in the process of doing the overlap. Advance thanks df3.rl-RangedData(IRanges(start=df3$V3,width=1), + space=df3$start)

Re: [R] Processing time on clogit

2011-12-22 Thread Terry Therneau
--- begin included message --- I'm trying to run a conditional logistic regression in R (2.14.0) using clogit from the survival package. The dataset I have is relatively small (300 observations) with 25 matched strata- there are roughly 2 controls for each case, and some strata have multiple

Re: [R] Indexing multi-dimensional table

2011-12-22 Thread David A Vavra
(This does imply you knew the number of dimensions was 3.) Yes, at run time. It looks as though the Nulls became 0's. So if you wanted to use do.call(`[` then this succeeds: do.call(`[`, list(tbl, x, 1:dim(tbl)[2], 1:dim(tbl)[3]) ) ... As does this using the empty comma approach:

Re: [R] qqnorm huge datasets

2011-12-22 Thread peter dalgaard
On Dec 22, 2011, at 18:17 , Sam Steingold wrote: * peter dalgaard cqn...@tznvy.pbz [2011-12-21 23:59:18 +0100]: On Dec 21, 2011, at 23:10 , Sam Steingold wrote: When qqnorm on a vector of length 10M+ I get a huge pdf file which cannot be loaded by acroread or evince. Any suggestions? (apart

[R] Finding predicted probabilities

2011-12-22 Thread Abraham Mathew
I ran three logit models in R with the Zelig package and I'm trying to compute the predicted probabilities for a number of different values on the independent variable. My dep variable was accepted or decline and my indep variable is bid amount, and varies. So for a bid amount of 3, what's the

[R] try to silence errors

2011-12-22 Thread statfan
I am trying to use the dmt function in the package {mnormt}. Throughout my algorithm, the covariance matrix is sometime calculated to be singular. When attempting to calculate the dmt function with a covariance that is not positive definite, I would like it to return Inf or NaN instead of an

Re: [R] Error message with glm

2011-12-22 Thread Abraham Mathew
I just realized that mwin had three levels. I went ahead and deleted one of them. summary(mwin) table(mwin) mwin = factor(mwin) levels(mwin) mwin = mwin mwin[mwin %in% levels(mwin)[1]] - NA mwin = factor(mwin) levels(mwin) mwin = factor(mwin, levels=c(DECLINED,ACCEPTED)) On Thu, Dec 22, 2011

Re: [R] Non-negativity constraints for logistic regression

2011-12-22 Thread Ravi Varadhan
Hi Thomas, Using box-constrained optimizer in glm.fit is a good suggestion for finding the point estimates. However, there is still the issue of making inference, i.e., computing the variances and p-values for the estimates. You have to deal with the issue of MLE possibly being on the

Re: [R] try to silence errors

2011-12-22 Thread MacQueen, Don
Something like the following may be what you are looking for. try.out - try(dmt(y[,j],new$mu[,,4],sigij,ceiling(new$nu[4])),silent=TRUE) if (class(try.out) == 'try-error'} ) { out - NaN } else { out - try.out } -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave.,

Re: [R] R Source Code Request Office For National Statistics UK

2011-12-22 Thread csrabak
Em 21/12/2011 11:22, Uwe Ligges escreveu: On 21.12.2011 14:25, David Winsemius wrote: There are no restrictions needed. Any of your staff can view the (open) source code just as any other member of the human race I do not think the GPL excludes other species ... Since the null hypothesis

Re: [R] Indexing multi-dimensional table

2011-12-22 Thread davavra
From help([, package=base): An index value of NULL is treated as if it were integer(0).. Yeah, I should have read it better. I don't think there is an easy way to achieve: y[,2:3,1,drop=FALSE] using do.call([) without explicitly specify the indices for that missing dimension, i.e. ...

Re: [R] Using wdTable() within R2wd package‏

2011-12-22 Thread Tal Galili
Hi Joann, I am not sure I followed you. My suggestion for you is actually to ask about this here: http://superuser.com/ Cheers, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me:

[R] Renaming Within A Function

2011-12-22 Thread Pete Brecknock
I am trying to rename column names in a dataframe within a function. I am seeing an error (listed below) that I don't understand. Would be grateful of an explanation of what I am doing wrong and how I should rewrite the function to allow me to be able to rename my variables. Thanks. # Test

Re: [R] Indexing multi-dimensional table

2011-12-22 Thread William Dunlap
Continuing the annnoying tradition of partial quotes: I don't think there is an easy way to achieve: y[,2:3,1,drop=FALSE] , , c1 b2 b3 a1 3 5 a2 4 6 using do.call([) without explicitly specify the indices for that missing dimension, i.e.

Re: [R] Renaming Within A Function

2011-12-22 Thread jim holtman
Why do you want to create a variable within the function since it will disappear after the return. Is there a reason for that? Here is one way of getting the names by just using them on the cbind. Also you are create a 'matrix' and 'names' is not appropriate for that type of object. # Test

Re: [R] qqnorm huge datasets

2011-12-22 Thread cberry
Sam Steingold s...@gnu.org writes: Hi, When qqnorm on a vector of length 10M+ I get a huge pdf file which cannot be loaded by acroread or evince. Any suggestions? (apart from sampling the data). Thanks. Following the other suggestions, I did not notice mention of another trick for slimming

Re: [R] qqnorm huge datasets

2011-12-22 Thread Bert Gunter
Chuck: A bad idea, I think: Rounding to unique values loses data density, while sampling preserves it (to display resolution -- also a form of rounding). -- Bert On Thu, Dec 22, 2011 at 11:10 AM, cbe...@tajo.ucsd.edu wrote: Sam Steingold s...@gnu.org writes: Hi, When qqnorm on a vector of

Re: [R] Diptest- I'm getting significant values when I shouldn't?

2011-12-22 Thread Duncan Murdoch
On 21/12/2011 3:37 PM, kbrownk wrote: From library(diptest): Shouldn't the following almost always be non-significant for Hartigan's dip test? dip(x = rnorm(1000)) Well, it should be non-significant about 95% of the time I get dip scores of around 0.0008 which based on p values taken from

Re: [R] Indexing multi-dimensional table

2011-12-22 Thread David A Vavra
From: William Dunlap [mailto:wdun...@tibco.com] You can build the 2nd argument to do.call with alist() instead. alist() produces a list that you can use c() and subscripting on to add or modify arguments. It is usually better to encapsulate this sort of thing in a function like extract() that

Re: [R] Renaming Within A Function

2011-12-22 Thread Greg Snow
The error is because you are trying to assign to the result of a get call, and nobody has programmed that (hence could not find function) because it is mostly (if not completely) meaningless to do so. It is not completely clear what you want to accomplish, but there is probably a better way to

[R] large data set (matrix) using image()

2011-12-22 Thread Karen Liu
When I use the image() function for a relatively small matrix it works perfectly, eg.x - 1:100 z - matrix(rnorm(10^4),10^2,10^2) image(x=x,y=x,z=z,col=rainbow(3))but when I want to plot a larger matrix, it doesn't really work. Most of the times, it just plot a few intermitent points.x -

[R] contraints in ltm package

2011-12-22 Thread Alexander Schwall
Hello all, I have a brief IRT related question regarding the ltm package. I am am using tpm which is part of the ltm package. I am constraining the item parameters for this package since they have been estimated earlier. I notice that the difficulty parameter changes, despite the fact that it is

[R] Axis manipulation in Stackpoly (Plotrix)

2011-12-22 Thread Ben Neal
Have made a stacked area plot, but now want to manipulate the x axis: make in even increments (50) in order to suppress the tick marks (forming solid bar under plot). However, the plot functions do not seem to work, and I cannot find documentation for use of xat in stackpoly. This is a time

Re: [R] Diptest- I'm getting significant values when I shouldn't?

2011-12-22 Thread kbrownk
Thanks, I found dip.test after posting. I reread the original paper and found that the probability is that the dip is less than the given dip score. Less here is ambiguous to me, and it is strange that dip.test interpolates from the same p value lookup table I was using (gDiptab), but returns very

Re: [R] qqnorm huge datasets

2011-12-22 Thread cberry
Bert Gunter gunter.ber...@gene.com writes: Chuck: A bad idea, I think: Rounding to unique values loses data density, while sampling preserves it (to display resolution -- also a form of rounding). Bert, The subject is qqnorm huge datasets. Downsampling for qqplots produces unreliable

[R] PCA in r

2011-12-22 Thread Mark
Hello Would anyone be able to direct me to information on how to perform a straightforward Principal Components Analysis in r?  Including the data file set-up?  I'm rather new to r and not having much luck. I'm pretty certain I have the data entered into the txt file properly but when I try

[R] Adding math symbols to axis labels

2011-12-22 Thread tamre
I am trying to get mdots^-1 in a x-axis label for a publication ready graph. I can get ms^-1 with no problem, but I can't get the symbol for the dot to work. I am have tried the following: plot(x,y,xlab=expression(paste(Target Velocity (,ms^-1,))),ylab=Passage Probability,ylim=c(0,1)) which

[R] delete all columns with all values equal to zero

2011-12-22 Thread Frederico Mestre
Hello all: I'm sure this is quite simple, but I tried several options and I still can't get I right. I've got a data.frame and I want to delete all columns of which the sum is zero. Any ideas? Thanks, Frederico Mestre [[alternative HTML version deleted]]

Re: [R] PCA in r

2011-12-22 Thread Sarah Goslee
You'll get more useful answers if you tell us what you did, and provide a reproducible example. For instance, a bit of your data using dput(), your sessionInfo(), str() for your data, and the actual commands you're using to run PCA, as well as the error messages you're getting. The clearer you

[R] Help transforming a dist

2011-12-22 Thread Taral
I'd like to convert a dist into a table/matrix/thingy of the form: A B value A C value B C value (assuming the dist was over 3 names). Is there a way to do this without using a for loop? -- Taral tar...@gmail.com Please let me know if there's any further trouble I can give you.     -- Unknown

[R] Help creating a symmetric matrix?

2011-12-22 Thread Matt Considine
Hi, I am trying to work with the output of the MINE analysis routine found at http://www.exploredata.net Specifically, I am trying to read the results into a matrix (ideally an n x n x 6 matrix, but I'll settle right now for getting one column into a matrix.) The problem I have is not

Re: [R] delete all columns with all values equal to zero

2011-12-22 Thread Sarah Goslee
Hi, On Thu, Dec 22, 2011 at 4:54 PM, Frederico Mestre mestre.freder...@gmail.com wrote: Hello all: I'm sure this is quite simple, but I tried several options and I still can't get I right. I've got a data.frame and I want to delete all columns of which the sum is zero. If this, then

Re: [R] Help transforming a dist

2011-12-22 Thread Sarah Goslee
I'm not at all sure what you mean with your matrix: is that supposed to be three columns? What about: fakedata - data.frame(X=runif(3), Y = runif(3)) rownames(fakedata) - c(A, B, C) dist(fakedata) A B B 0.8617733 C 0.3813032 0.5124284 data.frame(t(combn(rownames(fakedata),

Re: [R] Adding math symbols to axis labels

2011-12-22 Thread David Winsemius
On Dec 22, 2011, at 4:16 PM, tamre wrote: I am trying to get mdots^-1 in a x-axis label for a publication ready graph. I can get ms^-1 with no problem, but I can't get the symbol for the dot to work. I am have tried the following: plot(x,y,xlab=expression(paste(Target Velocity

Re: [R] delete all columns with all values equal to zero

2011-12-22 Thread Peter Alspach
Tena koe Frederico Something like yourDF[, apply(yourDF, 2, sum)!=0] HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Frederico Mestre Sent: Friday, 23 December 2011 10:55 a.m. To: r-help@r-project.org

Re: [R] delete all columns with all values equal to zero

2011-12-22 Thread Jorge I Velez
Dear Frederico, Try d[, rowSums(d) != 0] where d is your data.frame(). HTH, Jorge.- On Thu, Dec 22, 2011 at 4:54 PM, Frederico Mestre wrote: Hello all: I'm sure this is quite simple, but I tried several options and I still can't get I right. I've got a data.frame and I want to

Re: [R] delete all columns with all values equal to zero

2011-12-22 Thread Jorge I Velez
Sorry for the noise, it should have been colSums(d) instead of what I wrote. My apologies. HTH, Jorge.- On Thu, Dec 22, 2011 at 10:43 PM, Jorge I Velez wrote: Dear Frederico, Try d[, rowSums(d) != 0] where d is your data.frame(). HTH, Jorge.- On Thu, Dec 22, 2011 at 4:54 PM,

Re: [R] On Corrections for Chi-Sq Goodness of Fit Test

2011-12-22 Thread Rolf Turner
On 20/12/11 10:24, Michael Fuller wrote: TOPIC My question regards the philosophy behind how R implements corrections to chi-square statistical tests. At least in recent versions (I'm using 2.13.1 (2011-07-08) on OSX 10.6.8.), the chisq.test function applies the Yates continuity correction

[R] p values in lmer

2011-12-22 Thread arunkumar1111
hi How to get p-values for lmer funtion other than pvals.fnc(), since it takes long time for execution - Thanks in Advance Arun -- View this message in context: http://r.789695.n4.nabble.com/p-values-in-lmer-tp4227434p4227434.html Sent from the R help mailing list archive at

Re: [R] p values in lmer

2011-12-22 Thread David Winsemius
On Dec 22, 2011, at 11:13 PM, arunkumar wrote: hi How to get p-values for lmer funtion other than pvals.fnc(), since it takes long time for execution http://psy-ed.wikidot.com/glmm http://glmm.wikidot.com/faq -- David Winsemius, MD West Hartford, CT