Questions tagged as 'r'

3
answers

How to construct time series with frequencies different from the original?

I have a dataframe with daily precipitation data, with dates from 01/01/1900 until 12/31/2010, example: # Data Est_1 Est_2 Est_3 # 17/12/2010 NA 0 0 # 18/12/2010 NA 0...
asked by 15.09.2015 / 02:08
1
answer

Less Value of a Column Set

I have a dataset and would like to select only the smallest value between each primary key. Here is the example of my DF: ORDEM <- c(1,5,2,3,1,10) GUIA <- c('111','111','333','333','555','555') COR <- c('AZUL','AMARELO','PRETO','LARAN...
asked by 27.11.2018 / 15:27
2
answers

calculate a probability function in R

Good afternoon. It's my first time in the stack, I'm a beginner in R , and my doubts are pretty basic. I need to generate a sample of 1000 observations of a W distribution function. W is a discrete random variable, whic...
asked by 26.10.2018 / 19:10
3
answers

How to divide the elements of an array by the average of your column

I need to split the elements of an array by its column mean, how can I do this, is there any function to perform this simple operation? Considering the array: > A <- matrix(1:16, ncol = 4) > A [,1] [,2] [,3] [,4] [1,]...
asked by 11.02.2016 / 18:58
1
answer

Arrange the bars of a bar chart in the R

I am plotting the following data in R to generate a bar graph: structure(c(5483L, 28034L, 7995L, 5199L, 6785L, 7452L, 7692L), .Dim = 7L, .Dimnames = structure(list(c("dom", "qua", "qui", "sáb", "seg", "sex", "ter")), .Names = ""), class = "tab...
asked by 06.11.2017 / 22:05
2
answers

Scatter plots fixing a response variable

Suppose I have an interest in the iris dataset, already present in R memory: head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9...
asked by 01.06.2017 / 14:21
2
answers

Chart of columns stacked in the R

I have a database where variables assume integers from 1 to 5. Here is an example base with the variables X1 , X2 and X3 : base<- rbind( c(5,3,3),c(4,3,2),c(4,5,4),c(1,5,1),c(1,2,1),c(3,4,2), c(2,3,2),c(3,1,3),c(3,2,4)...
asked by 23.03.2017 / 23:55
2
answers

How to insert caption in graph with two axes and in r?

How do I insert the legend in this chart, what kind of bar would be the gross total and the line the total net? lines = 'Mes Acid Obt Jan 1450 102 Fev 1447 86 Mar 1461 87 Abr 1356 61 Mai 1398 80 Jun 1115 87 Jul 1211 82 A...
asked by 19.06.2018 / 17:54
2
answers

How to call the previous month in R?

I need R to tell me the month before we are, that is, we are in "2018-05" and I need him to give me "2018-04". So far my solution was: format(Sys.Date()-as.integer(format(Sys.Date(), "%d")),"%Y-%m") I believe there should be a more "clean"...
asked by 11.06.2018 / 21:23
2
answers

I can not install IBGEPesq on R to read the PNADs

I just downloaded PNGE 2013 from IBGE - and I tried to open it with the package for R that IBGE made, IBGEPesq. It is available as a .zip file at this address: ftp://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domi...
asked by 22.09.2014 / 12:26