Pierre Micallef | 25 Jul 12:20 2016
Picon

adding a data point on a boxplot

Hi

Please could somebody offer some assistance with the following problem?

I am trying to use the boxplot function. As standard it displays (min, lower Q, median, Upper Q and Max). For
each dotplot I would also like to add the current/most recent value from my data series as a data point. The
goal being to graphically show where current values are compared to the above standard statistics.

I have removed the date columns from the data but it should be in descending order i.e. the last data point in
each series should be the current value.

Happy for someone to amend the whole code if there is a smarter way of doing it.

Thanks for any help you can give with this.

See code below:

blpConnect()

data<-data.frame(LargeValue=bdh("DJUSVL Index", c("PX_LAST"), start.date=Sys.Date()-252*5),
                 LargeGrowth=bdh("DJUSGL Index", c("PX_LAST"), start.date=Sys.Date()-252*5))
data <- data[,!names(data) %in% c("LargeValue.date","LargeGrowth.date")]
boxplot(data, las = 2, names = c("Large Value"," Large Growth"), col =
c("red","royalblue2"),main=toupper("Box Plot Value vs Growth"), Xlab="Index Level", range = 0, horizontal=TRUE)

Thanks
Pierre

	[[alternative HTML version deleted]]

(Continue reading)

Abdoulaye SARR | 25 Jul 15:06 2016
Picon

Re: probelm with xlab ylab and xaxp barplot


>> Hi Marc and Others,

I am still struggling to have my slab and ylab displayed on a bar plot. Marc did useful advise on playing with
mar settings. I tried may combinations and canít have it work.

I paste the code I am suing hoping guidance on solving this issue.

## extract works for all time steps
d1<-read.nc(gp)

d2<-read.nc(er)

d3<-read.nc(me)

d4<-read.nc(ne)

d5<-read.nc(ar)

d6<-read.nc(cc)

d7<-read.nc(mr)

d8<-read.nc(ic)

z1<-d1$spei
z2<-d2$spei
z3<-d3$spei
z4<-d4$spei
z5<-d5$spei
(Continue reading)

Miluji Sb | 25 Jul 15:02 2016
Picon

Country names from latitude and longitude

I have the following data at 0.5 degree by 0.5 degree.

temp <- dput(head(ptsDF,10))
structure(list(longitude = c(-68.25, -67.75, -67.25, -68.25,
-67.75, -67.25, -71.25, -70.75, -69.25, -68.75), latitude = c(-54.75,
-54.75, -54.75, -54.25, -54.25, -54.25, -53.75, -53.75, -53.75,
-53.75), GDP = c(1.683046, 0.3212307, 0.0486207, 0.1223268, 0.0171909,
0.0062104, 0.22379, 0.1406729, 0.0030038, 0.0057422)), .Names =
c("longitude",
"latitude", "GDP"), row.names = c(4L, 17L, 30L, 43L, 56L, 69L,
82L, 95L, 108L, 121L), class = "data.frame")

I would like add the corresponding country names to each of the
coordinates. This is what I have done:

library(data.table)
library(rgdal)
library(reshape2)
library(dplyr)
library(tidyr)
library(lubridate)
library(maps)
library(countrycode)
library(ggplot2)
library(raster)

coord_cells <-temp [,c(1,2)]
pts_cells <-
SpatialPoints(coord_cells,proj4string=CRS(proj4string(worldmap)))
indices_cells <- over(pts_cells, worldmap,na.rm=TRUE)
(Continue reading)

Justin Thong | 25 Jul 12:48 2016
Picon

Soft Question: Where to find this reference.

I notice a lot of r documentation refer to this reference below. I can't
seem to find it anywhere.
Does anyone have a link to point to where I can either view it or buy it?

*Chambers, J. M., Freeny, A and Heiberger, R. M. (1992) Analysis of
variance; designed experiments*

--

-- 
Yours sincerely,
Justin

*I check my email at 9AM and 4PM everyday*
*If you have an EMERGENCY, contact me at +447938674419(UK) or
+60125056192(Malaysia)*

	[[alternative HTML version deleted]]

Loris Bennett | 25 Jul 11:37 2016
Picon
Picon

Interpreting error message probably caused by directlabels

Dear all,

Possibly as a result of an update to R 3.3.0, a script which I had been
running regularly via cron, the following line

  p_named <- p_anon + geom_dl(aes(label=user,colour=user),
                              list("top.points",
                              cex = 0.5, rot = -45, hjust = 1))
now produces the error:

  Error in ggplot2::layer(data = data, mapping = mapping, geom = GeomDl,  : 
    must specify method= argument

Given that I don't call ggplot2::layer directly and given that
?ggplot2::layer doesn't contain any reference to an argument 'method',
what is the interpretation of this error message?

Aside from understanding the error message I would also be interested in
a solution to the problem, which I assume is due to an incompatibility
between the new version of R and the  package 'directlabels'.

Cheers,

Loris

--

-- 
This signature is currently under construction.

BARLAS Marios 247554 | 25 Jul 01:29 2016
Picon

Re: Create a colour scale for different data sets

Dear Jim,

Thanks for the advice! 

Turns out there was nothing wrong with my graphing code. I was just stupid when modifying the wafer map
reconstruction code. If in the previous code you change this line : 

               dies.in.wafer.r[inn]      <- meas.data

to
              dies.in.wafer.r[inn]      <- meas.data[ixx]

It works perfectly. 

In case any1 else needs cartography mapping I will generalize this function, so feel free to ask for the
code. 

Best,
Mario
________________________________________
From: Jim Lemon [drjimlemon <at> gmail.com]
Sent: Monday, July 25, 2016 12:17 AM
To: BARLAS Marios 247554
Subject: Re: [R] Create a colour scale for different data sets

Hi Marios,
One way to get a common color scale for a number of different sets of
values is the color.scale (plotrix) function. By setting the "xrange"
argument to the range of all values, the color for a particular value
will be the same in all subsets calculated. See the second example in
(Continue reading)

BARLAS Marios 247554 | 24 Jul 23:11 2016
Picon

Create a colour scale for different data sets

Hello Every1, 

I'm working on analysing some data and I want to make some cartography maps. 

Since I treat data in batch, I need to have a common reference colour scale for all the datasets I need to plot.
This is important otherwise it becomes hard to quickly assert visually changes from one experiment to
another if the colour scale resets all the time. 

So I though of finding the min and max value of my data values and create a colour scale versus that. 

Nonetheless the code does not work as intended, 
I realised my code was not easily reproducible so I send some with initialized values to help :)

Here is a part of the code (reproducible):

meas.data <- c( 2.38762e+02, 2.54709e+02, 2.45204e+02, 2.32134e+02, 2.28587e+02, 2.31493e+02,
2.34867e+02, 2.41127e+02, 2.76113e+02, 2.57450e+02, 2.23804e+02, 2.39064e+02, 2.28636e+02,
2.37417e+02, 2.53686e+02, 2.45593e+02, 2.29043e+02, 9.25698e+10, 2.31001e+02, 2.36022e+02,
2.67654e+02, 2.50275e+02, 2.72641e+02, 2.24342e+02, 9.36361e+10, 2.28610e+02, 2.20854e+02,
2.37955e+02, 2.58944e+02, 2.68088e+02, 2.36356e+02, 2.52802e+02, 2.32976e+02, 2.39819e+02,
2.48820e+02, 2.80206e+02, 2.63318e+02, 2.43431e+02, 2.83426e+02, 2.48557e+02, 2.45493e+02,
2.53264e+02, 2.51834e+02, 2.34187e+02, 2.56326e+02, 2.96419e+02, 2.52473e+02, 2.68144e+02, 2.40842e+02)

die.codes <- c("X5_Y4"  , "X5_Y6" ,  "X5_Y8" ,  "X5_Y9", "X5_Y10", "X5_Y11", "X5_Y12", "X7_Y4", "X7_Y6",
"X7_Y8", "X7_Y9", "X7_Y10", "X7_Y11", "X7_Y12", "X9_Y4", "X9_Y6", "X9_Y8", "X9_Y9", "X9_Y10",
"X9_Y11", "X9_Y12", "X11_Y4", "X11_Y6", "X11_Y8", "X11_Y9", "X11_Y10", "X11_Y11", "X11_Y12",
"X13_Y4", "X13_Y6", "X13_Y8", "X13_Y9",  "X13_Y10", "X13_Y11", "X13_Y12", "X15_Y4",  "X15_Y6", 
"X15_Y8",  "X15_Y9",  "X15_Y10", "X15_Y11", "X15_Y12", "X17_Y4",  "X17_Y6", "X17_Y8" ,"X17_Y9", 
"X17_Y10", "X17_Y11", "X17_Y12")
dies.x.total <- 17
(Continue reading)

Quade test

Hello to all the list members. I would like to perform a Quade test with
more than one covariate. I know the command quade.test and I have seen the
example below:

## Conover (1999, p. 375f):
## Numbers of five brands of a new hand lotion sold in seven stores
## during one week.
y <- matrix(c( 5,  4,  7, 10, 12,
           1,  3,  1,  0,  2,
          16, 12, 22, 22, 35,
           5,  4,  3,  5,  4,
          10,  9,  7, 13, 10,
          19, 18, 28, 37, 58,
          10,  7,  6,  8,  7),
        nrow = 7, byrow = TRUE,
        dimnames =
        list(Store = as.character(1:7),
             Brand = LETTERS[1:5]))
y
quade.test(y)

My question is as follows: how could I introduce more than one covariate? In
this example the covariate is the Store variable. But what if I also have
another covariate i.e.: the the number of inhabitants of the town in which
each store is located.

Thanks in advanced for your help!

Fernando

(Continue reading)

Patrick Johann Schratz | 24 Jul 15:10 2016
Picon
Gravatar

glmmPQL crashes on inclusion of corSpatial object

Link to data: <https://www.dropbox.com/s/yi3vf0bmqvydr8h/data.Rd?dl=0>  
(1170 obs, 9 variables, .Rd file) [plain link in case sth goes wrong 
with the hyperlink: https://www.dropbox.com/s/yi3vf0bmqvydr8h/data.Rd?dl=0]

Simply read it in using `readRDS(file)`.

I¬īm trying to setup a GLMM using the `glmmPQL` function from the `MASS` 
package including a random effects part and accounting for spatial 
autocorrelation. However, R (Version: 3.3.1) crashes upon execution.

     library(nlme)

     # setup model formula
     fo <- hail ~ prec_nov_apr + t_min_nov_apr + srad_nov_apr + age

     # setup corSpatial object
     correl = corSpatial(value = c(10000, 0.1), form = ~ry + rx, nugget 
= TRUE,
                         fixed = FALSE, type = "exponential")
     correl = Initialize(correl, data = d)

     # fit model
     fit5 <- MASS::glmmPQL(fo, random = ~1 | date, data = d,
                     correl = correl, family = binomial)

What I tried so far:

- reduce number of observation
- play with `corSpatial` parameters (range and nugget)
- reduce number of fixed predictors
(Continue reading)

paola_fortini@yahoo.it | 24 Jul 13:32 2016
Picon

Re: Changing legend to fill colour in ggplot


Inviato da Yahoo Mail su Android
	[[alternative HTML version deleted]]

paola_fortini@yahoo.it | 24 Jul 13:31 2016
Picon

Re: Changing legend to fill colour in ggplot


Inviato da Yahoo Mail su Android
	[[alternative HTML version deleted]]


Gmane