Re: [R] convert real valued matrix to binary matrix

2014-01-10 Thread Jim Lemon
On 01/10/2014 06:56 AM, email wrote: Hi: I am trying to analyze an yeast gene expression data http://arep.med.harvard.edu/biclustering/yeast.matrix I need to convert the real-valued data matrix to a binary (0,1) matrix. Is there any package available? How can it be done? Hi John, It looks

Re: [R] locate pattern in matrix

2014-01-10 Thread Koushik Saha
you can find it by use of indexing with setting 1=T and 0=False in your global environment of R. On Fri, Jan 10, 2014 at 12:32 PM, email email8...@gmail.com wrote: Dear all, I have a binary matrix 0 0 0 0 0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 I want to find the

Re: [R] using lapply to get function values

2014-01-10 Thread David Winsemius
On Jan 10, 2014, at 2:04 AM, Long Vo wrote: Hi R users, I need to apply a function on a list of vectors. This is simple when I use functions that returns only one numerical value such as 'mean' or 'variance'. Things get complex when I use functions returning a list of value, such as

[R] barchar and box on the same figure! is it possible

2014-01-10 Thread Adel ESSAFI
Hello list I have this data frame which represent values grouped by algorithm. remark that for each algorithm, we have the same value in V3 but differnt values in V4. I want to make a plot with algorithms in axes, and for each algorithm I draw a bar (for V3) and a bwplot for V4. is thart

[R] Fwd: barchar and box on the same figure! is it possible

2014-01-10 Thread Adel ESSAFI
Hello list I have this data frame which represent values grouped by algorithm. remark that for each algorithm, we have the same value in V3 but differnt values in V4. I want to make a plot with algorithms in axes, and for each algorithm I draw a bar (for V3) and a bwplot for V4. is thart

[R] How to determine the order of a time series object

2014-01-10 Thread Charles Thuo
I have monthly claims data from 2009 to end of 2013 and would like to forecast for 2014. How is this done in R. Charles. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Fwd: barchar and box on the same figure! is it possible

2014-01-10 Thread Jim Lemon
On 01/10/2014 09:46 PM, Adel ESSAFI wrote: Hello list I have this data frame which represent values grouped by algorithm. remark that for each algorithm, we have the same value in V3 but differnt values in V4. I want to make a plot with algorithms in axes, and for each algorithm I draw a bar

[R] MuMIn Z-Test

2014-01-10 Thread thomasfoxley
Dear list, I'm using MuMIn for model averaging and I had a question about the z-test that MuMIn performs when using the summary call. e.g.: model.1 - subset(model.sel(model.1.glmm.list, rank = AICc), delta3) summary(model.avg(model.1)) ...

Re: [R] R riddle

2014-01-10 Thread arun
Hi, Use ?reshape() dat1- read.table(text=V1 V2   V3 V4 V5 1 210505  ARS    B  A 1 210505  BFGL   A  B 1 210505  NGS    B  B 1 210506 ARS B  B 1 210506 BFGL    A  A 1 210506 NGS B  B 1 210507  ARS    B  B 1 210507 BFGL    A  B 1 210507 NGS A 

[R] Package TM dataframes

2014-01-10 Thread ramoss
Hi, I am trying to use the package TM on a dataframe get the following error: complaints - tm_map(complaints, tolower) Error in UseMethod(tm_map, x) : no applicable method for 'tm_map' applied to an object of class data.frame Tm doesn't work on dataframes? My data frame consists of 1 text

Re: [R] Package TM dataframes

2014-01-10 Thread David Winsemius
On Jan 10, 2014, at 10:11 AM, ramoss wrote: Hi, I am trying to use the package TM on a dataframe get the following error: complaints - tm_map(complaints, tolower) Error in UseMethod(tm_map, x) : no applicable method for 'tm_map' applied to an object of class data.frame Tm doesn't work

[R] How do you transform a dataframe to a corpus?

2014-01-10 Thread ramoss
Hi; I have a data frame complains w/ dimensions 11335291 ( 1.13m obs 1 col) I am trying to transform it into a corpus using the following code: myCorpus -Corpus(VectorSource(complaints$text)) Error in .Source(readPlain, encoding, length(x), FALSE, names(x), 0, TRUE, : vectorized sources

Re: [R] How to determine the order of a time series object

2014-01-10 Thread Jeff Newmiller
There are many ways, but this is not a statistical theory support forum for helping you choose among them. Your question becomes more appropriate when you ask something along the lines of how do I regress data using AR model with R? (Though reading the Time Series Task View on CRAN would be

Re: [R] locate pattern in matrix

2014-01-10 Thread William Dunlap
What would you like to get from the following? 0 1 0 0 0 1 1 1 0 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 1 0 0 0 1 1 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] How do you transform a dataframe to a corpus?

2014-01-10 Thread ramoss
The column length is 4000 bytes long if that helps. -- View this message in context: http://r.789695.n4.nabble.com/How-do-you-transform-a-dataframe-to-a-corpus-tp4683396p4683402.html Sent from the R help mailing list archive at Nabble.com. __

[R] ggplot2; svg; text point size specification

2014-01-10 Thread stephen sefick
library(ggplot2) a - data.frame(x=rnorm(10), y=rnorm(10)) #conversion of mm to points 2.83464567 plot.demo - qplot(x, y, data=a, xlab=test.x, ylab=test.y)+theme(panel.border=element_rect(fill=NA, size=1), axis.title.x = element_text(size=10*2.83464567, family=Arial), axis.title.y =

[R] embedd fonts in pdf generated by R

2014-01-10 Thread Adel ESSAFI
Hello list I generated pdf files with R that I integrated in .tex file and compiled with pdflatex. however, all the fonts of my R figure not embadded. so the file is rejected from EDAS web site. Could you help please. [adel@localhost hcw]$ pdffonts hcw.pdf name

Re: [R] embedd fonts in pdf generated by R

2014-01-10 Thread Prof Brian Ripley
On 10/01/2014 19:29, Adel ESSAFI wrote: Hello list I generated pdf files with R that I integrated in .tex file and compiled with pdflatex. however, all the fonts of my R figure not embadded. so the file is rejected from EDAS web site. Could you help please. If you have suitable licenses for

Re: [R] Maximum of Maximum

2014-01-10 Thread arun
Hi, May be this helps: set.seed(42)  vec1 - sapply(1:1000,function(x) max(rnorm(1000,0,1))) #or set.seed(42)  vec2 - replicate(1000,max(rnorm(1000,0,1))) identical(vec1,vec2) #[1] TRUE set.seed(598) res - sample(vec1,100,replace=FALSE)  max(res) #[1] 4.408794 A.K. Hello I need some help in

[R] SE for R-squared

2014-01-10 Thread Troels Ring
In R package psychometrics an estimate of SE of R squared of /sersq - sqrt((4*rsq*(1-rsq)^2*(n-k-1)^2)/((n^2-1)*(n+3))) with n sample size, and k number of parameters if sample size greater than 60 is found. Does anyone have a formula for smaller sample size or an exact formula? I have been

[R] Conditional inclusion of an element in an R object

2014-01-10 Thread Santosh
Dear Rxperts... I would like to conditionally include an element (as a column) in a dataframe. Please see the sample code below: a1 - data.frame(P=rep(1,10),Qr=LETTERS[1:10],b=letters[1:10],R=rep(c(A,B),each=5)) lc1 - list(C1 = P,C2 =

Re: [R] Conditional inclusion of an element in an R object

2014-01-10 Thread Santosh
Dear Rxperts... I would like to conditionally include an element (as a column) in a dataframe. Please see the sample code below: There is a correction to the earlier post.. my apologies... a1 - data.frame(P=rep(1,10),Qr=LETTERS[1:10],b=letters[1:10], R=rep(c(A,B),each=5)) lc1 - list(C1 = P,C2

Re: [R] Conditional inclusion of an element in an R object

2014-01-10 Thread MacQueen, Don
Apologies, but all that ifelse() stuff is too hard to follow. What I would do is compute a character vector of column names to keep, then do a1[ , names.to.keep] -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On

Re: [R] Maximum of Maximum

2014-01-10 Thread Bert Gunter
It probably doesn't make much difference in this small example, but maybe it's worth noting that **if possible** (it typically is not), things can be speeded up by generating all the random numbers at once then applying a vectorized operation to the entire ensemble. In this case, this becomes:

Re: [R] Maximum of Maximum

2014-01-10 Thread Bert Gunter
... In fact, on my computer, the pmax construction took longer. I would guess that's due to the data.frame construction. Nevertheless, the comment is still germane. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge.

[R] Fwd: Conditional inclusion of an element in an R object

2014-01-10 Thread Santosh
My intention is to include certain columns if they meet certain criteria. For example, if b is one of the columns of a1, then keep otherwise don't. HTH.. santosh On Fri, Jan 10, 2014 at 1:01 PM, MacQueen, Don macque...@llnl.gov wrote: Apologies, but all that ifelse() stuff is too hard to

[R] Tinn-R eBook (free)

2014-01-10 Thread Jose Claudio Faria
Dear users, An eBook (2. Ed.) of Tinn-R was published today. Dowload (free): - http://www.uesc.br/editora/index.php?item=conteudo_livros_digitais.php - http://www.uesc.br/editora/livrosdigitais2/tredit.pdf - Http://nbcgib.uesc.br/lec/software/editores/tinn-r/en # h10-ebook All the best, --

Re: [R] Fwd: Conditional inclusion of an element in an R object

2014-01-10 Thread Bert Gunter
Don's response seems apropos to me. Do you understanding indexing, i.e. the [ operator? If not, you should read An Introduction to R or other tutorial (there are many good ones on the web). If that is not the issue, you need to explain more clearly why his answer does not suffice. Cheers, Bert

Re: [R] Fwd: Conditional inclusion of an element in an R object

2014-01-10 Thread Santosh
I don't think apropos or indexing would help. I am open to your suggestions/tips. I usually get multiple versions of a dataset (even with the same column names). In the source data, I occasionally notice inconsistencies... formatting issues, column naming issues etc.. As shown In the a1

Re: [R] Fwd: Conditional inclusion of an element in an R object

2014-01-10 Thread MacQueen, Don
At the risk of being annoying ... Your original question was, Is there a way to dynamically include columns in a dataframe? The answer is yes. One way, and I think the simplest, is to calculate the names of the columns you want to keep, and then use an expression like I suggested, that is, one

Re: [R] Fwd: Conditional inclusion of an element in an R object

2014-01-10 Thread Jeff Newmiller
I agree with Don... focus on identifying the names of the columns and then use column name indexing to extract the columns you want. You will probably want to rename them to a standard set of names once you have gone to all this trouble... just assign the new vector of names to the names

Re: [R] Function inside Sweave

2014-01-10 Thread Duncan Mackay
Hi Silvano To save you typing try paste0 (...) instead of paste(, sep = ) Just checking quickly In ### code chunk number 3: Serie1 for (i in 1:7){ aux - paste(Q, i, sep=)} will always end up with Q7 Is the } to go elsewhere? OR Is it superfluous? Duncan -Original Message- From:

[R] Selecting individuals to maximize the correlation of two variables

2014-01-10 Thread 汤靖
Hi, Maybe it is not directly related to R but sine many are statistical experts so I post it here for help: I have two variables (say x and y) of length n. Now the cor(x,y) is close to 0. I need to find the subset in {1,.. n} so that the correlation between x and y using the subset data is

Re: [R] Fwd: Conditional inclusion of an element in an R object

2014-01-10 Thread Kevin Schiesser
?as.POSIXct for time-formatting. This function makes a structured list of time data, where you specify an input time and format i.e. as.POSIXct('2014-01-09 01:30:00', format='%Y-%m-%d %H:%M:%S') On 1/10/14, 15:24 , Santosh santosh2...@gmail.com wrote: I don't think apropos or indexing would

[R] Species Distribution Modeling in R, with already extracted environmental values

2014-01-10 Thread Cody Schank
Hi all, I am attempting to do SDM in R, mostly I have used the 'dismo' package. My problem is that all the methods call for a raster stack as the input representing the environmental layers. However, my processing steps leave me with a table of extracted values for each occurrence (much like

Re: [R] looping through 3D array

2014-01-10 Thread apadr007
It seems like emdist does not like to compare matrices with all 0 values. I ended up removing those from my 3D array and have ~8000 matrices instead of 13000. I am using res2 - unlist(mclapply(seq_len(ncol(indx)),function(i) {x1 - indx[,i]; emd2d(results[x1[1],,],results[x1[2],,]) }) ) But even

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-10 Thread Pachapep
Sorry for bugging you again. I was wondering whether it is possible to include multiple different colors instead of just two. In the example below, the color.scale() function goes from yellow to red, but never passes through plain white. Would it be possible to tweak the function or would I

Re: [R] How do you transform a dataframe to a corpus?

2014-01-10 Thread arun
HI, I couldn't reproduce the error. complaints - data.frame(text=c(Do your homework, Provide reproducible example,Read the R-help manual)) library(tm) myCorpus - Corpus(VectorSource(as.character(complaints$text))) myCorpus #A corpus with 3 text documents A.K. On Friday, January 10, 2014 10:57

[R] Time Series STL

2014-01-10 Thread Thomas Barningham
Hi, I'm relatively new to R and need to some help in converting some of my data into a ts object that can then be used to run an STL analysis. My initial input file is a .csv output from some atmospheric measurement instruments. The first column is the year fraction and extends over 2 years with

Re: [R] Levelplots with non-continuous x-axis breaks

2014-01-10 Thread Pachapep
ok, I think I got it. Here is the code I used. Thanks for the help guys.. fake - cbind(c(1,2,5,8,12,19), c(2,5,8,12,19,20), c(1,1,1,1,1,1), c(-10,-10,-10,-10,-10,-10), c(10,10,10,10,10,10), runif(6, 0, 2), runif(6, 0, 2)) datalim - c(-0,10) matrix3plus - fake[,-(1:2)] dimnames(fake)[[2]] -

Re: [R] embedd fonts in pdf generated by R

2014-01-10 Thread Yixuan Qiu
Hi Adel, You may have a look at the *showtext *package (on CRAN and https://github.com/yixuan/showtext), which could convert text into lines and curves in the pdf file, so it doesn't rely on those fonts after the file is created. Best, Yixuan 2014/1/10 Adel ESSAFI adeless...@gmail.com Hello

[R] Problem with barplot

2014-01-10 Thread Clemence Germaine
Hi I’m using bar plot function And I have in my data some zero, but my data are numerics and when i try to use bar plot i have a warning message of « NA was introduced during the automatic conversion » and i can’t see my bar plot. So if somebody have an idea for that? Thanks clémence

[R] Find the package of a class given classname

2014-01-10 Thread Yuan Luo
How to find the package of a class given classname? For example, there is a class called GAlignments, I want to do something like attr(GAlignments, package) that gives you the package where the class is defined? But of course, attr(GAlignments, package) won't work... Thanks for any help! Yuan

[R] Fwd: Need to delete my messages in Nabble

2014-01-10 Thread srinivasa babu
Hi, I deleted my account. I need to delete all of messages started by me in here https://stat.ethz.ch/pipermail/r-help/2009-December/221628.html http://comments.gmane.org/gmane.comp.lang.r.general/172827 Can you please guide how to do so? thanks, Sri. [[alternative HTML version

Re: [R] Fwd: Need to delete my messages in Nabble

2014-01-10 Thread Rolf Turner
On 11/01/14 16:54, srinivasa babu wrote: Hi, I deleted my account. I need to delete all of messages started by me in here https://stat.ethz.ch/pipermail/r-help/2009-December/221628.html http://comments.gmane.org/gmane.comp.lang.r.general/172827 Can you please guide how to do so? You

Re: [R] Find the package of a class given classname

2014-01-10 Thread Bert Gunter
This probably doesn't answer your question, but, amazingly enough, try googling the class name. It worked for GAlignmnets. Incidentally, there's no reason class names have to be unique among R packages.. And they can be hidden in namespaces. Cheers, Bert Bert Gunter Genentech Nonclinical

Re: [R] Find the package of a class given classname

2014-01-10 Thread Hervé Pagès
Hi Yuan, On 01/10/2014 06:49 PM, Yuan Luo wrote: How to find the package of a class given classname? For example, there is a class called GAlignments, I want to do something like attr(GAlignments, package) that gives you the package where the class is defined? But of course, attr(GAlignments,

Re: [R] How do you transform a dataframe to a corpus?

2014-01-10 Thread Jeff Newmiller
Not much. Columns are not normally measured in bytes. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] Time Series STL

2014-01-10 Thread Jeff Newmiller
This might not seem helpful, but there really is a communication gap here. You need to read the Posting Guide, post in plain text so your example code is not mangled by the HTML, and include a bit of data that is representative of the data you are working with. You may find some helpful advice