Displaying 20 results from an estimated 1000 matches similar to: "geom_bar with missing data in package ggplot"
2011 Dec 07
1
removing specified length of text after a period in dataframe of char's
Dear all,
I'm trying to remove some text after the period (a decimal point) in
the data frame 'hi', below. This is one step in formatting a table. So
I would like e.g.
"2.0" to become "2"
and "5.3" to be "5.3",
where the variable digordered contains the number of digits after the
decimal that I would like to display, in the same order in which
2004 Apr 14
3
A bug report?
Folks,
I have a strange situation, which I may have isolated as a bug
report. Or, it could just be that there's something about R that I
don't know. :-) I have attached the data file and the program file but
don't know whether these attachments will make it into the list. Here
is my bugreport.R program --
---------------------------------------------------------------------------
2001 Sep 24
3
x axis point labels
I am attempting to manually specify x axis value labels (NOT x axis label as
in xlab) on a density plot. Generally speaking, I would like to erase the
default x axis point labels and replace them with arbitrary x axis point
labels relating to specific CDF points.
I am sure this can be done, but it isn't obvious to me how. Has anyone done
this before?
My R code follows if it helps (new
2009 Jan 24
2
ggplot2 - how to change location / position of wind rose axis labels?
Dear R users,
First just want to say thank you to all for developing such a wonderful
software and packages.
I need to produce a wind rose plot. Tried with packages circular and plotrix
and couldn't quite get what I want. Moved to package ggplot2 and it's going
great. However stuck in how to move axis labels.
I am using the wind rose from the help to learn how to do what I need (code
2011 Jan 19
1
Problem in using bdh function for Govt tickers
Hi, all
I wanted to fetch data from Bloomberg for govt bonds, and analyse it
further.
I am having trouble in getting data as when I use field=PX_LAST, it is
giving the prices but when I use field=CPN, or ISSUE_DT, it is not giving
the results and just bouncing back <NA> for that.
This is the piece of code:
> library(rJava)
Warning message:
package 'rJava' was built
2008 Jan 30
2
numeric coercion when one or more elements is non numerice
I don't understand this behavior. Why does the every data point get trashed by data.matrix when there is one non-numeric element in the array? Thanks.
> temp
GDP CPIYOY
19540 2098.1 garbage
19632 2085.4 0.9
19724 2052.5 0.8
19814 2042.4 1.1
> data.matrix(temp)
GDP CPIYOY
19540 4 4
19632 3 2
19724 2 1
19814 1
2012 Apr 30
5
Different varable lengths
Hi!
I'm trying to do a lm() test on three objects. My problem is that R protests
and says that the variable lengths differ for one of the objects
(Sweden.GDP.gap). But I have double checked that the number of observations
are the same. All three objects should contain 9 observations but R only
accepts 9 observations in two of the objects. The third must have 10! Very
confusing because there
2003 Oct 04
2
(no subject)
Dear all,
I have the following question. I have to fit the hierarchical model for the
hypothesis concern the individual-level effects by controlling for the
individual -level attributes and national-level contextual effects on
individuals by using R.
O have to obtain the estimates of the impact of the second-level (national:
GDP per capita) effects on individuals ( in this instance the impact
2001 May 06
1
legend/text in time series plot
hi,
i need help on placing legend/text in a time series plot. here is what
i am doing (i am using rw1022 on windoze 2000):
#read data file
gdpn <- scan("jngdpsa.dat", list(year=0, qtr=0, gdp=0));
gdpr <- scan("jrgdpsa.dat", list(year=0, qtr=0, gdp=0));
#convert to time series object
gdpn <- ts(gdpn$gdp, frequency=4, start=c(1955,2));
gdpr <- ts(gdpr$gdp,
2002 Jun 14
1
data.frame - transform
Hi there,
I have a data.frame (pwt6) which I would like to transform:
country year gdp
MEX 1950 2
MEX 1951 5
BOL 1950 4
BOL 1951 12
ITA 1950 45
ITA 1951 2
This should be the result:
year MEX.gdp BOL.gdp ITA.gdp
1950 2 4 45
1951 5 12 2
Right now I have this code (better - no code):
country.label<-names(table(pwt6$country))
result<-data.frame(year=NULL)
for(i in country.label)
?
2011 Aug 04
1
Running a column loop through the Moran.I function.
Dear R users,
I have two data frames that consist of statistical information for most
countries around the world. One dataframe consists of the latitude and
longitude ("coord.csv") of each country, while the other consists of 100's
of different attributes ("countryattri.csv") for each country (like, GDP,
Population, etc.). The data is organized with a header and then
2006 Jan 30
3
Date Not Staying in Date Format
I have a column in a data frame that has a class of "Date" and a mode of
"numeric". When I:
max(df$Date)
My output stays in Date format, i.e. "2006-01-03".
However, when I run the following statment:
tapply(df$Date, df$SomeFactor, max)
my output looks like this: 9129 9493 9861 10226 10591 10956 11320
11687 12052 12417
The returned object is of
2001 Dec 05
1
Code for Hodrick-Prescott Filter
Has anyone written any code for the Hodrick-Prescott filter? I have a some
uncompiled FORTRAN code from Ed Prescott but I'd like to save myself some
programming time if possible. Thanks for your help.
Nick Davis
Crown Financial Policy
Asset and Liability Management Branch
The New Zealand Treasury
Direct: +64-4-471-5924
Fax: +64-4-499-0143
Email:
2011 Jun 26
2
Accessing variables in a data frame
Hello
My data.frame (dat) contains many variables named var.names and others
named var.names_var.id
For example
var.name <- c("gdp","inf","unp")
var.id <- c("w","i")
x <- paste(var.name, rep(var.id, each=length(var.name)), sep="_")
How can I access variables in the dama.frame by names listed in x, for
example to compute
2008 Nov 22
1
declaring constants in an Sweave / LaTeX document
List,
I would like to set a variable to hold, say, the size of my plots in a
Sweave document. i.e. something like the following in my '.Rnw' file:
==============================================================================
smallPlotSize = 4
<<fig1, echo=false, results=hide, height=smallPlotSize, width=smallPlotSize,
fig=true>>=
dat <- read.table("
2013 May 04
2
Lasso Regression error
Hi all,
I have a data set containing variables LOSS, GDP, HPI and UE.
(I have attached it in case it is required).
Having renamed the variables as l,g,h and u, I wish to run a Lasso
Regression with l as the dependent variable and all the other 3 as the
independent variables.
data=read.table("data.txt", header=T)
l=data$LOSS
h=data$HPI
u=data$UE
g=data$GDP
matrix=data.frame(l,g,h,u)
2003 Sep 17
2
CART analysis
Greetings,
Does anyone know of an R code for classification and regression tree
analysis (CART)?
Thank you
Ron
Ron Thornton BVSc, PhD, MACVSc (pathology, epidemiology)
Programme Co-ordinator, Active Surveillance
Animal Biosecurity
MAF Biosecurity Authority
P O Box 2526
Wellington, New Zealand
phone: 64-4-4744156
027 223 7582
fax: 64-4-474-4133
e-mail: ron.thornton at maf.govt.nz
2017 Apr 10
1
Author email addresses
I have 3 packages on CRAN that I developed with my govt email address.
I'll be retiring in a month and that email address will no longer work at
some point. I realize that I need to change the maintainer address and
I've already done that with one package but my question is do I need to
remove all references to my govt email address listed as author in various
files and replace with my
2011 Sep 21
1
Strucchange gbreakpoints
Hi,
I am a new user to R.
I am using strucchange to generate breakpoints:
--------------------------------------------------------------------------------------
> res <- gbreakpoints(GDP.new ~ 1,data=a,h=2,breaks=5)
> print(res)
Optimal 6-segment partition for `lm' fit:
Call:
gbreakpoints(formula = GDP.new ~ 1, data = a, h = 2, breaks = 5)
Breakpoints at observation number:
2012 Jan 31
1
R help, labeling the tick marks as I want
R help,
I would like to change the labels of my tick marks on the x-axis, and I am
having difficulty understanding how. Basically, my current axis labels
are: 0, 50, 100, 150, 200, and I would like: 1962Q1, 1974Q2, 186Q4, 1999Q2,
2011Q4.
With all respect to generality, could you please simply tell me the code to
achieve this in the context of this problem? I learn programming by
example and