Re: [R] How to test if there is a subvector in a longer vector

2012-09-28 Thread Berend Hasselman
On 28-09-2012, at 07:41, Atte Tenkanen wrote: > Sorry. I should have mentioned that the order of the components is important. > > So c(1,4,6) is accepted as a subvector of c(2,1,1,4,6,3), but not of > c(2,1,1,6,4,3). > > How to test this? See this discussion for a variety of solutions. http

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
Hi Rui, Excellent!! This is what I was looking for. Thanks for the help. So, now I have stored the result of the 10 regressions in "summ.list <- lapply(lm.list2, summary)" And now once I enter" sum.list "it gives me the output for all the 10 regressions... I wanted to access a

[R] blank plot----how do I make symbols appear

2012-09-28 Thread Jessica da Silva
Hi, I am trying to create a scatterplot, coding each point to one of 5 populations. I was successful when I did this for one set of data, yet when I try plotting other data a blank plot appears (although the axes are labelled and I can fit the regression lines from each population). I have tried

Re: [R] blank plot----how do I make symbols appear

2012-09-28 Thread Ken Knoblauch
Jessica da Silva gmail.com> writes: > I am trying to create a scatterplot, coding each point to one of 5 > populations. I was successful when I did this for one set of data, yet > when I try plotting other data a blank plot appears (although the axes are > labelled and I can fit the regression

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Gerrit Eichner
Hello, Krunal, try summ.list[[2]]$coefficients[2] Note the double square brackets (as summ.list is a list)! Hth, Gerrit On Fri, 28 Sep 2012, Krunal Nanavati wrote: Hi Rui, Excellent!! This is what I was looking for. Thanks for the help. So, now I have stored the result of the 10 regr

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Rui Barradas
Hello, To access list elements you need `[[`, like this: summ.list[[2]]$coefficients Or Use the extractor function, coef(summ.list[[2]]) Rui Barradas Em 28-09-2012 07:23, Krunal Nanavati escreveu: Hi Rui, Excellent!! This is what I was looking for. Thanks for the help. So, now I have stor

Re: [R] Drawing asymmetric error bars

2012-09-28 Thread Jim Lemon
On 09/27/2012 08:59 PM, Alexandra Howe wrote: Hello, I have data which I have arcsin transformed to analyse. I want to plot my data with error bars however as my data is back-transformed my standard errors are uneven. Is there a simple way to draw these asymmetric error bars in R? Hi Alexandra

[R] Crosstable-like analysis (ks test) of dataframe

2012-09-28 Thread Johannes Radinger
Hi, I have a dataframe with multiple (appr. 20) columns containing vectors of different values (different distributions). Now I'd like to create a crosstable where I compare the distribution of each vector (df-column) with each other. For the comparison I want to use the ks.test(). The result sho

Re: [R] Crosstable-like analysis (ks test) of dataframe

2012-09-28 Thread Rui Barradas
Hello, Try the following. f <- function(x, y, ..., alternative = c("two.sided", "less", "greater"), exact = NULL){ #w <- getOption("warn") #options(warn = -1) # ignore warnings p <- ks.test(x, y, ..., alternative = alternative, exact = exact)$p.value #options(warn = w

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Rui Barradas
Hello, Try names(lm.list2[[2]]$coefficient[2] ) Rui Barradas Em 28-09-2012 11:29, Krunal Nanavati escreveu: Ok...this solves a part of my problem When I type " lm.list2[2] " ...I get the following output [[1]] Call: lm(formula = as.formula(fmla), data = tryout2) Coefficients: (Intercept)

Re: [R] changing outlier shapes of boxplots using lattice

2012-09-28 Thread Sarah Goslee
I would guess that if you find the bit that says pch="|" and change it to pch=1 it will solve your question, and that reading ?par will tell you why. Sarah On Thursday, September 27, 2012, Elaine Kuo wrote: > Hello > > This is Elaine. > > I am using package lattice to generate boxplots. > Using

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Rui Barradas
Ok, if I'm understanding it well, you want the mean value of Price1, , Price5? I don't know if it makes any sense, the coefficients already are mean values, but see if this is it. price.coef <- sapply(lm.list, function(x) coef(x)[2]) mean(price.coef) Rui Barradas Em 28-09-2012 12:07, Krunal

Re: [R] What to use for ti in back-transforming summary statistics from F-T double square-root transformation in 'metafor'

2012-09-28 Thread Viechtbauer Wolfgang (STAT)
Dear Chunyan, One possibility would be to use the harmonic mean of the person-time at risk values. You will have to do this manually though at the moment. Here is an example: ### let's just use the treatment group data from dat.warfarin data(dat.warfarin) dat <- escalc(xi=x1i, ti=t1i, measure="

[R] Anova and tukey-grouping

2012-09-28 Thread Landi
Hello, I am really new to R and it's still a challenge to me. Currently I'm working on my Master's Thesis. My supervisor works with SAS and is not familiar with R at all. I want to run an Anova, a tukey-test and as a result I want to have the tukey-grouping ( something like A - AB - B) I came ac

[R] Is it possible to enter in a function wich is within a library ?

2012-09-28 Thread ikuzar
Hello, I'd like to know if it is Ipossible to enter in a function wich is included in a library ? I know how to debug function wich is in a R file (but not in a library). But it is not the case when the function is included in a library. I want to go step by step in this function in order to test

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
Ok...this solves a part of my problem When I type " lm.list2[2] " ...I get the following output [[1]] Call: lm(formula = as.formula(fmla), data = tryout2) Coefficients: (Intercept) Price2 Media1 Distri1Trend Seasonality 13491232 -5759030-1520343

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
Hi, Yes the thing that you provided...works finebut probably I should have asked for some other thing. Here is what I am trying to do I am trying to get the mean of Price variableso I am entering the below function: mean(names(lm.list2[[2]]$coefficient[2] )) but this gives

Re: [R] Running different Regressions using for loops

2012-09-28 Thread Krunal Nanavati
Ok...I am sorry for the misunderstanding what I am trying to do is >> lm.list2 <- list() >> for(i in seq_along(pricemedia)){ >>regr <- paste(pricemedia[i], trendseason, sep = "+") >>fmla <- paste(response, regr, sep = "~") >>lm.list2[[i]] <- lm(as.formula(fmla), d

[R] RES: Generating an autocorrelated binary variable

2012-09-28 Thread André Gabriel
I think the package BinarySimCLF can help. See http://cran.r-project.org/web/packages/binarySimCLF/binarySimCLF.pdf. André Gabriel. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Rolf Turner Enviada em: sexta-feira, 28 de setembro

Re: [R] How to write R package

2012-09-28 Thread Duncan Murdoch
On 27/09/2012 5:15 PM, Dr. Alireza Zolfaghari wrote: Hi List, Would you please send me a good link to talk me through on how to write a R package? See the ?package.skeleton help page. After you have run it, follow the instructions in the "Read-and-delete-me" file that it will create. For f

Re: [R] changing outlier shapes of boxplots using lattice

2012-09-28 Thread Richard M. Heiberger
Elaine, For panel.bwplot you see that the central dot and the outlier dots are controlled by the same pch argument. I initially set the pch="|" to match your first example with the horizontal indicator for the median. I would be inclined to use the default circle for the outliers and therefore a

Re: [R] Anova and tukey-grouping

2012-09-28 Thread arun
HI, I guess there is a mistake in your code.  You should have used "typ" instead of "abun" as "abun" is the dependent variable. summary(fm1 <- aov(breaks ~ wool + tension, data = warpbreaks)) myresults    <-  TukeyHSD(fm1, "tension", ordered = TRUE) library(agricolae) HSD.test(fm1,"wool",group=T

Re: [R] Crosstable-like analysis (ks test) of dataframe

2012-09-28 Thread Johannes Radinger
Thank you Rui! that works as I want it... :) /Johannes On Fri, Sep 28, 2012 at 12:30 PM, Rui Barradas wrote: > Hello, > > Try the following. > > > f <- function(x, y, ..., > alternative = c("two.sided", "less", "greater"), exact = NULL){ > #w <- getOption("warn") > #options(warn

[R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread Rich Shepard
I'm not able to create the proper syntax to specify a lattice bwplot() for only one of two conditioning factors. The syntax that produces a box plot of each of the two conditioning factors is: bwplot(quant ~ param | era, data=mg.d, main='Dissolved Magnesium', ylab='Concentration (mg/L)')

Re: [R] Simple Question

2012-09-28 Thread Bhupendrasinh Thakre
Many thanks Dr. Winsemius , Kimmo and Pascal All of them are working and really beautiful... Best Regards, Bhupendrasinh Thakre *Disclaimer :* The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-09-28 Thread jens . oehlschlaegel
Jonathan, ff has a utility function file.resize() which allows to give a new filesize in bytes using doubles. See ?file.resize Regards Jens Oehlschlägel Gesendet: Donnerstag, 27. September 2012 um 21:17 Uhr Von: "Jonathan Greenberg" An: r-help , r-sig-...@r-project.org

Re: [R] Anova and tukey-grouping

2012-09-28 Thread Landi
Hello ! Thanks for your advice. I tried it, but the output is the same: > HSD.test(anova.typabunmit, "typ", group=TRUE) Name: typ ds.typabunmit$typ I don't get the values...!?!? -- View this message in context: http://r.789695.n4.nabble.com/Anova-and-tukey-grouping-tp4644485p4644513.html

Re: [R] List of Variables in Original Order

2012-09-28 Thread rkulp
AK: Thanks, that was very helpful. It led me to think of the function names(base) which provided the vector of names in the correct order. I then used the same matrix formatting and everything worked out exactly as planned. Dick On 9/28/2012 1:09 AM, arun kirshna [via R] wrote: > > > HI, > May

Re: [R] Running different Regressions using for loops

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 4:35 AM, Krunal Nanavati wrote: > Ok...I am sorry for the misunderstanding > > what I am trying to do is Perhaps (and that is a really large 'perhaps'): >>> lm.list2 <- list() lm.means <- list() >>> for(i in seq_along(pricemedia)){ >>> regr <- paste(pricemedia

[R] max & summary contradict each other

2012-09-28 Thread Sam Steingold
why does summary report max 27600 and not 27603? > x <- c(27603, 1) > max(x) [1] 27603 > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 16902 13800 13800 20700 27600 -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.chi

Re: [R] max & summary contradict each other

2012-09-28 Thread Duncan Murdoch
On 28/09/2012 12:14 PM, Sam Steingold wrote: why does summary report max 27600 and not 27603? > x <- c(27603, 1) > max(x) [1] 27603 > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 16902 13800 13800 20700 27600 Because you asked for 3 digit accuracy. See ?summ

Re: [R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 7:49 AM, Rich Shepard wrote: > I'm not able to create the proper syntax to specify a lattice bwplot() for > only one of two conditioning factors. Wouldn't that involve specifying the 'subset' parameter (if bwplot accepts a subset argument) or using the 'subset' function to

Re: [R] Simple Question

2012-09-28 Thread Bhupendrasinh Thakre
Hi Everyone, Sorry for coming back again with a new problem. Editing question, session info and data so you don't have to scroll till the end of page. *Situation :* I have a data frame and it's name is df. Now I want to add Time Stamp to the end of *"name" of "data Frame" i.e. "df_system_time"*.

Re: [R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread Bert Gunter
A small reproducible example, as requested bythe posting guide, would have been very helpful here (if you provide one, use ?dput to provide the data). You have also not told us what you mean by "unsuccessful," so we are left to guess what sort of problems you experienced. "None work" is completely

Re: [R] Simple Question

2012-09-28 Thread Bhupendrasinh Thakre
Hi Everyone, Sorry for coming back again with a new problem. Editing question, session info and data so you don't have to scroll till the end of page. *Situation :* I have a data frame and it's name is df. Now I want to add Time Stamp to the end of *"name" of "data Frame" i.e. "df_system_time"*.

Re: [R] max & summary contradict each other

2012-09-28 Thread arun
Hi, Try this: summary(x,digits=max(5)) #   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.   #  1.0  6901.5 13802.0 13802.0 20702.0 27603.0 A.K. - Original Message - From: Sam Steingold To: r-help@r-project.org Cc: Sent: Friday, September 28, 2012 12:14 PM Subject: [R] max & summary co

Re: [R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread Rich Shepard
On Fri, 28 Sep 2012, David Winsemius wrote: Wouldn't that involve specifying the 'subset' parameter (if bwplot accepts a subset argument) or using the 'subset' function to pass the desired rows to the data argument if it doesn't? David, That's what I tried: bwplot(quant ~ param | era, dat

Re: [R] Simple Question

2012-09-28 Thread Berend Hasselman
On 28-09-2012, at 18:40, Bhupendrasinh Thakre wrote: > Hi Everyone, > > Sorry for coming back again with a new problem. > Editing question, session info and data so you don't have to scroll till > the end of page. > > *Situation :* > > I have a data frame and it's name is df. Now I want to ad

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-09-28 Thread Jonathan Greenberg
Rui: Quick follow-up -- it looks like seek does do what I want (I see Simon suggested it some time ago) -- what do mean by "trash your disk"? What I'm trying to accomplish is getting parallel, asynchronous writes to a large binary image (just a binary file) working. Each node writes to a differe

Re: [R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 9:56 AM, Rich Shepard wrote: > On Fri, 28 Sep 2012, David Winsemius wrote: > >> Wouldn't that involve specifying the 'subset' parameter (if bwplot accepts >> a subset argument) or using the 'subset' function to pass the desired rows >> to the data argument if it doesn't? > >

Re: [R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread Rich Shepard
On Fri, 28 Sep 2012, David Winsemius wrote: bwplot(quant ~ param , data=mg.d, main='Magnesium', ylab='Concentration (mg/L)', subset= era=='Pre-mining' ) David, Don: Thank you. I tried subset= and era== separately, not together. Now I know. Much appreciated, Rich __

Re: [R] Lattice bwplot(): Conditioning on one factor

2012-09-28 Thread Bert Gunter
Yes. Now I understand what was wanted. 1. the subset argument is certainly documented on the Help page: subset An expression that evaluates to a logical or integer indexing vector. Like groups, it is evaluated in data. Only the resulting rows of data are used for the plot. If subscripts is TRU

Re: [R] install.packages on windows

2012-09-28 Thread Uwe Ligges
On 28.09.2012 00:32, Duncan Murdoch wrote: On 12-09-27 2:53 PM, Anju R wrote: Sometimes when I try to install certain packages I get a warning message. For example, I tried to install the package "Imtest" on windows R version 2.15.1 and got the following message: Warning message: package ‘Imt

Re: [R] Anova and tukey-grouping

2012-09-28 Thread arun
Hi, As I mentioned earlier, these are just guess work until you provide a subset of your data with dput().  Also, please check the structure of the data with str(). A.K.  - Original Message - From: Landi To: r-help@r-project.org Cc: Sent: Friday, September 28, 2012 10:35 AM Subj

Re: [R] How to write R package

2012-09-28 Thread Uwe Ligges
On 28.09.2012 14:22, Duncan Murdoch wrote: On 27/09/2012 5:15 PM, Dr. Alireza Zolfaghari wrote: Hi List, Would you please send me a good link to talk me through on how to write a R package? See the ?package.skeleton help page. After you have run it, follow the instructions in the "Read-and

Re: [R] Simple Question

2012-09-28 Thread Bhupendrasinh Thakre
Thanks a ton Berend. That worked like a charm.. R comes with thousands of Sweet Surprises everyday Bhupendrasinh Thakre On Sep 28, 2012, at 12:00 PM, Berend Hasselman wrote: > > On 28-09-2012, at 18:40, Bhupendrasinh Thakre wrote: > >> Hi Everyone, >> >> Sorry for coming back ag

Re: [R] Simple Question

2012-09-28 Thread Bert Gunter
On Fri, Sep 28, 2012 at 11:15 AM, Bhupendrasinh Thakre wrote: > Thanks a ton Berend. That worked like a charm.. > R comes with thousands of Sweet Surprises everyday -- Not for those who read the docs. :-o -- Bert > > > Bhupendrasinh Thakre > > > > > On Sep 28, 2012, at 12:00 PM, Berend

Re: [R] How to test if there is a subvector in a longer vector

2012-09-28 Thread Atte Tenkanen
Thank you! ___ Lähettäjä: Berend Hasselman [b...@xs4all.nl] Lähetetty: 28. syyskuuta 2012 10:47 Vastaanottaja: Atte Tenkanen Cc: R help Aihe: Re: [R] How to test if there is a subvector in a longer vector On 28-09-2012, at 07:41, Atte Tenkanen wrote: > Sorry. I should have mentioned

Re: [R] Arules - predict function issues - subscript out of bounds

2012-09-28 Thread alicechao
Hi Ankur, I am running into the exact same issue you have described above. Were you able to find out why it didn't work on your data set and resolve it? If yes, could you share? Much thanks & regards, Alice -- View this message in context: http://r.789695.n4.nabble.com/Arules-predict-funct

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-09-28 Thread Rui Barradas
Hello, I've written a function to try to answer to your op request, but I've run into a problem. See in the end. In the mean time, inline. Em 28-09-2012 17:44, Jonathan Greenberg escreveu: Rui: Quick follow-up -- it looks like seek does do what I want (I see Simon suggested it some time ago)

Re: [R] changing outlier shapes of boxplots using lattice

2012-09-28 Thread ilai
On Fri, Sep 28, 2012 at 6:57 AM, Richard M. Heiberger wrote: > Elaine, > > For panel.bwplot you see that the central dot and the outlier dots are > controlled by > the same pch argument. ??? I don't think so... bwplot(rgamma(20,.1,1)~gl(2,10), pch=rep(17,2), panel = lattice::panel.bwplot) I th

[R] Better way of Grouping?

2012-09-28 Thread Charles Determan Jr
Hello R users, This is more of a convenience question that I hope others might find useful if there is a better answer. I work with large datasets that requires multiple parsing stages for different analysis. For example, compare group 3 vs. group 4. A more complicated comparison would be time

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-09-28 Thread Simon Urbanek
On Sep 28, 2012, at 12:44 PM, Jonathan Greenberg wrote: > Rui: > > Quick follow-up -- it looks like seek does do what I want (I see Simon > suggested it some time ago) -- what do mean by "trash your disk"? I can't speak for Rui, but the difference between seeking and explicit write is that t

[R] Select Original and Duplicates

2012-09-28 Thread Adam Gabbert
I would like to select a all the duplicate rows of a data frame including the original. Any help would be much appreciated. This is where I'm at so far. Thanks. #Sample data frame: df <- read.table(header=T, con <- textConnection(' label value A 4 B 3 C 6 B 3

Re: [R] Select Original and Duplicates

2012-09-28 Thread Rui Barradas
Hello, Try the following. idx <- duplicated(df) | duplicated(df, fromLast = TRUE) df[idx, ] Note that they are returned in their original order in the df. Hope this helps, Rui Barradas Em 28-09-2012 21:11, Adam Gabbert escreveu: I would like to select a all the duplicate rows of a data fra

Re: [R] Better way of Grouping?

2012-09-28 Thread Jeff Newmiller
You have not specified the objective function you are trying to optimize with your term "efficient", or what you do with all of these subsets once you have them. For notational simplification and completeness of coverage (not necessarily computational speedup) you might want to look at "tapply

[R] Merging multiple columns into one column

2012-09-28 Thread Meredith Ballard LaBeau
Good Evening- I have a dataframe that has 10 columns that has a header and 7306 rows in each column, I want to combine these columns into one. I utilized the stack function but it only returned 3/4 of the data...my code is: where nfcuy_bw is the dataframe with 7305 obs. and 10 variables Once I app

Re: [R] Better way of Grouping?

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 11:59 AM, Charles Determan Jr wrote: > Hello R users, > > This is more of a convenience question that I hope others might find useful > if there is a better answer. I work with large datasets that requires > multiple parsing stages for different analysis. For example, compa

Re: [R] Merging multiple columns into one column

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 2:51 PM, Meredith Ballard LaBeau wrote: > Good Evening- > I have a dataframe that has 10 columns that has a header and 7306 rows in > each column, I want to combine these columns into one. I utilized the stack > function but it only returned 3/4 of the data...my code is: > whe

[R] Heatmap Colors

2012-09-28 Thread Nick Fankhauser
Hello R-Users! I'm using a heatmap to visualize a matrix of values between -1 and 3. How can I set the colors so that white is zero, below zero is blue of increasing intensity towards -1 and above zero is red of increasing intensity towards red? I tried like this (using the marray and gplots

Re: [R] Merging multiple columns into one column

2012-09-28 Thread Bert Gunter
?unlist (A data frame is a list, as ?data.frame explains. Also the Intro to R tutorial, which should be read by everyone beginning with R). -- Bert On Fri, Sep 28, 2012 at 2:51 PM, Meredith Ballard LaBeau wrote: > Good Evening- > I have a dataframe that has 10 columns that has a header and 730

Re: [R] changing outlier shapes of boxplots using lattice

2012-09-28 Thread Elaine Kuo
Hello Ilai, Thank you for the response. It did help a lot. However, a beginner to lattice has three questions. Q1 Please kindly explain why "in this case OP is using it with no "at" argument,"" so it is possible to display the median and the outliers with different pch? Q2. what is the relatio

Re: [R] Heatmap Colors

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 3:16 PM, Nick Fankhauser wrote: > Hello R-Users! > > I'm using a heatmap to visualize a matrix of values between -1 and 3. > How can I set the colors so that white is zero, below zero is blue of > increasing intensity towards -1 and above zero is red of increasing intensity

Re: [R] Heatmap Colors

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 4:52 PM, David Winsemius wrote: > > On Sep 28, 2012, at 3:16 PM, Nick Fankhauser wrote: > >> Hello R-Users! >> >> I'm using a heatmap to visualize a matrix of values between -1 and 3. >> How can I set the colors so that white is zero, below zero is blue of >> increasing in

[R] Errors in if statement

2012-09-28 Thread JiangZhengyu
Hi guys, I have many rows (>1000) and columns (>30) of "geno" matrix. I use the following loop and condition statement (adapted from someone else code). I always have an error below. I was wondering if anyone knows what's the problem & how to fix it. Thanks,Zhengyu ### geno matrix P

Re: [R] Better way of Grouping?

2012-09-28 Thread arun
Hi, You can also use grep() to subset: LD<-paste0(rep(rep(c(3,4),each=4),2),c(rep("L",8),rep("D",8))) set.seed(1) dat1<-data.frame(LD=LD,value=sample(1:15,16,replace=TRUE)) dat2<-within(dat1,{LD<-as.character(LD)}) dat2[grepl(".*L",dat2$LD),] # subset all L values dat2[grepl(".*D",dat2$LD),] # su

[R] Text mining? Text manipulation? Both? Predicting KRAS test results in cancer patients

2012-09-28 Thread Paul Miller
Happy Friday Everyone,   Hope Friday afternoon doesn't turn out to be a terrible time to post a question. I've been doing a little data mining of patient text medical records as of late. I started out trying to predict whether or not cancer patients had received KRAS mutation testing and did qui

Re: [R] Select Original and Duplicates

2012-09-28 Thread Adam Gabbert
That works. Thank you! On Fri, Sep 28, 2012 at 4:22 PM, Rui Barradas wrote: > Hello, > > Try the following. > > > idx <- duplicated(df) | duplicated(df, fromLast = TRUE) > df[idx, ] > > Note that they are returned in their original order in the df. > > Hope this helps, > > Rui Barradas > > Em 28

Re: [R] Select Original and Duplicates

2012-09-28 Thread arun
HI, You can also try: idx<-data.frame(t(sapply(df,function(x) !is.na(match(x,x[duplicated(x)])  df1<-df[sapply(idx,function(x) all(x==TRUE)),] df1 #  label value #1 A 4 #2 B 3 #4 B 3 #7 A 4 #8 A 4 A.K. - Original Message - From: Rui Barradas T

[R] Converting array to matrix

2012-09-28 Thread farnoosh sheikhi
Hi, I have a 3d array as below, I want to make this array to a matrix of p=50(rows) and n=20(columns) with the coverage values . The code before the array is: library(binom) Loading required package: lattice pi.seq<-seq(from = 0.01, to = 0.5, by = 0.01) no.seq<-seq(from = 5, to = 100, by = 5) cp

Re: [R] Converting array to matrix

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 3:59 PM, farnoosh sheikhi wrote: > Hi, > > I have a 3d array as below, I want to make this array to a matrix of > p=50(rows) and n=20(columns) with the coverage values . > The code before the array is: ?matrix mat <- matrix(datfrm$coverage, 50, 20) filled.contour(mat) # u

Re: [R] Errors in if statement

2012-09-28 Thread David Winsemius
On Sep 28, 2012, at 1:16 PM, JiangZhengyu wrote: > > Hi guys, I have many rows (>1000) and columns (>30) of "geno" matrix. I use > the following loop and condition statement (adapted from someone else code). > I always have an error below. I was wondering if anyone knows what's the > problem