Displaying 20 results from an estimated 10000 matches similar to: "Coloring counties on a full US map based on a certain criterion"
2012 Jan 27
1
Overimposing one map in ssplot onto another
Hello!
I have 2 maps - both created in ssplot and both identical in terms of
outline. Is there any way to superimpose Map1 (which has black borders
between Canadian provinces) onto Map2 (which is also a map of Canada)?
Thanks a lot for your hints!
Dimitri
### A. Reading in Canada data at the province and then at the county level:
library(raster)
getData('ISO3') # Canada's code is
2012 Jan 25
1
Coloring Canada provinces (package maps?)
Dear R'ers,
I am wondering what is the smallest geographicterritorial unit
available for formatting in Canada. Provinces?
I know that in the US it is the county so that I can color US
counties any way I want, for example:
### Example for coloring US counties
### Creating an ARTIFICIAL criterion for coloring US counties:
library(maps)
allcounties<-data.frame(county=map('county',
2012 Jan 16
1
Package "maps": what is the name of county # 2395?
I am using "maps". I am running the following code to get this list of
all the counties:
map('county', plot=FALSE)$names
In the output, all counties have first the state listed and then,
after a comma, the name of the county.
However, county # 2395 (State = south dakota) has no county name.
Anyone knows what this county is?
Thank you!
--
Dimitri Liakhovitski
2009 Aug 12
1
Map of UK Counties - to use in R
Hi,
Can anyone help me with either of these:
1) Map of the UK counties that I could use in R?
2) How could I use an existing map for example, a map from here
http://www.itraveluk.co.uk/maps/england.html - in R. I need to use a UK map
to plot locations on it by lat & long.
Would appreciate help on any of these.
Thanks,
Raoul
--
View this message in context:
2006 Dec 27
3
counties in different colours using map()
Hi,
I would like to plot a map of US counties using different colors. map()
seems to be the function to use, e.g.
library(maps); map('usa'); map('county', 'colorado', add=T,fill = T,
col=c(1:5))
plots Colorado counties using colours 1 to 5.
However, I want each color to represent a certain value - a value to be
picked from a data frame.
This code should show a
2009 Apr 03
1
US county map question
Hi R-help:
I'm just an old guy and new to this list... But have been using R for
years now.
I want to make a map of counties in the US with shaded colors that
depend on the level of variable "Y" that I want to map.
I have the US county and state fips codes and the Y variable.
How do I do this?
Please reply to pzs6@cdc.gov
Thanks,
Phil Smith
pzs6@cdc.gov
[[alternative HTML
2017 Jul 27
2
na.rm = T treatment by ggplot2's geom_bar
Just a thought:
Did you try na.rm = TRUE in case you have an object named "T" in scope?
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Thu, Jul 27, 2017 at 7:49 AM, Dimitri Liakhovitski
<dimitri.liakhovitski at
2017 Jul 27
2
na.rm = T treatment by ggplot2's geom_bar
I think you should be more suspicious of yourself, Dimitri. A letter T variable can easily arise in the problem domain when you are not thinking of logical values at all, at which point your cavalier use of T as a synonym for TRUE can suddenly become a bug.
--
Sent from my phone. Please excuse my brevity.
On July 27, 2017 8:18:03 AM PDT, Dimitri Liakhovitski <dimitri.liakhovitski at
2011 Aug 01
1
Identifying US holidays
Hello!
I am trying to identify which ones of a vector of dates are US
holidays. And, ideally, which is which. And I do not know (a-priori)
which dates those should be.
I have, for example:
x<-seq(as.Date("2011-01-01"),as.Date("2011-12-31"),by="day")
(x)
I think chron should help me here - but maybe I am not using it properly:
library(chron)
is.holiday(chron) #
2017 Jul 27
0
na.rm = T treatment by ggplot2's geom_bar
?hanks for the advice, Jeff. Will keep it in mind.
But I am anal - I shy away from using letters and words that "look
familiar" to me in R (such as mean, sd, T, etc.)
But still, it's a good advice.
On Thu, Jul 27, 2017 at 11:53 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:
> I think you should be more suspicious of yourself, Dimitri. A letter T
> variable can
2013 May 21
1
Calculating AIC for the whole model in VAR
Hello!
I am using package "VAR".
I've fitted my model:
mymodel<-VAR(mydata,myp,type="const")
I can extract the Log Liklihood for THE WHOLE MODEL:
logLik(mymodel)
How could I calculate (other than manually) the corresponding Akaike
Information Criterion (AIC)?
I tried AIC - but it does not take mymodel:
AIC(mymodel)
# numeric(0)
Thank you!
--
Dimitri Liakhovitski
2017 Jul 27
0
na.rm = T treatment by ggplot2's geom_bar
Thank you, Bert!
I do NOT have an object named "T" in scope (I checked - and besides, it
would never occur to me to use this name).
TRUE or T results in the same unexpected behavior:
ggplot(data = md, mapping = aes(x = a)) +
geom_bar(na.rm = TRUE)
On Thu, Jul 27, 2017 at 10:57 AM, Bert Gunter <bgunter.4567 at gmail.com>
wrote:
> Just a thought:
>
> Did you try
2011 Aug 02
3
identifying weeks (dates) that certain days (dates) fall into
Hello!
I have dates for the beginning of each week, e.g.:
weekly<-data.frame(week=seq(as.Date("2010-04-01"),
as.Date("2011-12-26"),by="week"))
week # each week starts on a Monday
I also have a vector of dates I am interested in, e.g.:
july4<-as.Date(c("2010-07-04","2011-07-04"))
I would like to flag the weeks in my weekly$week that
2009 Sep 22
1
any way to make it work faster (deleting rows that contain certain values)
Hello, dear R'ers,
index<-expand.grid(1:7,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4,1:4)
In this case, dim(index) is 7,340,032 (!) and 11.
I realize it's huge.
Then, I am trying to get rid of the undesired combinations of columns.
They should not contain identical values in any 2 columns.
Also if column 1 has a value of 5, there should be no 2 in any other column,
if column 1 has a value
2010 May 12
1
reading in all files of a certain type
Hello,
I am wondering if it's possible to read in all files of a certain type
- without specifying their names.
For example, I have 10 .csv files in my working directory.
I would like to read them in and bind them all together. I was
thinking of writing a loop, read in all files, and then bind them.
Is it possible?
Thanks a lot!
--
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com
2011 Apr 03
0
Plotting data on a US County Map
Hi,
I have a data frame listing US counties and a quantity ("number") per county
and I have a shapefile of the US with county ID's. I would like to plot the
"number" variable on a map (in the shapefile) using a color range per county
(e.g. white = min(number) = 2, black = max(number) = 15). Can anyone help me
actually plotting the data on the map? This is how far I got.
2017 Jul 27
0
na.rm = T treatment by ggplot2's geom_bar
To clarify: my question is not about "who could I exclude NAs from being
counted" - I know how to do that.
My question is: Why na.rm = T is not working for geom_bar in this case?
On Thu, Jul 27, 2017 at 8:24 AM, Dimitri Liakhovitski <
dimitri.liakhovitski at gmail.com> wrote:
> Hello!
>
> I am trying to understand how ggplot2's geom_bar treats NAs.
> The help file
2017 Jul 27
3
na.rm = T treatment by ggplot2's geom_bar
Hello!
I am trying to understand how ggplot2's geom_bar treats NAs.
The help file says:
library(ggplot2)
?geom_bar
na.rm: If FALSE, the default, missing values are removed with a warning. If
TRUE, missing values are silently removed.
I am trying it out:
md <- data.frame(a = c(letters[1:5], letters[1:4], letters[1:3], rep(NA,
3)))
str(md); levels(md$a)
ggplot(data = md, mapping = aes(x =
2006 Aug 10
6
passing hash from controller to view and pluralization?
hi,
i have 2 tables (counties and towns). counties has_many towns and towns
belong_to counties.
now my question:
i thought i would need to do is say @counties = Counties.find(:all).
should that not return to me all counties in the counties table WITH all
towns associated with each county?
in my view i was getting error when doing this
if(counties.has_towns?)
saying undefined has_towns
2007 Sep 27
1
R: anova.Design
Dear All:
I tried to replicate a case study described by Prof. Harrell in Chapter 7 of
his Regression Modeling Strategies book, but failed on using anova.Design to
reproduce his table 7.1, Following is the code:
rm(list=ls())
library(Hmisc)
library(Design)
getHdata(counties)
counties$older <- counties$age6574 + counties$age75
label(counties$older) <- '% age >= 65, 1990'