Let's say I have the following text vector ( character ):
d <- data.frame(id=1:3,
txt=c('Um gato e um cachorro',
'Cachorros jogam bola usando alpargatas',
'gatinhos cospem...
I need to do several aggregate.
For example:
2012ocup10 <- aggregate(PNAD2012[c("peso_pes")], by=PNAD2012["klems"],
FUN=sum,na.rm=T)
But I need to do the same procedure for PNAD2011,PNAD2010, ...
I use...
I'm using R to generate charts of a table, with two fields (company name and sales quantity), when using barplot, it is not putting the right values in the fields.
For example, if sales were 500,000 it will make the chart the highest value 50...
I have a time series of daily flow data. I am trying to decompose the ST to remove the trends and seasonalities. But when I use the decompose function the seasonal chart appears a black blur.
QHE.ts <- ts(QUHE.z, freq = 365.25)...
I'm trying to import Excel data (already in .csv format) into R; the values contained in the files to be imported are in the following formats, for example 8509,80 ...
To do the import, I am using the command:
variavel=read.table("dados.csv...
When executing loops with apply functions, function(x) is always used. Example:
lapply(df,function(x)gsub('[^A-Z]','',x))
In other functions, however, function(x,y) is used. Example:
Reduce(function(x,y)merge(x,y,all=TRUE,b...
These are my dataframes:
df<- as.data.frame(matrix(rexp(200),, 25))
colnames(df)<-c("A","B","C","D","E","F","G","H","I","J",
"K","L","M","N","O","P","Q","R","S","T",
"U","V","X","Z","W")
df.new<-as.data.frame(matr...