[R] Random data

2009-11-25 Thread mentor_
Hi, how can I produce random data which lies around a straight line with angle 45 degree. Similar to this image: http://zoonek2.free.fr/UNIX/48_R/g134.png Cheers -- View this message in context: http://old.nabble.com/Random-data-tp26513822p26513822.html Sent from the R help mailing list archiv

[R] cor.test(x,y)

2009-03-13 Thread mentor_
Hi, I am not sure which test is applied to the data if you use cor.test(x, y) ? Is it an unpaired t-Test? Regards -- View this message in context: http://www.nabble.com/cor.test%28x%2Cy%29-tp22492993p22492993.html Sent from the R help mailing list archive at Nabble.com. _

[R] Save image as metafile

2008-12-08 Thread mentor_
Hi, how can I save an image as a metafile? I know within windows you can do a right click and then 'save image as metafile' but I use Mac OS X...I know as well that mac users have a right click as well, but it does not work. Is there a command in R for saving images as metafiles? Regards, mentor

[R] merge character strings

2008-12-02 Thread mentor_
Hi, how can I do the following in R?: vec <- c("a", "b", "c") magic. print(str) "abc" or even better: "(a,b,c)"? Cheers -- View this message in context: http://www.nabble.com/merge-character-strings-tp20790116p20790116.html Sent from the R help mailing list archive at Nabble.com. __

[R] par(ask=TRUE) and devAskNewPage(ask=TRUE) not working

2008-11-27 Thread mentor_
Hi, First, I do some calculation, then a plot. Add some lines and texts to the plot. Second, do some further calculation, then a plot. Add again some lines and texts to the plot. Third, do some further calculation, then Fourth, . After a plot is complete (means the plot itself, lines and

[R] Help with matplot

2008-11-13 Thread mentor_
Hi, two days ago I have asked the list if there is a better way to plot a matrix using the following plot command: plot(matrix[1,], type="l") for (i in 2:dim(matrix)[1]) { lines(matrix[i,], type="l") } I have been told to use the matplot function, but unfortunately I matplot does not plo

[R] Surface plotting

2008-11-13 Thread mentor_
Hi, I would like to plot a matrix which comprises 3 columns. So first column should be the x-axis. Second the y-axis and the third one should be the z-axis. I know that I can plot such data using the scatterplot3d, but I would like to have a surface plot like you can do with wireframe and persp.

[R] Plot matrix

2008-11-11 Thread mentor_
Hi, I would like to plot the rows of a matrix. Is there a better way as doing it in the following way?: plot(matrix[1,], type="l") for (i in 2:dim(matrix)[1]) { lines(matrix[i,], type="l") } Cheers -- View this message in context: http://www.nabble.com/Plot-matrix-tp20438584p20438584.

Re: [R] Re order matrix columns

2008-11-10 Thread mentor_
Hi, found a quite simple solution: test a b c d e [1,] 1 11 21 31 41 [2,] 2 12 22 32 42 [3,] 3 13 23 33 43 [4,] 4 14 24 34 44 [5,] 5 15 25 35 45 list <- c("b", "c", "a", "e", "d") test[,list] mentor_ wrote: > > Hi, >

[R] Re order matrix columns

2008-11-10 Thread mentor_
Hi, I have found the following thread to reorder a data.frame. I would like to do same regarding a matrix: https://stat.ethz.ch/pipermail/r-help/2008-February/154138.html I achieved this with a for loop and cbind but I think using 'is.element' is much more appropriate. Can anyone help? Cheers

[R] Delete rows from matrix having at least one zero value

2008-11-09 Thread mentor_
Hi, I have a further question about matrix manipulation. Imagine the following two matrices: > test [,1] [,2] [,3] [,4] [1,]1064 [2,]2575 [3,]3686 [4,]4000 > matrix(is.element(test,0), ncol=4) [,1] [,2] [,3] [,4] [1,]

Re: [R] Delete rows from matrix having at least one zero value

2008-11-09 Thread mentor_
Have found a solution: matrix[rowSums(matrix == 0) == 0, ] mentor_ wrote: > > Hi, > > I have a further question about matrix manipulation. > > Imagine the following two matrices: >> test > [,1] [,2] [,3] [,4] > [1,]1064 > [2,]2

[R] Select specific rows of a matrix

2008-11-09 Thread mentor_
Hi, if I have a large matrix e.g. with the dimensions of 1000 rows and 10 columns. How can I select rows comprising one or more values between a specific range of two values? So e.g. a row has one or more values between the range of 100 - 120. Cheers -- View this message in context: http://www

[R] Re move specific rows from a matrix

2008-11-07 Thread mentor_
Hi, imagine the following two matrix: Matrix A: a b c 1 2 3 4 5 6 7 8 9 Matrix B: a 4 7 I would like to remove those rows from matrix A which are present in both matrices. So after removing the corresponding rows the matrix A should look like this: Matrix A: a b c 1 2 3 Thanks in advance! --

Re: [R] Space between bars in barplot

2008-10-10 Thread mentor_
Hi, thanks again for your help. I played around with your suggestions to change the appearance of my graph, but there is still a problem I could not fix. The vector, which I want to plot, contains 60 entries. After 3 bars I want to have a large gap between the next 3 bars. But what always happens

[R] Overlay Plots

2008-10-10 Thread mentor_
Hi, I have three vectors and I would like to plot them in one window. So R should overlay them in the quartz. I achieved this by plotting the first vector: plot(v1) and add the other two with points(v2) and points(v3). Is there another way to achieve the same result? Cheers -- View this message

[R] Thank you very much for all your possible solutions!

2008-10-08 Thread mentor_
I also managed to get the right result but within a for loop ;) So I really appreciate your solutions! Thanks a lot! -- View this message in context: http://www.nabble.com/Using-grep-tp19881017p19882769.html Sent from the R help mailing list archive at Nabble.com. _

[R] Using grep

2008-10-08 Thread mentor_
Hi, I have a vector A with (200, 201, 202, 203, 204, ... 210) and a vector B with (201, 204, 209). Now I would like to get the position in vector A matches with the entries in vector B So what I want to have is the following result: [1] 2 5 10 I tried the following: grep(B, A) grep(c(B), A) A

[R] Space between bars in barplot

2008-10-08 Thread mentor_
Hi, with the "space" parameter it is possible to change the gap / distance between the bars, but is it also possible to change the "space" after each 6th bar? So for example you have bars from 1 to 6 then a large gap and then the next six bars from 7 to 12 Thanks a lot! -- View this message in