[R] can we visualize water flows with 3d in R?

2016-10-12 Thread Marna Wagley
Hi R Users, Is it possible to visualize river flow in 3D (latitude, longitude with respect to depth)? The example of my data looks like. Any suggestions? > dat1 long lat depth flow 1 1015.9 857 1.00 1.50 2 1015.9 857 1.25 1.23 3 1015.9 857 0.50 2.00 4 1015.9 858 0.10 1.95 5 1015.9 858 0.

Re: [R] can we visualize water flows with 3d in R?

2016-10-12 Thread Jim Lemon
Hi Marna, Isn't the conventional way to visualize depth as shades of blue? library(plotrix) depth.col<-color.scale(dat1$depth,extremes=c("lightblue",blue")) Then color the lon/lat rectangles with depth.col Jim On Wed, Oct 12, 2016 at 7:49 PM, Marna Wagley wrote: > Hi R Users, > Is it possibl

Re: [R] can we visualize water flows with 3d in R?

2016-10-12 Thread Michal Kubista
Dear Marna, This might come handy: http://www.geo.ut.ee/aasa/LOOM02331/heatmap_in_R.html Best regards, Michal *Michal Kubišta* Retail Analytics Support Europe Central/East Nielsen tel (+420) 242 438 737 www.nielsen.com [image: nielsen] 2016-10-12 10:49 GMT+02:00 Marna

Re: [R] can we visualize water flows with 3d in R?

2016-10-12 Thread Duncan Murdoch
On 12/10/2016 4:49 AM, Marna Wagley wrote: Hi R Users, Is it possible to visualize river flow in 3D (latitude, longitude with respect to depth)? The example of my data looks like. Any suggestions? dat1 long lat depth flow 1 1015.9 857 1.00 1.50 2 1015.9 857 1.25 1.23 3 1015.9 857 0.50

Re: [R] can we visualize water flows with 3d in R?

2016-10-12 Thread clark richards
Hi Marna, It's hard to tell exactly what you're looking for, since making "3D" plots of fluid flow has significant interpretative challenges (e.g. how do you see the flow for points that are "inside" the domain?). It is common in fields like oceanography to plot 2D "sections" of the 3D flow -- e.g

[R] xtractomatic package is now available in CRAN

2016-10-12 Thread Roy Mendelssohn - NOAA Federal
I am pleased to announce that the xtractomatic package is now available from CRAN. xtractomatic is an R package developed to subset and extract satellite and other oceanographic related data from a remote server. The program can extract data for a moving point in time along a user-supplied set

[R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
Dear group, I have been struggling to barplot two different measurements from one subject. These two measures differ in range. I want to plot row 1 axis on left side and row 2 values on right side. For a given column I want to plot GN and CN next to each other. my dput code is below : structure

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread S Ellison
I have suspect that the most common answer to this will be 'don't', for all the reasons statisticians don't like mixing vertical scales on the same plot. See http://www.perceptualedge.com/articles/visual_business_intelligence/dual-scaled_axes.pdf for one article on that topic. But if you must,

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adams, Jean
Adrian, What story are you trying to tell? Or what question are you trying to answer by visualizing these data? How is a bar plot of these numbers going to help? I'm just wondering if perhaps a different visualization might make more sense, for example, a scatter plot of GN vs. CN. m <- struct

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Duncan Murdoch
On 12/10/2016 12:20 PM, Adrian Johnson wrote: Dear group, I have been struggling to barplot two different measurements from one subject. These two measures differ in range. I want to plot row 1 axis on left side and row 2 values on right side. For a given column I want to plot GN and CN next to

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
Hi Adams, The story I am trying to show visually relationship between GN and CN for every column. Each column represents a patient. In each patient, a particular chromosome region (CN) is either lost (-2 or -1) or gained (1 or 2). Typically if loss (one copy loss - as humans have pair of chromosome

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
Thanks Duncan. I am sorry I cannot scale second row (d[2,]). I was looking for a way to plot d[2,] values next to d[1,] with a right side axis=4 on right side. -2,-1,0,1,2 thanks Adrian On Wed, Oct 12, 2016 at 12:42 PM, Duncan Murdoch wrote: > On 12/10/2016 12:20 PM, Adrian Johnson wrote: >> >>

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Duncan Murdoch
On 12/10/2016 12:59 PM, Adrian Johnson wrote: Thanks Duncan. I am sorry I cannot scale second row (d[2,]). I was looking for a way to plot d[2,] values next to d[1,] with a right side axis=4 on right side. -2,-1,0,1,2 That doesn't really make graphical sense, but you can use any transformati

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adams, Jean
Adrian, Very interesting. What do you think of using colors to indicate the five possible loss/gain levels? For example: a <- structure(c(112L, 0L, 579L, 1L, 131L, 1L, 2234L, 2L, 2892L, 1L, 528L, 0L, 582L, 2L), .Dim = c(2L, 7L), .Dimnames = list(c("GN", "CN"), c("DC5", "DC8", "DC14", "DC18",

Re: [R] create variable

2016-10-12 Thread Ashta
Hi David and all, I want run the following script in a loop but faced difficulty. trt=c(1,2,2,4,5,6,7,8) for(i in 1:length (trt)) { try[i] <- (select trt, date1, date2, datediff(date1,date2) as d12diff [i] from dateTable where trt=[i]") } I would appreciate if you point me

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread David L Carlson
Are you looking for something like this? Assuming your data is d: > d[2, ] <- d[2, ]*500 > oldp <- par(mar=c(4.1, 4.1, 4.1, 4.1)) > barplot(d, ylim=c(-1000, 3000), beside=TRUE, axes=FALSE) > axis(2, c(0, 1000, 2000, 3000)) > axis(4, c(-1000, -500, 0, 500, 1000), c(-2, -1, 0, 1, 2)) > mtext("GN",

[R] Incremental

2016-10-12 Thread Val
Hi all, I have a data set like dat<-read.table(text=" y1, flag 39958,S 40058,R 40105,X 40294,H 40332,S 40471,R 40493,R 40533,X 40718,H 40771,S 40829,R 40892,X 41056,H 41110,S 41160,R 41222,R 41250,R 41289,R 41324,X 41355,R 41415,X 41562,X 41562,H 41586,S ",sep=",",header=TRUE) First sort the data

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
Hello Dr. Carlson, thanks for the tip. It is exactly what I am looking for. I see the trick lies in axis(4, c(-1000, -500, 0, 500, 1000), c(-2, -1, 0, 1, 2)) Would you please help understand why two different vectors of ranges are defined and yet I see only vector with -2,-1,0,1,2 is visible. Th

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Adrian Johnson
As Dr.Murdoch suggested, transformation of row 2 is important to make sense in graphical depiction. Thanks to all. On Wed, Oct 12, 2016 at 4:25 PM, Adrian Johnson wrote: > Hello Dr. Carlson, > thanks for the tip. It is exactly what I am looking for. > > I see the trick lies in > axis(4, c(-1000,

Re: [R] Incremental

2016-10-12 Thread Rui Barradas
Hello, Seems simple: # 1) dat$x1 <- cumsum(dat$flag == "S") # 2) dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1])) Hope this helps, Rui Barradas Em 12-10-2016 21:15, Val escreveu: Hi all, I have a data set like dat<-read.table(text=" y1, flag 39958,S 40058,R 40105,X 40294,H 4

Re: [R] Incremental

2016-10-12 Thread Val
Rui, Thank You! the second one gave me NULL. dat$z2 <- unlist(tapply(dat$y1, dat$x1, function(y) y - y[1])) dat$z2 NULL On Wed, Oct 12, 2016 at 3:34 PM, Rui Barradas wrote: > Hello, > > Seems simple: > > > # 1) > dat$x1 <- cumsum(dat$flag == "S") > > # 2) > dat$z2 <- unlist(tapply(dat$y1, dat

Re: [R] Opening or activating a URL to access data, alternative to browseURL

2016-10-12 Thread Ryan Utz
Eureka! I wish I could send a box of digital donuts. Thanks so much On Tue, Oct 11, 2016 at 9:21 AM, Duncan Murdoch wrote: > On 11/10/2016 7:59 AM, Ryan Utz wrote: > >> Bob/Duncan, >> >> Thanks for writing. I think some of the things Bob mentioned might work, >> but I'm still not quite getti

Re: [R] create variable

2016-10-12 Thread David Winsemius
> On Oct 12, 2016, at 11:20 AM, Ashta wrote: > > Hi David and all, > > I want run the following script in a loop but faced difficulty. > > trt=c(1,2,2,4,5,6,7,8) > for(i in 1:length (trt)) > { > try[i] <- (select trt, date1, date2, datediff(date1,date2) as > d12diff [i] from >

Re: [R] barplot beside=TRUE - values differ on scales

2016-10-12 Thread Jim Lemon
Hi Adrian, Perhaps what you want is this: ajdat<-structure(c(112L, 0L, 579L, 1L, 131L, 1L, 2234L, 2L, 2892L, 1L, 528L, 0L, 582L, 2L), .Dim = c(2L, 7L), .Dimnames = list(c("GN", "CN"), c("DC5", "DC8", "DC14", "DC18", "DC19", "DC20", "DC23" ))) library(plotrix) twoord.plot(0.8:6.8,ajdat[2,],1.2:7.2,

Re: [R] can we visualize water flows with 3d in R?

2016-10-12 Thread David Winsemius
> On Oct 12, 2016, at 4:28 AM, Duncan Murdoch wrote: > > On 12/10/2016 4:49 AM, Marna Wagley wrote: >> Hi R Users, >> Is it possible to visualize river flow in 3D (latitude, longitude with >> respect to depth)? >> The example of my data looks like. Any suggestions? >> >>> dat1 >>long lat d

[R] Maybe OT: Forking in R scripts?

2016-10-12 Thread K. Elo
Dear all, I am currently working a research project on social media interaction. As a part of this project, mostly for teaching purposes, I should develop a R-based approach for real-time visualisation of streamed data (from Twitter). My idea is simple (and working :) ): A Python-script stre

Re: [R] can we visualize water flows with 3d in R?

2016-10-12 Thread Duncan Mackay
Hi With a small data set 3D is not really an option; reduce the number of dimensions-- 2D conditional library(lattice) xyplot(flow ~ depth|factor(long), dat1, groups = lat, type = c("p","r"), pch = 16) I had started with lat and long reversed doing EDA gave the above ? latitude effect Regards