Questions tagged as 'r'

1
answer

Graphic title bar in ggplot2

I made this chart with geom_bar() , I would like the title (a) to follow the direction of ylab , but I can not. I used this parameter of the function geom_bar() theme(plot.title = element_text(hjust = 0, size = 13)...
asked by 19.09.2018 / 23:38
1
answer

Questions about ggplot in bars

Hello, I am trying to plot a graph in bars geom_bar , where X corresponds to the days of the month, in this case February, and y refers to the value of two variables v1 e v2 referring to the day in position = "dodge" . I studi...
asked by 02.03.2018 / 18:54
1
answer

Applying Loop to Elements of a Matrix (R)

Be the matrix below created from the command simu_matrix <- matrix(runif(25,0,1),nrow=5,ncol=5) V1 V2 V3 V4 V5 1 0.07357303 0.45524021 0.9352829 0.60466424 0.4725541 2 0.51018615 0.46044203...
asked by 01.07.2014 / 16:01
1
answer

How to insert point and line legend in ggplot?

How do I insert the points into the caption? The purple dot on the caption "base1" and the red dot on the caption "base2"? lines = 'Mes Lg1 total1 Lg2 total2 Jan base1 1450 base2 89 Fev base1 1700 base2 86...
asked by 02.07.2018 / 00:05
1
answer

How to join two data.frames in R with different variables and out of order?

I have two data.frames: frame1 <- data.frame(dia=c("02/01/2017","03/01/2017","04/01/2017","05/01/2017"), y=c(2,2,1,2),w=c(4,4,2,2),z=c(25,16,24,30), k=c("sim","nao","sim","nao")) frame2 <- data.frame(dia=c("05/01/2017","04/01/2017","03/0...
asked by 30.12.2017 / 03:32
2
answers

How to transpose rows to columns in a data frame?

I have a time series with daily precipitation data between 1961 and 2017, as shown below. I need to bundle this data by month over the years. I was able to transpose the month column of the data frame and fill it with the values in the "prec" co...
asked by 01.04.2018 / 21:20
1
answer

Access a data frame object, within a function in R - Census 2010

I would like to upload the Census 2010 files. First, I am loading the domains through a function, using the read_fwf command, of the readr package. However, the data frames created are within the scope of my role and I would like t...
asked by 19.09.2017 / 15:04
1
answer

Multiple Linear Regression in R in different groups

I have a data set with 4 columns: Product - Price Site 1 - Competitor Site - Sold Quantities Where Product is a specific product (Refrigerator 1, refrigerator 2, etc.); Price Site 1 is the price charged by my site; Competitor Site P...
asked by 17.08.2017 / 02:47
2
answers

How to convert Hour: minutes: seconds to decimal number in R

I am trying to convert a column in the data.frame that is in the format of hour: minutes: second to decimal number Example: 2:20 PM to 2.33 How can I do this in R?     
asked by 18.08.2017 / 11:18
1
answer

Date frame manipulation

Hello, I'm trying to manipulate a database with 300+ observations, but each observation has a different number of columns. The problem is that from a certain point, the columns start repeating themselves, but they have different values and I...
asked by 28.03.2018 / 21:08