Questions tagged as 'r'

1
answer

Comparison of two matrices with different sizes

I have two arrays with these dimensions and would like to remove the common lines between the two arrays and form another array without these elements. How could R do this? a = matrix(1:30, ncol = 5, byrow = T) b = matrix(6:15, ncol = 5, byro...
asked by 31.05.2015 / 21:40
1
answer

How to build an executable / installer from a routine written in R?

I have several routines written in R, simple tools that I would like to share with my colleagues. However, some of them have no programming knowledge. So I want to make it easier to use these tools. For this I thought about creating an execut...
asked by 09.11.2015 / 19:43
1
answer

How to read a table missing elements or misconfigured?

Suppose a table in the form of text like the following: texto <- "a b c e f g h i" When I use the read.table command, it gives the following error: tabela <- read.table(text=texto) Error in scan(file, what, nmax, sep, dec, quote, sk...
asked by 26.02.2014 / 17:31
1
answer

How can I get the current date and time in #R?

I am creating a process report from a routine, a simplified "logfile", and would like to store the date at the time of the error in a variable. What function does the current date and time result in #R?     
asked by 08.03.2016 / 09:55
2
answers

How can I get the maximum and minimum values after applying LOESS

My data is brought from a database and I simply apply: ggplot (data = df_postgres, aes (x = date_time, y = duracao)) + geom_point() + stat_smooth(method = "loess") And I get the following smoothing: Is it possible to get the maxim...
asked by 15.09.2015 / 15:17
1
answer

Build Data Frame with "get"

This is my data.frame: data<-read.csv2("NewEXEMPL.csv",header=TRUE,sep=";") head(data,5) DATE P.A i.A S.A w.A b.A P.B i.B S.B w.B b.B P.C i.C S.C w.C b.C 1 jun/79 16.86 59.67768...
asked by 09.05.2016 / 00:17
1
answer

In R, using the plotly package, can I plot the map of Brazil and its states?

I really like the plotly package for making interactive graphics. But at the time of making maps, I have not yet found a way to map Brazil and its states ... For example, I removed this code from the site itself library(plotly) df <-read.cs...
asked by 19.07.2016 / 19:54
1
answer

Automatically identify points of influence in a regression

Whenever we do a linear regression, we need to check whether the assumed assumptions for the model are correct. One of the best ways to do this is through diagnostic charts. See the example below: ajuste <- lm(Petal.Width ~ Petal.Length, da...
asked by 27.10.2017 / 14:27
1
answer

Rename a file with a value of a vector

I'm using a loop to extract hundreds of data using unzip. However, I want to rename the files with the same name as the extracted file. I am making the following code: zip_postos <- setwd("ZIP_Postos") zip_postos <- list.files(zip_postos...
asked by 19.04.2015 / 11:01
1
answer

Bar chart sorted using dplyr and ggplot2

I'd like to create a bar chart after counting the number of occurrences of categories in a dataset. Suppose my dataset is this below: dados <- structure(list(categorias = structure(c(5L, 4L, 5L, 3L, 1L, 2L, 5L, 3L, 1L, 1L, 4L, 4L, 1L, 5L,...
asked by 28.06.2017 / 18:46