[R] Adding points to a topo map

2014-03-22 Thread kshel
Hello R Users, I am trying to create a topographical map of Argentina with data points showing the location of 5 species. I first created a map using map() with points using latitude and longitude data for all 5 species as follows: library(maps) # Latitude / longitude coordinates of the 5

[R] Running Rmpi/OpenMPI issues

2014-03-22 Thread Tsai Li Ming
Hi, I have R 3.0.3 and OpenMPI 1.6.5. Here’s my test script: library(snow) nbNodes - 4 cl - makeCluster(nbNodes, MPI) clusterCall(cl, function() Sys.info()[c(nodename,machine)]) mpi.quit() And the mpirun command: /opt/openmpi-1.6.5-intel/bin/mpirun -np 1 -H host1,host2,host3,host4 R --no-save

Re: [R] Adding points to a topo map

2014-03-22 Thread Frede Aakmann Tøgersen
Hi Why didn't you google for maps in R? Both the help pages for the GEOmap functions and the accompanying vignette for GEOmap clearly show how you should ad e.g. points to a map. Here is what you could have done after a careful reading of the documentation. library(geomapdata) data(japmap)

Re: [R] How to import SAS file defining codes by SAS format catalog file

2014-03-22 Thread peter dalgaard
Also, once you are working in R, you need to familiarize yourself with the concept of a factor object. These are used to represent categories in R. Unlike SAS, R considers the categorical/quantitative distinction as part of the variable, e.g. in modeling you don't use CLASS directives, you

[R] How to split a Spell Data Frame into long format (irregular episode length)

2014-03-22 Thread PabloNeruda
Dear R-Users and developers, I am used to work with singular data but now I have to get my data of an spell-data-frame conducted in a big German longitudinal survey. The data structure is: persnr spelltypbegin end xf105 10 1 5 xf105 1 6 15 xf106 4 7

Re: [R] beta package for 3D PDF output

2014-03-22 Thread Michail Vidiassov
Dear All, my 3D PDF output package has been updated to fix incompatibility with recent versions of the rgl package. The source code of the package and demo output are at http://www2.iaas.msu.ru/tmp/u3d/rgl/ Sincerely, Michail __ R-help@r-project.org

[R] plotting vectors of different lengths

2014-03-22 Thread eliza botto
Dear useRs, I have two column vectors of different lengths say x=1,2,3,4,5,6,7,8 and y=1,2,3,4,5. I wanted to plot them by using points() command over an already existed image but got an error, Error in xy.coords(x, y) : 'x' and 'y' lengths differ.What i actually wanted to do was to plot the

Re: [R] plotting vectors of different lengths

2014-03-22 Thread Jorge I Velez
Hi Eliza, Perhaps the following? matpoints(t(dat), type = 'l') HTH, Jorge.- On Sat, Mar 22, 2014 at 10:18 PM, eliza botto eliza_bo...@hotmail.comwrote: Dear useRs, I have two column vectors of different lengths say x=1,2,3,4,5,6,7,8 and y=1,2,3,4,5. I wanted to plot them by using

Re: [R] plotting vectors of different lengths

2014-03-22 Thread eliza botto
Thankyou very much jorge. It would a great favor if i may know how to go from x=1,2,3,4,5,6,7,8 and y=1,2,3,4,5 TO 1 2 3 4 5 6 7 8 1 (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) (1,7) (1,8) 2 (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) (2,7) (2,8) 3 (3,1) (3,2) (3,3)

Re: [R] plotting vectors of different lengths

2014-03-22 Thread Jorge I Velez
You are welcome, Eliza. If I understand correctly, the following will do: x - 1:8 y - 1:5 matrix(apply(expand.grid(x = y, y = x), 1, function(r) paste0((, r[1], ,, r[2], ))), ncol = length(x)) Best, Jorge.- On Sat, Mar 22, 2014 at 10:37 PM, eliza botto eliza_bo...@hotmail.comwrote: Thankyou

Re: [R] plotting vectors of different lengths

2014-03-22 Thread eliza botto
Thanks once again jorge. Regarding your previous reply, i got 50 warnings. Here is what I am trying to do xx-0.5*(-359.5:359.5) yy- 0.5*(-89.75:89.75) x - xx y - yy dat1-matrix(apply(expand.grid(x = y, y = x), 1, function(r) paste0((, r[1], ,, r[2], ))), ncol = length(x)) dat-noquote(dat1)

Re: [R] plotting vectors of different lengths

2014-03-22 Thread arun
Hi Eliza, You could also do: res - outer(y,x, FUN=function(u,v) paste0((,u,,,v,)))  dimnames(res) - list(y,x) #or  names(x) - x  names(y) - y  outer(y,x, FUN=function(u,v) paste0((,u,,,v,))) A.K. On Saturday, March 22, 2014 7:46 AM, Jorge I Velez jorgeivanve...@gmail.com wrote: You are

[R] Fw: Removing blank cells and shifting data in df

2014-03-22 Thread arun
Hi,May be this helps: dat1 - read.table(text=ID  1   2    3 4    5   6 A   1988  1995 2000   2000  2007 B    1995   1997   2000   2001 C   2001 

Re: [R] How to split a Spell Data Frame into long format (irregular episode length)

2014-03-22 Thread arun
Hi, You could try: res - data.frame(dat[rep(1:nrow(dat),with(dat,end-begin+1)),1:2], month=unlist(apply(dat[,3:4],1,function(x) seq(x[1],x[2] row.names(res) - 1:nrow(res) A.K. On Saturday, March 22, 2014 6:29 AM, PabloNeruda s_ysi...@uni-bremen.de wrote: Dear R-Users and developers, I

[R] [R-pkgs] new version of effects package

2014-03-22 Thread John Fox
Dear all, Sandy Weisberg, Michael Friendly, and I would like to announce a new version of the effects package, 3.0-0, now on CRAN; the new version should shortly percolate through the various CRAN mirrors. The major enhancement in this version of effects is the ability to plot partial

Re: [R] plotting vectors of different lengths

2014-03-22 Thread Bert Gunter
On Sat, Mar 22, 2014 at 7:10 AM, arun smartpink...@yahoo.com wrote: [ No no no. She (apparently) says she wants to plot a numeric grid given the x and y coordinates of the grid, not create a character matrix of strings representing the ordered pairs. set.seed(1234) x - runif(6) y - runif(5)

Re: [R] plotting vectors of different lengths

2014-03-22 Thread eliza botto
Dear Bert and Arun, Thankyou very much for your help. I am really obliged. :D Eliza Date: Sat, 22 Mar 2014 08:17:31 -0700 Subject: Re: [R] plotting vectors of different lengths From: gunter.ber...@gene.com To: smartpink...@yahoo.com; jorgeivanve...@gmail.com; eliza_bo...@hotmail.com CC:

Re: [R] Determine breaks based on a break type...

2014-03-22 Thread Kehl Dániel
Hi, you possibly know that there are a lot of methods to determine the number of bins. As a default R has the Sturges method. I think it does something like x - runif(100) mybreaks - hist(runif(x))$breaks r - max(x)-min(x) br - nclass.Sturges(x) #note this is a really simple approach and see

[R] applying dglm() to a binary outcome

2014-03-22 Thread Chris Rh
Dear R-Users, I have a question about the dglm() function from the dglm Package (V 1.6.2). The dglm() function fits double-generalized linear models as described in Smyth, G. K. (1989). Generalized linear models with varying dispersion. J. R. Statist. Soc. B, 51, 47-60. I use

Re: [R] Extract Data form Website Tables

2014-03-22 Thread Jennifer Young
Hi Doran I'm also trying to scrape the leaderboard data. Did you happen to figure out how to extract the athlete's team/affiliate? Trying to do a bit of code to figure out which teams will qualify when individuals are removed. On Sunday, March 2, 2014 2:34:21 PM UTC-5, Doran, Harold wrote:

Re: [R] Determine breaks based on a break type...

2014-03-22 Thread Jim Lemon
On 03/23/2014 03:15 AM, Jonathan Greenberg wrote: R-helpers: I was wondering, given a vector of data, if there is a way to calculate the break points based on the breaks= parameter from histogram, but skipping all the other calculations (all I want is the breakpoints, not the frequencies). I

Re: [R] [Re: Does a survival probability(the probability not, experiencing an event) have to be non-increasing?

2014-03-22 Thread Andrews, Chris
The survival function, S(t), gives you the probability of surviving beyond time t starting from time 0. If you want to know the probability of surviving beyond time t *given* that you survived to get a heart surgery at time u0, that is a different function. It might be S(t)/S(u) depending on

Re: [R] Latest question

2014-03-22 Thread eliza botto
Thankyou very much arun,I worked perfectly.:D Eliza Date: Sat, 22 Mar 2014 13:18:21 -0700 From: smartpink...@yahoo.com Subject: Re: Latest question To: r-help@r-project.org CC: eliza_bo...@hotmail.com HI Eliza, No problem. This should be faster: res2 - matrix(as.vector(

Re: [R] Latest question

2014-03-22 Thread arun
HI Eliza, No problem. This should be faster: res2 - matrix(as.vector( mat1[row.names(mat1) %in% df1$Ry,colnames(mat1) %in% df1$Rx]),nrow=120, dimnames=list(NULL,colnames(res))) identical(res,res2) #[1] TRUE A.K. On Saturday, March 22, 2014 4:14 PM, eliza botto eliza_bo...@hotmail.com

[R] Merge two vectors into one

2014-03-22 Thread Tham Tran
Dear R users, Given two vectors x and y a=1 2 3 b=4 5 6 i want to combine them into a single vector z as 1 4 2 5 3 6 Thanks for your help Tham -- View this message in context: http://r.789695.n4.nabble.com/Merge-two-vectors-into-one-tp4687361.html Sent from the R help mailing list archive

Re: [R] Merge two vectors into one

2014-03-22 Thread arun
Hi, May be this helps: a - 1:3  b - 4:6  z - as.vector(rbind(a,b))  z #[1] 1 4 2 5 3 6 #or z1 - setNames(c(a,b),rep(seq_along(a),2)) z1 - as.vector(z1[order(names(z1))]) z1 #[1] 1 4 2 5 3 6 A.K. Dear R users, Given two vectors x and y a=1 2 3 b=4 5 6 i want to combine them into a single

[R] time series processing - count of datestamp delta's, per group

2014-03-22 Thread Martin Tomko
Apologies if the question is a but naïve, I am a novice in time series data handling in R I have the following type of data, in a long format ( as called by the spacetime vignette – the table contains also space, not noted here): User | Date | Otherdata | A | 01/01/2014 | aa A | 01/01/2014 |

[R] points with-in boundaries of a map

2014-03-22 Thread eliza botto
Dear UseRs, I have a question regarding reading the coordinates within a country' map. I drew map of ireland by using the following commands library(maps) library(mapproj) map(world, ireland) map.axes() You can clearly see the axis labelled. What is want to do is to draw lines (both vertically

[R] Conditional expressions in commands -- basic

2014-03-22 Thread Richard Sherman
Hi all, A simple question, new-ish to R, coming from Stata, and I yes I've looked at great length and not found ... In Stata I might write (with * in place of #) # regress y on x in the set of observations where a==1 reg y x if a==1 # descriptives on x where a==1 su x if a==1 # generate a

Re: [R] Conditional expressions in commands -- basic

2014-03-22 Thread Sarah Goslee
Hi Richard, ?if ?ifelse ?subset ?[ depending on the specific operation. See inline. Given a data frame tdf with x, y, and a (or with vectors creating a data frame using): tdf - data.frame(x=x, y=y, a=a) On Sat, Mar 22, 2014 at 10:21 PM, Richard Sherman rss@gmail.com wrote: Hi all, A

Re: [R] points with-in boundaries of a map

2014-03-22 Thread Jim Lemon
On 03/23/2014 01:01 PM, eliza botto wrote: Dear UseRs, I have a question regarding reading the coordinates within a country' map. I drew map of ireland by using the following commands library(maps) library(mapproj) map(world, ireland) map.axes() You can clearly see the axis labelled. What is