similar to: ggplot geom_freqpoly() layers ..?

Displaying 20 results from an estimated 2000 matches similar to: "ggplot geom_freqpoly() layers ..?"

2011 Sep 08
1
ggplot2 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
2012 Apr 05
1
integrate function - error -integration not occurring with last few rows
Hi, I am using the integrate function in some simulations in R (tried ver 2.12 and 2.15). The problem I have is that the last few rows do not integrate correctly. I have pasted the code I used. The column named "integral" shows the output from the integrate function. The last few rows have no integration results. I tried increasing the doses, number of subjects, etc.... this error occurs
2012 Apr 08
1
Avoid loop with the integrate function
Dear R users, I am running a loop with the integrate function. I have pasted the code below. I am integrating a function from time=0 to the time value in every row. I have to perform this integration over thousands of rows with different parameters in each row. Could someone please suggest if there is an efficient/faster/easier way to do this by avoiding the loops ? Thank you so much for your
2006 Oct 27
3
How to best divide table by table
Hi all, how can I divide two tables of the same dimension so that all names are preserved, ie do not become NA? I have "tab1" and "tab2", each having names in the first column. I want "tab3" with the same names and values "tab1/tab2". Thanks, Serguei
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
2005 Sep 09
3
how to do something like " subset(mat, ("col1">4 & "col2">4)) "
Dear all, I have a problem with the "subset()" function. I spent all day yesterday with a collegue to solve it and we did not find a satisfying solution (even in the archived mails), so I ask for your help. Let's say (for a simple example) a matrix mat: R> mat cola colb colc [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 My goal is to select the lines of the matrix on the basis of the
2008 Feb 13
2
apply on large arrays
I have a big contingency table, approximately of size 60*2*500*500, and I need to count the number of cells containing a count of 1 for each of the factors values defining the first dimension. Here is my attempt: tab1<-with(pisa1,table(CNT,GENDER,ISCOF,ISCOM)) tab2<-apply(tab1,1:4,function(x)ifelse(sum(x)==1,1,0)) tab3<-apply(tab2,1,sum) Computing tab2 is very slow. Is there a faster
2007 Feb 15
2
simpleR or usingR package by Verzani
I am a new R user and so I thought I could start with "Using R for Introductory statistics" by Verzani. In order to use some of the functions and datasets I have to install the simpleR package which is is now inside the UsingR package. I did so using >install.packages("UsingR"). However, the functions such as "simple.freqpoly.R" do not work. I also tried to
2010 Jul 25
1
Left Outer Join 2 DF's on Multiple Conditions
Hi, I am trying to execute the following SQL statement using two data frames: tab1, tab2 : Two Tables Select tab1.*, tab2.*, tab1.tobiiTime - tab2.ruiTime as timeDiff, IFNULL(n-m, -9999999) as alwaysIncrement FROM tab1 LEFT OUTER JOIN tab2 On tab1.data1 - tab2.mouseX = 0 And tab1.data2 - tab2.mouseY = 0 I am trying to do the following in R:- *#Getting error here:* data
2013 Apr 10
6
means in tables
Hi. I have 2 tables, with same dimensions (8000 x 5). Something like: tab1: V1 V2 V3 V4 V5 14.23 1.71 2.43 15.6 127 13.20 1.78 2.14 11.2 100 13.16 2.36 2.67 18.6 101 14.37 1.95 2.50 16.8 113 13.24 2.59 2.87 21.0 118 tab2: V1 V2 V3 V4 V5 1.23 1.1 2.3 1.6 17 1.20 1.8 2.4 1.2 10 1.16 2.6 2.7 1.6 11 1.37 1.5 2.0 1.8 13 1.24 2.9 2.7 2.0 18 I need generate a table of averages, the
2010 Apr 24
2
table command
Hi, Let s be a dataframe. > s A B C 0 0 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 > tab1=table(s[,c(1,2)]) > tab1 B A 0 1 0 3 3 1 3 0 > tab2=table(s[,c(1,3)]) > tab2 C A 1 0 6 1 3 The problem is I need to access frequency corresponding to (0,0). tab1[1] will give me the correct value
2009 Dec 22
2
Nested For loops
Dear R experts, Might be very simple question to ask but would be insightful. As the same story of nested "for loops". following is the code that I am using to get the autocorrelation function of the sample data. I have tried to get rid of for loops but since I am touching R after such a long time that I need to practice more but I need help to revive my skills. I know that apply() or
2011 Oct 29
1
Refresh tab content on click in JQuery UI Tabs
HI Guy''s TAB1 and TAB2 have some radio button, checkbox and dropdown menu. When TAB1 is selected, I have to switch to TAB2 and then back to TAB1 to refresh the loaded content. How to make TAB1 refresh loaded content when click on its tab? *code is something like that* <ul class="tabs"> <li><a *href="#tab1"*>Gallery</a></li>
2009 Dec 07
4
yeroon.net/ggplot2 web application v0.11
A new version of the ggplot2 web application is available at http://www.yeroon.net/ggplot2. New features include 1D geom?s (histogram,?density, freqpoly), syntax mode (by clicking the tiny arrow at the?bottom), and some additional facet options. Furthermore some minor?improvements and fixes, most notably for Internet Explorer. As usual, a little demo video that shows how to use the new features:
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)) +
2005 Nov 03
4
merging dataframes
Dear List, I often have to merge two or more data frames containing unique row names but with some columns (names) common to the two data frames and some columns not common. This toy example will explain the kind of setup I am talking about: mat1 <- as.data.frame(matrix(rnorm(20), nrow = 5)) mat2 <- as.data.frame(matrix(rnorm(20), nrow = 4)) rownames(mat1) <- paste("site",
2010 Feb 12
3
Code working but too slow, any idea for how to speed it up ?(no loop in it)
Hello my friends, here is a code I wrote with no loops on matrix that is taking too long (2 seconds and I call him 720 times --> 12 minutes): mat1 and mat2 are both matrix with 103 columns and 164 rows. sequence <- matrix(seq(1 : ncol(mat1))) returns <- apply(sequence, 1, function, mat1= mat1, mat2 = mat2, day = 1) function<- function(mat1, mat2, colNb, day){
2011 Nov 26
1
data.table merge equivalent for all.x
Een ingesloten tekst met niet-gespecificeerde tekenset is gescrubt ... Naam: niet beschikbaar URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20111126/e14d6638/attachment.pl>
2001 Sep 27
1
cuts and breaks
Hi I'm using the "image" function to produce a plot and I want to define the breaks using "cut" and the colors using "heat.colors". > image(interp(mat2[,2],mat2[,1],mat2[,3]),breaks=cut(mat2[,3],30),col=heat.colors(29)) Error in image.default(interp(mat2[, 2], mat2[, 1], mat2[, 3]), breaks = cut(mat2[, : must have one more break than colour The
2010 Jan 29
7
Simple question on replace a matrix row
Hello, I have a matrix mat1 of dim [1,8] and mat2 of dim[30,8], I want to replace the first row of mat2 with mat1, this is what I do: mat2[1,]<-mat1 but it transforms mat2 in a list I don't understand, I want it to stay a matrix... ----- Anna Lippel -- View this message in context: http://n4.nabble.com/Simple-question-on-replace-a-matrix-row-tp1427857p1427857.html Sent from the R help