search for: bsmith030465

Displaying 20 results from an estimated 26 matches for "bsmith030465".

2012 Jun 06
2
ggplot2: legend for geom_rug() ..?
Hi, I was trying to make another legend for the rug plot. Sample code: library(ggplo2) ids <- paste('id_',1:3,sep='') before <- sample(9) after <- sample(1:10,9) dat <- as.matrix(cbind(before,after)) rownames(dat) <- rep(ids,3) position <- c(rep(10,3),rep(13,3),rep(19,3)) mdat <- cbind(melt(dat),position) ggplot(mdat, aes(position, value)) +
2017 Jun 27
4
ggplot2 geom_bar arrangement
Hi, I was trying to draw a geom_bar plot. However, by default, the bars are arranged according to the label, which I don't want. I want the bars to appear exactly as they appear in the data frame. For example in the code: Lab=c(letters[4:6],letters[1:3]) valuex = c(3.1,2.3,0.4,-0.4,-1.2,-4.4) df <- data.frame(Lab,valuex) px <- ggplot(df,aes(Lab,valuex,label=Lab)) +
2017 Jun 26
0
Jagged ROC curves?
...me will look "more smooth" than others depending upon your data and how the thresholds are defined for the underlying metrics. The more unique thresholds there are over the range, the smoother the step function will look. Regards, Marc > On Jun 26, 2017, at 1:07 PM, Brian Smith <bsmith030465 at gmail.com> wrote: > > Hi Mark, > > Thanks for the reply. > > For the attached two png files (test_roc.png & test_roc_smooth.png) > > 1. Using 'plot' function: > > plot(c(1,0),c(0,1), type='l', lty=3, xlim=c(1.01,-0.01), ylim=c(-0.01,1.01)...
2011 Sep 08
2
ggplot geom_freqpoly() layers ..?
Hi, I was trying to overlay/combine two freqpoly plots. The sample code below illustrates the problem. Essentially, I want to do is: 1. Have the same colour for all the lines in 'Plot 1' (and 'Plot 2'). Currently, all the lines in Plot 1 have different colours and all the lines in Plot 2 have different colors. I'd like for all lines in Plot 1 to be 'red' and all the
2017 Jun 27
0
ggplot2 geom_bar arrangement
...ex) # set the factor levels to the same order as observed in the data frame df$Lab <- factor(df$Lab, levels=unique(df$Lab)) px <- ggplot(df,aes(Lab,valuex,label=Lab)) + geom_text(aes(y=0)) + geom_bar(stat = "identity") px Jean On Tue, Jun 27, 2017 at 1:43 PM, Brian Smith <bsmith030465 at gmail.com> wrote: > Hi, > > I was trying to draw a geom_bar plot. However, by default, the bars are > arranged according to the label, which I don't want. I want the bars to > appear exactly as they appear in the data frame. For example in the code: > > Lab=c(letter...
2017 Jun 26
0
Jagged ROC curves?
> On Jun 26, 2017, at 11:40 AM, Brian Smith <bsmith030465 at gmail.com> wrote: > > Hi, > > I was trying to draw some ROC curves (prediction of case/control status), > but seem to be getting a somewhat jagged plot. Can I do something that > would 'smooth' it somewhat? Most roc curves seem to have many incremental > changes...
2017 Jun 26
3
Jagged ROC curves?
Hi, I was trying to draw some ROC curves (prediction of case/control status), but seem to be getting a somewhat jagged plot. Can I do something that would 'smooth' it somewhat? Most roc curves seem to have many incremental changes (in x and y directions), but my plot only has 4 or 5 steps even though there are 22 data points. Should I be doing something differently? How can I provide a
2011 Oct 04
1
ggplot2: changing default colors of boxplot
Hi, I wanted to change the default colors appearing in boxplot. For example, the following code (from the package/documentation): =========== library(ggplot2) p <- ggplot(mtcars, aes(factor(cyl), mpg)) p + geom_boxplot(aes(fill = factor(am))) =========== Gives the default colors. What do I need to do to modify this so that: 1. Change the colors from green and red to blue and black 2. Only
2011 Oct 19
2
Simple color strip
Hi, I was trying to get an image/pdf of a sequence of colors in the order given. For example: myCols <- c('#0000BF','#0000BF','#0000FF','#0000FF','#0000BF','#0000FF') I'd like to make a strip of colors as they appear in the order above and save it as a pdf file. Is there a function in the base package (or some other package) to do this?
2012 Jul 22
1
Lattice/"panel.bwplot" and Gviz: Boxplot question
Hi, I was using Gviz package to create a boxplot. I understand that Gviz uses "panel.bwplot" to create the boxplot. Is there any way that I can remove the dashed line surrounding each pair of boxplots? Here is some sample code: ############# library(Gviz) thisdata <- matrix(sample(1:100,60),nrow=10,ncol=6) positions <- sample(1:100,6) limit1 <- min(positions)-1 limit2
2013 Mar 15
1
Creating a hyperlink in a csv file
Hi, I was wondering if it is possible to create a hyperlink in a csv file using R code and some package. For example, in the following code: links <- cbind(rep('Click for Google',3),"http://www.google.com") write.table(links,'test.csv',sep=',',row.names=F,col.names=F) the web address should be linked to 'Click for Google'. many thanks!
2017 Jul 23
0
par(mfrow) for heatmap plots
...ause that function abuses par. Use lattice or ggplot2 with grid graphics to plot multiple heatmaps. https://stackoverflow.com/questions/15114347/to-display-two-heatmaps-in-same-pdf-side-by-side-in-r -- Sent from my phone. Please excuse my brevity. On July 23, 2017 5:11:32 AM PDT, Brian Smith <bsmith030465 at gmail.com> wrote: >Hi, > >I was trying to use par(mfrow) to put 4 heatmaps on a single page. >However, >I get one plot per page and not one page with 4 plots. What should I >modify? Test code is given below: > >test = matrix(rnorm(60), 20, 3) > >pdf(file='tes...
2013 Mar 12
1
Testing for significance of overlap in three sets - mantelhaen test?
Hi, My apologies for the naive question! I have three overlapping sets and I want to find the probability of finding a larger/greater intersection for 'A intersect B intersect C' (in the example below, I want to find the probability of finding more than 135 elements that are common in sets A, B & C). For a two set problem, I guess I would do a Fisher or chi-square test. Here is what
2013 Jun 10
1
Selecting divergent colors
Hi, I was trying to make a density plot with 13 samples. To distinguish each sample, it would be good if each color is as different as possible from the other colors. I could use the built in function, but that does not do more than 8 colors and then goes back to recycling the cols. If I use a palette, then it is really difficult to distinguish between the colors. So, is there a way that I can
2013 Mar 15
2
Writing a hyperlink to a csv file
Hi, I was wondering if it is possible to create a hyperlink in a csv file using R code and some package. For example, in the following code: links <- cbind(rep('Click for Google',3),"google search address goes here") ## R Mailing list blocks if I put the actual web address here write.table(links,'test.csv', sep=',',row.names=F,col.names=F) the web address
2017 Jul 23
3
par(mfrow) for heatmap plots
Hi, I was trying to use par(mfrow) to put 4 heatmaps on a single page. However, I get one plot per page and not one page with 4 plots. What should I modify? Test code is given below: test = matrix(rnorm(60), 20, 3) pdf(file='test.pdf',width=10,height=8) par(mfrow=c(2,2)) heatmap(test) heatmap(test) heatmap(test) heatmap(test) dev.off() thanks! [[alternative HTML version deleted]]
2011 Oct 17
2
Reading data with 'awk' - basics?
Hi, I had a large file for which I require a subset of rows. Instead of reading it all into memory, I use the awk command to get the relevant rows. However, I'm doing it pretty inefficiently as I write the subset to disk, before reading it into R. Is there a way that I can read it into an R object without writing to disk? For example, this is what I do currently: ## write test sample file
2013 Feb 08
2
write.table and append
Hi, I am trying to append tables on file with this sample code: for(i in 1:2){ mat <- data.frame(sample(1:30,9),3,3) colnames(mat) <- letters[1:3] ifelse(i == 1,write.table(mat,paste('test.txt',sep=''),row.names=F), write.table(mat,paste('test.txt',sep=''),row.names=F,col.names=F,append=TRUE)) } However,
2011 Mar 04
1
linear model - lm (Adjusted R-squared)?
Hi, Sorry for the naive question, but what exactly does the 'Adjusted R-squared' coefficient in the summary of linear model adjust for? Sample code: > x <- rnorm(15) > y <- rnorm(15) > lmr <- lm(y~x) > summary(lmr) Call: lm(formula = y ~ x) Residuals: Min 1Q Median 3Q Max -1.7828 -0.7379 -0.4485 0.7563 2.1570 Coefficients:
2011 Feb 25
1
linear model lme4
Hi, I wanted to check the difference in results (using lme4) , if I treated a particular variable (beadchip) as a random effect vs if I treated it as a fixed effect. For the first case, my formula is: lmer.result <- lmer(expression ~ cancerClass + (1|beadchip)) For the second case, I want to do: lmer.result2 <- lmer(expression ~ cancerClass + beadchip) However, I get an error in