similar to: removing specified length of text after a period in dataframe of char's

Displaying 20 results from an estimated 800 matches similar to: "removing specified length of text after a period in dataframe of char's"

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
2008 Mar 14
1
Lme does not work without a random effect (UNCLASSIFIED)
Classification: UNCLASSIFIED Caveats: NONE Dear R users, I'm interested in finding a random effect of the Block in the data shown below, but 'lme' does not work without the random effect. I'm not sure how to group the data without continuous value which is shown in the error message at the bottom line. If I use 'aov' with Error(Block), is there a test method comparing
2011 Oct 09
2
variable name question
Hi All, This is surely an easy question but somehow I am not being able to get it. I am using R 2.13.2 and have a data set where variable names like this appear: pci1990, pci1991, ... , pci2009. "pci1990" has data on per capita income for 1990, "pci1991" has data on per capita income for 1991, and so on. I would like to create the logarithm of per capita for each of the
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
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
2007 Dec 27
4
build problems, part III, and runtime problems, part I
After decoding the unresolved symbols from wxruby2.so using c++filt, and comparing with the symbols provided by wxGTK, it became clear that wxGTK was using wchar_t whereas wxruby2.so was using char. So I rebuilt wxGTK, turning off unicode. That worked. No more unresolved symbols. What gives? Should the wxruby code have been built using wchar_t, and if so, how? However, now I get the
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) ?
2009 Jul 10
1
row data manipulation in data frame
R users, I am a beginner in R. I have a time series data on various macro variables like GDP, unemployment rate, consumer spending, imports, exports etc. I am interested in calculating year over year growth rate for each of those variables. Is there any simple function in R for carrying out such repeated operations. I would like to carry out growth rate between two consecutive yearly row data
2012 Nov 18
2
Question about making histogram and x must be numeric
Hello all, I hope someone of you can help me out, I have searched other posts as well but I can't find any solution to the problem I'm dealing with. I want to make a histogram from the data Telephone Lines MDGdataset <-read.csv("MDG_dataset_2010.csv", header=T) MDGdatasetAdapted <- subset(MDGdataset, select = c(Country_Code, Country_Name, Year,
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
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)
2012 Oct 22
0
"Vars" package: impulse response function
Hello, I'm using VAR models in R in order to obtain impulse responses of stock market shock on US economy. I have series of quarterly changes in real gdp, S&P 500 and quarterly level of unemployment for 1985 - 2012 period. My series are stationary. So I did all the steps below. However I don't understand what do irf function results mean. These are the cumulative orthogonal responses
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