similar to: Two plots with two different Y labels

Displaying 20 results from an estimated 20000 matches similar to: "Two plots with two different Y labels"

2010 Oct 22
2
create sequence of numbers
Hello. I want to create some sequence of numbers . So far I used sequence which does not work always seq(CRagent[[1]]$xy[1],CRagent[[2]]$xy[1],by=0.01) Error in seq.default(CRagent[[1]]$xy[1], CRagent[[2]]$xy[1], by = 0.01) : wrong sign in 'by' argument Calls: seq -> seq.default if the parameters are in descending form. The ideal would be to be able to use seq like this
2011 Aug 25
1
Bivariate normal regression in R
Hello everyone, I need to fit a bivariate normal regression model to a dataset where the same covariate (say, X) influences two separate but correlated responses (say, Y1 and Y2). So, the bivariate model would look like : Y1 = a1 + b1*X + e1 Y2 = a2 + b2*X + e2 where e1 and e2 are error terms which can be correlated. Is there any package in R which can help me fit this model ? Any help will be
2011 Oct 06
1
Concecutive zeros and ones
Dear all, I have  a data series (might be vector or matrix) which is composed only from zeros and ones like the following example 0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 0 I want to be able to return back the length of concecutive zeros and the length of concecutive ones. For that I want to have something like that returned: zeros= [3 1 2 3]; ones=[2 1 4]; How I can do that simply in R? I would like
2010 Nov 09
3
Row-wise recurive function call
Dear Group, I have a following dataset: > a A B C D 1 22 3 31 40 2 26 31 36 32 3 3 7 49 16 4 24 40 27 26 5 20 45 47 0 6 34 43 11 18 7 48 48 24 2 8 3 16 39 48 9 20 49 7 21 10 17 36 47 10 > dput(a) structure(list(A = c(22L, 26L, 3L, 24L, 20L, 34L, 48L, 3L, 20L, 17L), B = c(3L, 31L, 7L, 40L, 45L, 43L, 48L, 16L, 49L, 36L), C = c(31L, 36L, 49L, 27L, 47L, 11L, 24L,
2011 Mar 09
4
Extracting only odd columns from a matrix
Hi, This might seem like a simple question but at the moment I am stuck for ideas. The columns of my matrix in which some data is stored are of this form: X1 Y1 X2 Y2 X3 Y3 ... Xn Yn with n~100. I would like to look at just the X values (i.e. odd column numbers). Is there an easy way to loop round extracting only these columns? Any help would be appreciated.
2012 Apr 20
3
Matrix multiplication by multple constants
Dear R helpers Suppose x  <- c(1:3) y  <- matrix(1:12, ncol = 3, nrow = 4) > y      [,1] [,2] [,3] [1,]    1    5    9 [2,]    2    6   10 [3,]    3    7   11 [4,]    4    8   12 I wish to multiply 1st column of y by first element of x i.e. 1, 2nd column of y by 2nd element of x i.e. 2 an so on. Thus the resultant matrix should be like > z      [,1]   [,2]    [,3] [1,]    1   
2010 Nov 07
3
regular exprs
Dear All, I would appreciate any help with the following: given the vector 'x' x <- c("Ass1", "Ass.s1", "Ass2", "Ass.s2") I would like to pick up the positions where the character string contains "Ass" but does not contain "Ass.s", so for 'x' that would be positions 1 and 3. I guess this could be programmed around
2011 Jun 24
1
Fastest way of finding if any members of vector x fall in the range of the rows of matrix y
Hi All, What is the fastest way of finding if any members of vector x fall in the range of the rows of matrix y? I do not want to use two for loops as this will take forever. Any help will be appreciated, best, salih [[alternative HTML version deleted]]
2011 Aug 23
4
Correlation discrepancy
Dear R list, I have one very elementary question regrading correlation between two variables. x = c(44,46,46,47,45,43,45,44) y = c(44,43,41,41,46,48,44,43) > cov(x, y) [1] -2.428571 However, if I try to calculate the covariance using the formula as covariance = sum((x-mean(x))*(y-mean(y)))/8       # no of of paired obs. = 8 or     covariance = sum(x*y)/8-(mean(x)*mean(y)) gives
2012 Nov 01
3
convert list without same component length to matrix
Hi, I have this lame question. I want to convert a list (each with varies in length) to matrix with same row length by eliminating vectors outside the needed range. For example: l<-list(NULL) l[[1]]=1,2,3.7 l[[2]]=3,4,5,6,3 l[[3]]=4,2,5,7 l[[4]]=2,4,6,3,2 l[[5]]=3,5,7,2 #so say I want to only have 4 rows and 5 column in my matrix (or data.frame) and eliminating the 5th index value in l[[2]]
2010 Oct 15
4
split data with missing data condition
Dear all I have data like this: x y [1,] 59.74889 3.1317081 [2,] 38.77629 1.7102589 [3,] NA 2.2312962 [4,] 32.35268 1.3889621 [5,] 74.01394 1.5361227 [6,] 34.82584 1.1665412 [7,] 42.72262 2.7870875 [8,] 70.54999 3.3917257 [9,] 59.37573 2.6763249 [10,] 68.87422 1.9697770 [11,] 19.00898 2.0584415 [12,] 60.27915 2.5365194 [13,] 50.76850
2009 Oct 07
2
Second y-axis --- alternative to par(new=
Hi is there an alternative to par(new), for ading data to a plot for a different y-axis? My problem with par(new=TRUE) is, that it re-defines all axis and labels (as in example 1) and one has to use xlim=... to fix the x-axis. I am looking for something, which simply resets the y-axis, so that a new plot() (or points()/lines()) keeps the x-axis, but re-defines the y-axis. Is there something
2011 Nov 02
1
Generate a sequence of vectors of different length
Hi everyone After the following setup sector=2 # Define Number of Sectors sectors=LETTERS[seq( from = 1, to = sector )] # Name sectors No_ent=round(3/runif(sector)) # Number of entities per sector #Tot_No_ent=sum(No_ent) Goal is to get a List like (A1, A2, A3, B1, B2, B3, B4) where A is denoting an industrial sector and then a numbered sequence of companies within the sector. The step
2008 Feb 27
4
plot y1 and y2 on one graph
Dear all I have a code like x<-1:10 y1<-x+runif(10)*2 y2<-seq(0,50,length.out=10)+rnorm(10)*10 par(mfrow=c(1,2)) plot(y1~x) plot(y2~x) Now I would like to plot y1 and y2 on the same graph, with its two scales (y1 on left and y2 on rigth side). Any help are welcome. Kind regards Miltinho Brazil [[alternative HTML version deleted]]
2013 Jun 15
2
Plotting two y-axis vs non-numeric x-axis
Hi dear all, the following code is correct. but I want to use non-numeric x-axis, for example if I replace time <- seq(0,72,6) by month <- c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Pag") Ofcourse I use factor(month) instead of
2012 Feb 12
3
Vector manipulation
Hello, I am stuck with the following problem. Consider the vector: vec <- c(2,4,6,9,10) I now want to use R to manipulate the vector as follows: [1] 2, 4, 2, 6, 2, 9, 2, 10 In words, the first element of the vector should be placed in front of each following number. Which R commands do I need to achieve that? Cheers -- View this message in context:
2013 Jun 06
2
generating a bar chart with two axis for co-linear variable
Hello Dimitris, I was goggling for some help on Sensitivity vs 1-specificity and saw your link. I hope you can be of help to me in one of the issue that I am facing in generating combo chart(bar chart and plot). I am a novice and have some difficulty in getting this logic correct. I am give a dataset (I am attaching a sample dataset). I am using a barplot() and passing values for
2010 Oct 21
1
How to check for missing report pages per client
Hi, Not sure how to go about checking for missing report pages per client. See example below; I like to extract client 730040, because page 46103 is missing. client page 730001 46101 730001 46102 730019 46101 730035 46101 730040 46101 730040 46102 730040 46104 730040 46105 730052 46101 730052 46102 730074 46101 730074 46102 730074 46103 I appreciate any help, Pauline
2010 Nov 17
2
slicing list with matrices
A list contains several matrices. Over all matrices (list elements) I'd like to access one matrix cell: m <- matrix(1:9, nrow=3, dimnames=list(LETTERS[1:3], letters[1:3])) l <- list(m1=m, m2=m*2, m3=m*3) l[[3]] # works l[[3]][1:2, ] # works l[[1:3]][1, 1] # does not work How can I slice all C-c combinations in the list? S?ren -- S?ren Vogel, Dipl.-Psych. (Univ.), PhD-Student, Eawag,
2010 Nov 25
1
Applying function to elements of matrices in a list
Hello R-help, Please cc me on all responses, as I only receive summary emails from this list. I'm wondering if anybody has any tips on how to accomplish this efficiently. I have a list of matrices, and I'm trying to get the mean of the [i,j]'th element of each matrix in a list. So if I have a list of matrices, say x <-