Re: [R] an incredibly trivial question about nls

2014-07-01 Thread Peter Langfelder
On Tue, Jul 1, 2014 at 1:27 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Hello R People: I'm having a forest/trees location problem with the output of nls. If I save the output to an object, and print the object, it shows, amongst other things, the residual sum of squares. I would like

Re: [R] Identifying one or more TRUE in the middle of an array

2014-06-06 Thread Peter Langfelder
Not sure if this is better than your brute force and you may be able to simplify it... notStart = function(x) { n = length(x) i0 = which(x); n0 = length(i0); i0!=c(1:n)[1:n0]; } notStartNorEnd = function(x) { which(x)[notStart(x) rev(notStart(rev(x)))] } notStartNorEnd(c(F, F, F))

Re: [R] WGCNA on heterogeneous RNA-seq

2014-05-15 Thread Peter Langfelder
Hi Pan, On Wed, May 14, 2014 at 9:14 PM, Panos Bolan panbo...@hotmail.com wrote: Dear list, Apologies for posting this to both Bioconductor and here. I recently read a Bioconductor post where the developer of the WGCNA suggested the use of the package for RNA-seq data analysis after

Re: [R] Error during working with wgcna and R

2014-05-09 Thread Peter Langfelder
WGCNA maintainer here. When working with a large data set, you have a few options. 1. Without being snarky, the best option is to get (or get access to) a computer with large-enough RAM. Many universities, departments, and other research institutes have computer clusters with nodes with at least

Re: [R] R Cairo Installation - Cannot find cairo.h!

2014-04-28 Thread Peter Langfelder
Make sure you have cairo-devel installed, and remove the lines export CAIRO_LIBS=${HOME}/usr/local/lib export CAIRO_CFLAGS=${HOME}/usr/local/include from your .bashrc file. If you have cairo-devel installed normally, the headers should be found with default settings of all search paths. The

Re: [R] R Cairo Installation - Cannot find cairo.h!

2014-04-28 Thread Peter Langfelder
HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_STRING_H 1 | #define HAVE_SYS_TIME_H 1 | #define HAVE_UNISTD_H 1 | /* end confdefs.h. */ On Mon, Apr 28, 2014 at 7:50 PM, Peter Langfelder peter.langfel...@gmail.com wrote: On Mon, Apr 28, 2014 at 7:14 PM, Fong Chun Chan fongchunc

Re: [R] Fwd: problem with kmeans

2014-04-28 Thread Peter Langfelder
You are using the wrong algorithm. You want Partitioning around Medoids (PAM, function pam), not k-means. PAM is also known as k-medoids, which is where the confusion may come from. use library(cluster) cl = pam(dis, 4) and see if you get what you want. HTH, Peter On Mon, Apr 28, 2014 at

Re: [R] about rect.hclust

2014-04-25 Thread Peter Langfelder
On Fri, Apr 25, 2014 at 6:35 PM, chris Jhon cjhon...@gmail.com wrote: Hi, I am using hclust and cutree to cluster a data frame y and cut it into few clusters as follows y V1 V2 V3 V4 A 1 2 3 4 B 5 6 7 8 C 9 10 11 12 D 13 14 15 16 E 17 18 19 20

Re: [R] Memory allocation using .C interface

2014-04-09 Thread Peter Langfelder
On Wed, Apr 9, 2014 at 11:27 AM, Cassiano dos Santos crn...@gmail.com wrote: I am testing a call to a C function from R, using .C interface. The test consists in passing a numeric vector to the C function with no entries, dynamically allocates n positions, makes attributions and return the

Re: [R] Random Forest, Variable Mismatch

2014-02-15 Thread Peter Langfelder
On Sat, Feb 15, 2014 at 8:43 AM, Lorenzo Isella lorenzo.ise...@gmail.com wrote: Dear All, I am a bit puzzled. I am developing a random forest model. The data is large and it involves hundred of predictors, but the code I have written is relatively simple. After training my random forest

Re: [R] Understanding namespace for plyr / dplyr

2014-01-29 Thread Peter Langfelder
In short, use dplyr::summarize or plyr::summarize to select the one you want. HTH, Peter On Wed, Jan 29, 2014 at 2:19 PM, Trevor Davies davies.tre...@gmail.com wrote: I think I have a hole in my understanding of how R uses packages (or at least how it gives functions in packages priority). I

Re: [R] counting matched elements in two vectors

2014-01-23 Thread Peter Langfelder
Here's a solution: # This gives a vector of counts (if z is a data frame, first convert it to a matrix) res = sapply(as.vector(z), function(x) sum(w==x)) # This copies the dimensions of the variable 'z' to 'res': dim(res) = dim(z) Peter On Thu, Jan 23, 2014 at 7:43 AM, m.beza...@lse.ac.uk

Re: [R] What purpose is served by reflexive function assignments?

2013-12-28 Thread Peter Langfelder
On Sat, Dec 28, 2013 at 7:27 PM, Andrew Hoerner ahoer...@rprogress.org wrote: Let us suppose that we have a function foo(X) which is called inside another function, bar(). Suppose, moreover, that the name X has been assigned a value when foo is called: X - 2 bar(X=X){ foo(X) } I have

Re: [R] method default for hclust function

2013-12-12 Thread Peter Langfelder
On Thu, Dec 12, 2013 at 3:09 PM, capricy gao capri...@yahoo.com wrote: I could not figure out what was the default when I ran hclust() without specifying the method. According to help(hclust), the default method is complete linkage. HTH, Peter __

Re: [R] fisher.test - can I use non-integer expected values?

2013-12-10 Thread Peter Langfelder
On Tue, Dec 10, 2013 at 6:55 PM, bakerwl bake...@uwyo.edu wrote: Expected values are needed to test a null hypothesis against observed counts, but if total observed counts are 20 for 3 categories, then a null hypothesis of a random effect would use expected values = 6.67 in each of the 3

Re: [R] Chart colors

2013-12-09 Thread Peter Langfelder
On Mon, Dec 9, 2013 at 2:08 PM, Katharine Miller - NOAA Federal katharine.mil...@noaa.gov wrote: Hello, I am having difficulty obtaining the correct colors in my R charts. colors()[c(552, 254, 26)] [1] red green blue But, if I specify col=552 in my barplot, I get gray bars. Likewise,

Re: [R] How can I use muliple cores of CPU in Windows or OS X?

2013-11-05 Thread Peter Langfelder
On Tue, Nov 5, 2013 at 3:36 PM, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 06.11.2013 00:26, Simon Pickert wrote: Mcapply from package 'parallel'. Also see package 'multicore' Not mcapply: it won't work under Windows that the OP asked for. But package parallel is the right

Re: [R] hclust/dendrogram merging

2013-09-16 Thread Peter Langfelder
Joshua, I'm not sure I understand your aim correctly, but if I do, here's my advice: If you are able to find the clusters according to rows or columns using clustering, you must be using some kind of a distance matrix that encodes whether two antibodies should be in one bin for rows, and a

[R] Avoiding copies in list assignments

2013-08-23 Thread Peter Langfelder
One more question about avoiding copies when modifying lists. I would like to call a function (call it 'f') that does an operation on a large array according to a given index. For example f = function(data, index) sum(data[index]) The idea is to repeatedly call f() with the same 'data' but

Re: [R] p values for partial correlations

2013-08-08 Thread Peter Langfelder
I am not an expert on shrinkage estimators of partial correlations (such as the one in corpcor), but my sense is that it is difficult to provide a good estimate of a p-value. You could try to email the authors of the package and ask them, but this may be more of a statistics rather than R

Re: [R] readTiff - Sorry can't handle images with 32-bit samples

2013-07-26 Thread Peter Langfelder
Disclaimer: I haven't seen your tif file and I know nothing about readTiff... but here go some general comments. TIF files can use different bit depths (number of bits to store each pixel (or each color for each pixel). Most common software outputs 8- or 16-bits, but your file probably has a

Re: [R] .eps files and powerpoint

2013-07-25 Thread Peter Langfelder
On Thu, Jul 25, 2013 at 9:30 AM, Richard M. Heiberger r...@temple.edu wrote: On Vista with Powerpoint 2007, file2.eps crashes powerpoint, Once file.eps displayed, several times it crashed powerpoint. My task is now to see if ghostscript can read a pdf or ps or eps and convert it to png at

Re: [R] Installing OpenBLAS in R

2013-07-11 Thread Peter Langfelder
[cc-ing the list] On Wed, Jul 10, 2013 at 11:36 PM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Hello again, I was wondering if it is possible to install OpenBLAS linear algebra library in R running under windows. You will have to re-compile R from source and re-install it.

Re: [R] Installing R on Fedora 18 Linux?

2013-07-06 Thread Peter Langfelder
You have several options. You can use theF18 package manager to install R directly from a Fedora software repository but the R may be slightly out of date (IIRC Fedora 19 provides R-3.0.0; not sure about F18). Or, on your CRAN mirror page, ignore the Download and install R section and go

Re: [R] R not loading

2013-04-22 Thread Peter Langfelder
On Mon, Apr 22, 2013 at 1:15 PM, Barbour, Russell russell.barb...@yale.edu wrote: I am having a problem with loading R on my 64 bit computer. It used to load perfectly until I upgraded to R 3.0.0 now it takes about 10 to even 20 minutes ? Does anyone know how to remedy this problem?

Re: [R] proper way to handle obsolete function names

2013-04-17 Thread Peter Langfelder
On Wed, Apr 17, 2013 at 10:36 AM, R. Michael Weylandt michael.weyla...@gmail.com It sounds like you want .Deprecate ?.Deprecate Perhaps you meant Deprecated? ?Deprecated Best, Peter __ R-help@r-project.org mailing list

Re: [R] How to transpose it in a fast way?

2013-03-06 Thread Peter Langfelder
On Wed, Mar 6, 2013 at 4:18 PM, Yao He yao.h.1...@gmail.com wrote: Dear all: I have a big data file of 6 columns and 6 rows like that: AA AC AA AA ...AT CC CC CT CT...TC .. . I want to transpose it and the output is a new

Re: [R] cutreeDynamic error

2013-02-26 Thread Peter Langfelder
On Tue, Feb 26, 2013 at 8:34 AM, Joanna Papakonstantinou joanna.p...@gmail.com wrote: So I realized I had to convert my dd.daisy to a matrix and used: ddmatrix.daisy-as.matrix(dd.daisy) and then I passed that in as the distM: cutreeDynamic(as.hclust(dd.diana), cutHeight = NULL, minClusterSize

Re: [R] rbind Missing Something: Need New Eyes

2013-01-31 Thread Peter Langfelder
On Thu, Jan 31, 2013 at 3:55 PM, Rich Shepard rshep...@appl-ecosys.com wrote: I don't see what's missing in my statements to add rows to a data frame and someone else will probably see what needs to be added to the statements. The data frame has this structure (without any data): $

Re: [R] csv mask order

2013-01-22 Thread Peter Langfelder
Do your lines start with the hash mark #? If so, they are considered comment. Set comment.char= in your call to read.csv. Another frequent culprit (personal experience) are apostrophes ('). If you have any in your file, use the argument quote = \ or, if you are sure the data are not quoted, use

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread Peter Langfelder
On Thu, Jan 17, 2013 at 4:57 AM, vaseem shaikh vsma...@gmail.com wrote: But still, i am also trying to install the package by locally giving absolute path with repos= Null and type = Source, will CRAN have any role to play here??? To compile a package on Windows, you need to install R tools

[R] Solved Re: Garbage collection problem

2013-01-03 Thread Peter Langfelder
:41 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 13-01-03 7:01 PM, Peter Langfelder wrote: Hello all, I am running into a problem with garbage collection not being able to free up all memory. Unfortunately I am unable to provide a minimal self-contained example, although I can provide

Re: [R] Large loops in R

2012-12-04 Thread Peter Langfelder
On Tue, Dec 4, 2012 at 11:27 AM, Charles Novaes de Santana charles.sant...@gmail.com wrote: Dear Michael, Thank you for your answer. I have 2 matrices. Each position of the matrices is a weight. And I need to calculate the following sum of differences: Considering: mat1 and mat2 - two

Re: [R] Different results from random.Forest with test option and using predict function

2012-12-03 Thread Peter Langfelder
On Mon, Dec 3, 2012 at 3:30 PM, tdbuskirk trent.busk...@nielsen.com wrote: Hello R Gurus, I am perplexed by the different results I obtained when I ran code like this: set.seed(100) test1-randomForest(BinaryY~., data=Xvars, trees=51, mtry=5, seed=200) predict(test1,

Re: [R] qbinom

2012-11-30 Thread Peter Langfelder
On Fri, Nov 30, 2012 at 9:47 AM, jaybell stephe...@yahoo.com.tw wrote: a=c(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9) b=c(0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1) cor(a,b)= -1 a'=qbinom(a, 1, 0.5) b'=qbinom(b, 1, 0.5) why cor(a',b') becomes -0.5 ? On my computer the correlation is

Re: [R] Fast Normalize by Group

2012-11-29 Thread Peter Langfelder
Not tested but should work: sums = tapply(x, group, sum); sums.ext = sums[ match(group, names(sums))] normalized = x/sums.ext It may be that the tapply is just as slow as your loop though, I'm not sure. HTH, Peter On Thu, Nov 29, 2012 at 10:55 AM, Noah Silverman noahsilver...@ucla.edu wrote:

Re: [R] what's this character?

2012-11-28 Thread Peter Langfelder
On Wed, Nov 28, 2012 at 4:44 PM, Shi, Tao shida...@yahoo.com wrote: Hi list, I've encounter this problem (see below). I know it's particularly R-related and it's easy to get by but it still bothers me a lot. It looks the last character of N.C. is a space to me, but it's clearly not.

Re: [R] Code works, but not as function.

2012-11-15 Thread Peter Langfelder
On Thu, Nov 15, 2012 at 5:48 PM, Benjamin Ward (ENV) b.w...@uea.ac.uk wrote: Hi, I have some values in a list format generated by the following: Path_Number - 0010 ID.Path - formatC(0001:Path_Number, width=4, flag=0) # Make vector of ID's. No_of_Effectors - sample(1:550, length(ID.Path),

Re: [R] subset a defined row plus the aforegoing

2012-11-01 Thread Peter Langfelder
On Thu, Nov 1, 2012 at 10:28 AM, Hermann Norpois hnorp...@googlemail.com wrote: Hello, my data is sorted by start.ens (see below). And now I would like to extract all rows (so called* defined row*s) with type==Expression - subset (df, type==Expression) - and the aforegoing type==DNase HS

Re: [R] parallel processing with foreach

2012-10-25 Thread Peter Langfelder
It seems you don't quite understand how foreach works. foreach (..) %dopar% { ... } takes the last value from each of the second {...} evaluations and feeds them to the .combine function (in your case rbind()). Since your last call in the %dopar% {...} block is assign(), you are not getting

Re: [R] WGCNA: Combining block-wise dendrograms and modules into a single figure

2012-10-18 Thread Peter Langfelder
currently learning to use R, so please forgive me if there is an obvious explanation for the following problem. My goal is to perform WGCNA on a dataset of 19776 genes, so I opted to follow the block-wise network construction (Section 2c) in the WGCNA R Tutorial by Peter Langfelder and Steve

Re: [R] Error in if (is.na(n) || n 65536L) stop(size cannot be NA nor exceed 65536) : missing value where TRUE/FALSE needed

2012-10-09 Thread Peter Langfelder
On Tue, Oct 9, 2012 at 4:37 PM, eliza botto eliza_bo...@hotmail.com wrote: Dear useRs, i am using NbClust to determine appropriate number of cluster for hclustering. i am consistently getting the following error Error in if (is.na(n) || n 65536L) stop(size cannot be NA nor exceed 65536)

Re: [R] Error in if (is.na(n) || n 65536L) stop(size cannot be NA nor exceed 65536) : missing value where TRUE/FALSE needed

2012-10-09 Thread Peter Langfelder
Hi Eliza, this is not __reproducible__ code - how am I supposed to know what's wrong when I don't have the input files you use? Please read the help for NbClust carefully and check that all your input variables have the correct dimensions. Some of the input seems strange, for example the z matrix

Re: [R] Up key is not the previous command

2012-10-08 Thread Peter Langfelder
run capabilities(what=cledit) in your R terminal session. If you get FALSE, your R was compiled without command line editing support which you need for the up arrow action. Peter On Mon, Oct 8, 2012 at 8:04 PM, Tjun Kiat Teo teotj...@gmail.com wrote: I am using R on Fedora 17 and the up arrow

Re: [R] Creating tiff with 1200 dpi

2012-10-03 Thread Peter Langfelder
Well, if I read the error message right, your image is too large. I think you should explore alternate formats - does the journal accept figures in a vector format such PS, EPS or PDF? Such figures will be much easier to handle than a humongous tiff with file size of 60+ megabytes. HTH, Peter

Re: [R] passing a matrix from R to C code

2012-09-24 Thread Peter Langfelder
Erin, you seem to confuse R and C syntax a bit, among other things. See below. On Mon, Sep 24, 2012 at 3:03 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: I'm working on a project that will pass a matrix from an R function to a C subroutine. I tried to write the following:

Re: [R] Line over Boxplot

2012-09-20 Thread Peter Langfelder
Enclose the file name tmax.final.text in quotes. Otherwise R is looking for a variable named tmax.final.text, not the file name named tmax.final.text. HTH Peter On Thu, Sep 20, 2012 at 1:02 PM, gfishel gfis...@wral.com wrote: Thanks for your help! Unfortunately, I am now getting this:

Re: [R] Cochran-Mantel-Haenszel test

2012-09-18 Thread Peter Langfelder
Bert is correct that this is a statistics questions, but I'll throw in my 2 cents anyway. The CMH test is formulated for count data and makes certain assumptions on the distribution of the observed values. Since you don't have count data (your data are not integer), chances are that the

Re: [R] Trap an error from a function

2012-09-18 Thread Peter Langfelder
On Tue, Sep 18, 2012 at 5:35 PM, David Winsemius dwinsem...@comcast.net wrote: On Sep 18, 2012, at 5:10 PM, John Sorkin wrote: Window 7 R 2.15 I am writing a simulation which generates sample sized estimates from simulated data. When I run the function shown below,

Re: [R] Is something wrong wiht draw.circle()?

2012-09-07 Thread Peter Langfelder
On Fri, Sep 7, 2012 at 9:04 AM, Chris82 rubenba...@gmx.de wrote: Hey R users, I am a little bit confused. require(plotrix) plot(0,xlim=c(-10,10),ylim=c(-10,10),type=n,xlab=,ylab=) draw.circle(0,0,5) lines(c(0,0),c(0,5)) lines(c(0,5),c(0,0)) The culprit are unequal margins. Issue

Re: [R] self-defined distance function to be computed on matrix

2012-08-30 Thread Peter Langfelder
On Thu, Aug 30, 2012 at 10:48 AM, zz czh...@uams.edu wrote: Hello, I have a self-defined function to be computed on each column in a matrix. The basic idea is to ignore the elements that have value of 0 during computation. I should be able to write my own function but it could be

[R] Extracting the name of a function (inverse of match.fun(myFun))

2012-08-29 Thread Peter Langfelder
Hi all, is there a way to extract the name of a function, i.e. do the reverse of match.fun applied to a character string? I would like to print out the name of a function supplied to another function as an argument. For example: myFunc = function(x) { x+1 } applyFunc = function(fnc, x) { fnc

Re: [R] Extracting the name of a function (inverse of match.fun(myFun))

2012-08-29 Thread Peter Langfelder
On Wed, Aug 29, 2012 at 3:36 PM, Peter Langfelder peter.langfel...@gmail.com wrote: Hi all, is there a way to extract the name of a function, i.e. do the reverse of match.fun applied to a character string? I would like to print out the name of a function supplied to another function

Re: [R] Extracting the name of a function (inverse of match.fun(myFun))

2012-08-29 Thread Peter Langfelder
On Wed, Aug 29, 2012 at 4:14 PM, William Dunlap wdun...@tibco.com wrote: deparse(substitute(fnc)) will get you part way there. ... I like to let the user override what substitute might say by making a new argument out of it: applyFunc(function(x)x*10, 1:3) fnc is function(x) x * 10 [1] 10 20

Re: [R] Opinion: Why I find factors convenient to use

2012-08-17 Thread Peter Langfelder
On Fri, Aug 17, 2012 at 11:34 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, No, factors may use less memory. System dependent? I think it's a 32-bit vs. 64-bit distinction - I get Rui's results on 64-bit Windows and Linux installation, but Bert's result on a 32-bit Linux machine. Peter

Re: [R] wgcna choice for softpower by scale indepence when combining to datasets

2012-08-01 Thread Peter Langfelder
On Wed, Aug 1, 2012 at 6:30 AM, Ingezz irholt...@gmail.com wrote: Dear Peter, I have another question about WGCNA. I am using the package for meta-analysis to find modules preserved in several datasets. However, I am unsure how to handle the softpower, because each dataset has its own ideal

[R] coxph weirdness

2012-07-26 Thread Peter Langfelder
Hi all, I cant' wrap my head around an error from the coxph function (package survival). Here's an example: library(survival) n = 100; set.seed(1); time = rexp(n); event = sample(c(0,1), n, replace = TRUE) covar = data.frame(z = rnorm(n)); model = coxph(Surv(time, event)~ . , data = covar) R

Re: [R] coxph weirdness

2012-07-26 Thread Peter Langfelder
On Thu, Jul 26, 2012 at 4:19 PM, Thomas Lumley tlum...@uw.edu wrote: YOu need to update the survival package: from its NEWS file Changes in version 2.36-14 A supposedly cosmetic change to coxph in the last release caused formulas with a . on the right hand side to fail. Fix this and add a

Re: [R] How to defeat buffering in Rgui?

2012-06-29 Thread Peter Langfelder
On Fri, Jun 29, 2012 at 10:15 AM, Spencer Graves spencer.gra...@structuremonitoring.com wrote: Dear Prof. Ripley:      Thanks for the reply.  Unfortunately, flush.console() seems to lock up my system.  I tried the following: for(i in 1:1e7){    tst - sin(i)    if((i%%1e5)==0)cat(i, )    

Re: [R] wgcna

2012-06-15 Thread Peter Langfelder
On Fri, Jun 15, 2012 at 8:04 AM, Ingezz irholt...@gmail.com wrote: Dear Peter, I am trying to apply the WGCNA meta-analysis for two (or more) microarray datasets-tutorial to my own data. mp=modulePreservation(multiExpr,multiColor,referenceNetworks=1,verbose=3,networkType=signed,

Re: [R] remove leading slash

2012-06-08 Thread Peter Langfelder
On Fri, Jun 8, 2012 at 10:25 AM, David Winsemius dwinsem...@comcast.net wrote: On Jun 8, 2012, at 1:11 PM, Ben quant wrote: Hello, How do I change this: cnt_str [1] \002 \001 \102 ...to this: cnt_str [1] 2 1 102 Having trouble because of this: nchar(cnt_str[1]) [1] 1 \001

[R] CRAN: Package WGCNA unavailable for Mac OS

2012-06-01 Thread Peter Langfelder
Hi, not sure this is the right mailing list, but anyway - I maintain the WGCNA package, and was just alerted by a Mac user that it is not available. Looking at the error log at http://www.r-project.org/nosvn/R.check/r-release-macosx-ix86/WGCNA-00check.html reveals checking package dependencies

Re: [R] reading file in zip archive

2012-05-30 Thread Peter Langfelder
On Wed, May 30, 2012 at 12:47 PM, Iain Gallagher iaingallag...@btopenworld.com wrote: Hi Phil Thanks, but this still doesn't work. Here's a reproducible example (was wrapping my head around these functions before). x - as.data.frame(cbind(rep('a',5), rep('b',5))) y -

Re: [R] Best way to predict

2012-05-30 Thread Peter Langfelder
On Wed, May 30, 2012 at 4:07 PM, Chris Burns chris.bur...@gmail.com wrote: I have a huge matrix of unspecified covariates and the corresponding sales for them.  What is the best way to predict the sales from the covariates? Don't want to sound rude, but given your very vague problem

Re: [R] linux

2012-05-27 Thread Peter Langfelder
On Centos and most likely other RedHat/Fedora systems, gfortran is contained in the package gcc-gfortran. Install that package before trying to install R. HTH, Peter On Sun, May 27, 2012 at 8:43 AM, ya xinxi...@163.com wrote: Hi Rich, You mean, the R source code package contains the FORTRAN

Re: [R] Manually modifying an hclust dendrogram to remove singletons

2012-05-24 Thread Peter Langfelder
On Thu, May 24, 2012 at 9:31 AM, r-help.20.tre...@spamgourmet.com wrote: Dear R-Help, I have a clustering problem with hclust that I hope someone can help me with. Consider the classic hclust example:     hc - hclust(dist(USArrests), ave)     plot(hc) I would like to cut the tree up in

Re: [R] Usage line in .pdf version of manual is truncated

2012-04-30 Thread Peter Langfelder
On Mon, Apr 30, 2012 at 12:34 PM, Zeeberg, Barry (NIH/NCI) [E] zeebe...@mail.nih.gov wrote: I am creating a package, and a rather long usage line for one function becomes truncated in the generated .pdf manual. Is there a way that I can prevent that truncation? How long is rather long? In

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread Peter Langfelder
On Tue, Apr 24, 2012 at 3:05 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Tue, 24 Apr 2012, Rich Shepard wrote:  I'll rebuild R-2.15 and start over. Will post results after doing that.  New build, new repository, same results.  Quite the new experience with R, but one I need to

Re: [R] Numbers not numeric?

2012-04-20 Thread Peter Langfelder
On Fri, Apr 20, 2012 at 12:44 PM, Charles Determan Jr deter...@umn.edu wrote: Greetings R users, I have a curious problem.  I read in a csv file (subset shown below) as normal data=read.table(C:/Users/Chaz/Desktop/test.csv,sep=,,header=TRUE, na.strings=.) However, the numbers from the

Re: [R] lines crosses

2012-04-20 Thread Peter Langfelder
On Fri, Apr 20, 2012 at 2:48 PM, Ben quant ccqu...@gmail.com wrote: Hello, If the exact value does not exist in the vector, can I still get at the intersections? Is there a simple way to do this and avoid looping? Seems like there would be a simple R function to do this... Example: vec -

Re: [R] call object from character?

2012-04-18 Thread Peter Langfelder
On Wed, Apr 18, 2012 at 7:25 PM, chuck.01 charliethebrow...@gmail.com wrote: Let say I have an object (I hope my terminology is correct) a a - 12 a [1] 12 And a has been assigned the number 12, or whatever And lets say I have a character call_A call_A - a call_A [1] a What is the

Re: [R] hclust and plot functions work, cutree does not

2012-04-03 Thread Peter Langfelder
On Tue, Apr 3, 2012 at 2:41 AM, vinod1 vinod.hegd...@gmail.com wrote: Sarah, .       clust_tree=hclust(as.dist(x),method=complete) .       plot(clust_tree) this produces a dendrogram, whereas .       clust_tree=hclust(as.dist(x),method=complete) .        cut = cutree(clust_tree,k=1:5) .  

Re: [R] how to map microarray probe to gene, homology

2012-04-03 Thread Peter Langfelder
On Tue, Apr 3, 2012 at 7:21 AM, email mail email8...@gmail.com wrote: Hi: I have clustered microarray gene expression data and trying to map between microarray probe, gene, pathway, gene ontology, and homology for a set of (affy) microarray probes. Is there any package in R which facilitates

Re: [R] scalar assignment within a vector within function

2012-03-29 Thread Peter Langfelder
On Thu, Mar 29, 2012 at 3:49 PM, Benjamin Caldwell btcaldw...@berkeley.edu wrote: Hello, I'm trying to create a vector of r^2 values for using a function which I will run in a for loop. Example: per-rnorm(100,.5,.2)^2 x-rnorm(100,10,5) y-rnorm(100,20,5) fr-data.frame(x,y,per)

Re: [R] Update Packages error

2012-03-29 Thread Peter Langfelder
On Thu, Mar 29, 2012 at 9:41 PM, Jim Silverton jim.silver...@gmail.com wrote: Anyone knows how to get around this message? I am trying to update some packages in R but I get the following message I use R for 64 bit windows. Warning in install.packages(update[instlib == l, Package], l,

Re: [R] Making Knitr work

2012-03-28 Thread Peter Langfelder
On Wed, Mar 28, 2012 at 9:09 AM, Jessica Streicher j.streic...@micromata.de wrote: Might not be the best place to ask, but i could get lucky.. I have setup an eclipse environment to write sweave files lately and wanted to switch to knitr. I could get it to work on easy files, but my earlier

Re: [R] Filling matrices

2012-03-19 Thread Peter Langfelder
On Mon, Mar 19, 2012 at 2:07 PM, David Stevens david.stev...@usu.edu wrote: I'm a bit clumsy about many things in R. Here's my problem. I'm trying to build a square sparse matrix and populate it without looping (bad practice, right). I have vectors of matched row/column pairs for which the

Re: [R] replicating C example from the Extensions Manual problem

2012-03-15 Thread Peter Langfelder
Seems you're missing the required header(s). Can't find the example in the extensions manual but you probably need #include Rinternals.h or #include Rdefines.h HTH, Peter On Wed, Mar 14, 2012 at 11:03 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Dear R People: Here is something that I

Re: [R] Get Details About Clusters

2012-03-15 Thread Peter Langfelder
On Thu, Mar 15, 2012 at 1:48 PM, A J anxu...@hotmail.com wrote: Hi everybody! Anybody knows how can I get detalied information about clusters after using hclust? The issue is that if I have some items in different clusters, I would like to get the cluster where each item is placed. Taking

Re: [R] Matrix negative fraction power

2012-03-11 Thread Peter Langfelder
On Sun, Mar 11, 2012 at 1:46 AM, Ebrahim Jahanshiri e.jahansh...@gmail.com wrote: Dear list, I understand that to raise matrix A to power (-1/2) we should use something like this: eigen(A)$vectors%*%diag(1/sqrt(eigen(A)$values))%*%t(eigen(A)$vectors) [from previous discussions:

Re: [R] hierarchical clustering of large dataset

2012-03-09 Thread Peter Langfelder
On Thu, Mar 8, 2012 at 4:41 AM, Massimo Di Stefano massimodisa...@gmail.com wrote: Hello All, i've a set of observations that is in the form : a,    b,    c,    d,    e,    f 67.12,    4.28,    1.7825,    30,    3,    16001 67.12,    4.28,    1.7825,    30,    3,    16001 66.57,    4.28,  

Re: [R] hierarchical clustering of large dataset

2012-03-09 Thread Peter Langfelder
On Fri, Mar 9, 2012 at 1:50 PM, Massimo Di Stefano massimodisa...@gmail.com wrote: Peter, really thanks  for your answer. install.packages(flashClust) library(flashClust) data - read.csv('/Users/epifanio/Desktop/cluster/x.txt') data - na.omit(data) data - scale(data) mydata            

Re: [R] Correlation of huge matrix saved as binary file

2012-03-02 Thread Peter Langfelder
I don't think you can speed it up by a whole lot... but you can try a few things, especially if you don't have missing data in the matrix (which you probably don't). The main question is what takes most of the time- the api calls or the cor() call? If it's cor, here's what you can try: 1.

Re: [R] Converting a string vector with names to a numeric vector with names

2012-03-01 Thread Peter Langfelder
On Thu, Mar 1, 2012 at 12:28 PM, John C Nash nas...@uottawa.ca wrote: Not paying close attention to detail, I entered the equivalent of pstr-c(b1=200, b2=50, b3=0.3) when what I wanted was pnum-c(b1=200, b2=50, b3=0.3) There was a list thread in 2010 that shows how to deal with un-named

Re: [R] Computing line= for mtext

2012-03-01 Thread Peter Langfelder
Frank, maybe I'm not understanding something right... you say right-justify in the right margin, meaning justify against the very right edge of the plot margin area? Since you're setting your right margin to 5, why not just mtext(s, side=4, las=1, at=5, adj=1, line = 5, cex=1) mtext(s, side=4,

Re: [R] data frame of strings formatted

2012-03-01 Thread Peter Langfelder
On Thu, Mar 1, 2012 at 8:05 PM, Ben quant ccqu...@gmail.com wrote: Hello, I have another question I have a data frame that looks like this:                         a          b 2007-03-31 20070514 20070410 2007-06-30 20070814 20070709 2007-09-30 20071115 20071009 2007-12-31 20080213

Re: [R] problem with assign and get

2012-02-27 Thread Peter Langfelder
On Mon, Feb 27, 2012 at 9:41 AM, Jannis bt_jan...@yahoo.de wrote: Dear list members, does anyone have an idea why the following construction does not work but gives the following error message: assign('test', array(1:10, dim=c(10,10))) dimnames(get('test')) - list(1:10,1:10) Error in

Re: [R] kmeans: how to retrieve clusters

2012-02-27 Thread Peter Langfelder
On Mon, Feb 27, 2012 at 3:18 PM, ikuzar raz...@hotmail.fr wrote: Hello, I'd like to classify data with kmeans algorithm. In my case, I should get  2 clusters in output. Here is my data colCandInd       colCandMed 1       82                2950.5 2       83               1831.5 3      

Re: [R] syntaxe problem

2012-02-24 Thread Peter Langfelder
On Fri, Feb 24, 2012 at 3:47 PM, Adel ESSAFI adeless...@gmail.com wrote: Hello, I want to create 10 dataframe  using a for loop. I don t know what to do to create 10 different dataframes whose name is parametrized with variable i. This syntaxe fails. It create a unique fataframe called dfn.

Re: [R] CV for log normal data

2012-02-21 Thread Peter Langfelder
On Tue, Feb 21, 2012 at 1:44 PM, array chip arrayprof...@yahoo.com wrote: Hi, I have a microarray dataset from Agilent chips. The data were really log ratio between test samples and a universal reference RNA. Because of the nature of log ratios, coefficient of variation (CV) doesn't really

Re: [R] CV for log normal data

2012-02-21 Thread Peter Langfelder
Good advice. But perhaps ?mad or some other perhaps robust plain old measure of spread? The problem is not (lack of) robustness to outliers, the problem is to find genes whose expression variation is small compared to (mean) expression. Trouble is, Agilent throws the mean expression

Re: [R] variable ordering

2012-02-15 Thread Peter Langfelder
On Wed, Feb 15, 2012 at 10:22 PM, arunkumar akpbond...@gmail.com wrote: Hi, My input is x=c(D,A,B) Y=c(A,B,C,D) varorder=which(Y %in% X) I'm getting result as  1 2 4 But i need the result to be 4 1 2 Here's a hint: lookup the function match. Peter

Re: [R] Version control (git, mercurial) for R packages

2012-02-09 Thread Peter Langfelder
On Thu, Feb 9, 2012 at 1:46 AM, Gregory Jefferis jeffe...@gmail.com wrote: Dear Peter, Trying to respond to your original question Thanks for staying on thread :) I have a git repositiory in the root of my packages: ie package-foo/.git package-foo/R package-foo/inst Running make

[R] Version control (git, mercurial) for R packages

2012-02-08 Thread Peter Langfelder
Hi all, in particular package developers, I'm exploring using a version control system to keep better track of changes to the packages I maintain. I'm leaning towards git (although mercurial also looks good) but am not sure what is the best way to set up the repository. It seems I can't set the

Re: [R] .Random.seed not found

2012-02-07 Thread Peter Langfelder
You need to use set.seed() or one of the random number generators to have .Random.seed defined. Also, if you load a previously saved workspace and that workspace had a .Random.seed defined, you will have it defined. HTH Peter On Tue, Feb 7, 2012 at 9:58 AM, Wilkerson, Sylvia (NIH/CIT) [E]

Re: [R] RandomForest ... Always Returning a 1?

2012-02-05 Thread Peter Langfelder
Well, if you look at your data more carefully, you will see that the histogram of y is heavily skewed towards 1 (small values). The 91/625 quantile is still 1 (there are 192 1s). It is therefore not surprising that RF comes up with mostly 1s (in my attempt it came up with two 2s, but that is a bit

Re: [R] Euler identity with complex exp

2012-01-30 Thread Peter Langfelder
Not sure why you think the formula does not hold... but am guessing you think that sin(x) and cos(x) are have values in [-1, 1]? Well that only holds for real x. If you have a complex x, sin(x) and cos(x) are unbounded - indeed, if you can write x=iy and y is real, you can show (up to my own

Re: [R] Euler identity with complex exp

2012-01-30 Thread Peter Langfelder
On Mon, Jan 30, 2012 at 11:43 AM, Joseph Park josephp...@ieee.org wrote: Thanks Michael Peter. Michael's expansion makes sense. This is what I expected: a = pi + 0i complex( real = cos(Re(a)), imaginary = sin(Im(a)) ) [1] -1+0i As they say, the error is between the keyboard and the

Re: [R] Need very fast application of 'diff' - ideas?

2012-01-28 Thread Peter Langfelder
ehm... this doesn't take very many ideas. x = runif(n=10e6, min=0, max=1000) x = round(x) system.time( { y = x[-1] - x[-length(x)] }) I get about 0.5 seconds on my old laptop. HTH Peter On Fri, Jan 27, 2012 at 4:15 PM, Kevin Ummel kevinum...@gmail.com wrote: Hi everyone, Speed is the

Re: [R] z-transform each column of a data.frame

2012-01-20 Thread Peter Langfelder
On Fri, Jan 20, 2012 at 9:04 AM, Martin Batholdy batho...@googlemail.com wrote: Hi, I am currently trying to z-transform (that is subtracting the mean and divide by the standard deviation) multiple columns of a data.frame at the same time. My first approach was: x - data.frame(c(0:10),

<    1   2   3   4   5   >