similar to: numeric coercion when one or more elements is non numerice

Displaying 20 results from an estimated 400 matches similar to: "numeric coercion when one or more elements is non numerice"

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
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
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 -- ---------------------------------------------------------------------------
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
2005 Oct 31
2
What is the history of CONFIG_EXT{2,3}_CHECK?
Can anyone tell me the history of CONFIG_EXT{2,3}_CHECK? There is code for a "check" option for mount if these options are enabled, but there's no way to enable them. TIA Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said.
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
2011 Nov 16
1
geom_bar with missing data in package ggplot
Dear all, I was hoping someone could help with a ggplot question. I would like to generate a faceted bar chart, but missing data are causing problems. g<-structure(list(Date = structure(c(11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052, 11322, 11687, 12052), class = "Date"), variable = c("Govt Revenues to GDP", "Govt Revenues to GDP",
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 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
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
2001 Sep 10
5
?? hmm ??
Hello again! thanks to all who helped with overlay plots - v. easy in the end. Anyway, another new(ba)bee type question - the gurus will cringe I'm sure! Q. simple R function mm <- function (u) { x <- u$GDP x m <- mean(x) m } When the function is called the vector "x" does not get printed from within the function, but the mean value "m" does, why? I
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)
2011 May 28
1
How to do operations on zoo/xts objects with Monthly and Daily periodicities
Is there an elegant way to do operations (+/-/*/ / ) on zoo/xts objects when one serie is monthly (end of month) and the other daily (weekdays only) - typically a monthly economic indicator and a stock index price? Thanks, TDB -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-operations-on-zoo-xts-objects-with-Monthly-and-Daily-periodicities-tp3558081p3558081.html
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("
2011 Mar 21
2
rqss help in Quantreg
Dear All, I'm trying to construct confidence interval for an additive quantile regression model. In the quantreg package, vignettes section: Additive Models for Conditional Quantiles http://cran.r-project.org/web/packages/quantreg/index.html It describes how to construct the intervals, it gives the covariance matrix for the full set of parameters, \theta is given by the sandwich formula
2007 Jul 20
1
GEE code
I'm writing a paper aimed at motivating the use of GEE within the field of economics. However, after computing using the geeglm function, I noticed there's one intercept in the summary output. I assume this means the function is pooling the data. That means my code is not what I want. I want a "fixed effects" model, meaning I want the intercept to vary by cluster. Here's
2013 Jun 19
3
how to get growth rate of a (time series) data?
Hello all, now I'm trying to switch from Excel to R to deal with the data, and as a newbie i got the problem as follows. suppose I have a data named "test" test<- data.frame(year=c(1996:2011), Y=c(74163.6,81658.5,86531.6,91125.0,98749.0,109028.0,120475.6,136613.4,160956.6,187423.5,222712.5,266599.2,315974.6,348775.1,402816.5,465731.3)) in which Y means the GDP of a country If i
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