Questions tagged as 'r'

1
answer

Number of items to replace is not a multiple of substitute length

I'm trying to create a method for the minkowsky formula but it's giving this error. It happens on the line where I try to assign the value to matriz_distancia[i,j] . distancia_minkowsky <- function(xtreinamento, xteste, r){ matriz_d...
asked by 08.06.2017 / 01:25
1
answer

Multi-line chart

I have a data frame with weight gain information as a function of the time of several animals. I need to plot a chart with connected rows. Although I need one line for each animal on a single chart, all rows can be the same color. Here's the...
asked by 28.11.2017 / 11:37
1
answer

select data according to dates

Hello! How do I select the rows of a data.frame according to some dates? ex: select data from coluna 2 to dates 2016/12/15, 2016/12/25, 2017/01/08, 2018/01/01.     
asked by 19.02.2018 / 20:43
1
answer

Area and Line Graph in R with x-axis as String

I would like to make an area chart and insert another superimposed line chart. I am not able to accomplish this, because the graph of x that I want to put are strings and everything is wrong. The figure should look like the chart below that I di...
asked by 07.02.2017 / 17:59
1
answer

With joining multiple txt files into one [duplicate]

I have 60 txt files all with the same number of columns. The files do not have header (name of the columns). How can I put all of them together in a file just below one another in R.     
asked by 22.08.2017 / 13:07
1
answer

Select the highest value from a set of columns of a df and get the column name of this higher value in R

Personal I have a table in the R where I wanted to look for the highest value in a set of columns and given this greater value, return in a new column the name of the column in which this greater value was. For example, given the df below I w...
asked by 02.10.2017 / 16:37
3
answers

Organize data in excel

I have a file with 59 comments and 93 variables in Excel file and I have converted it to .csv. to create the table in R, however my 93 variables appear in the same column. How do I make them appear separate?     
asked by 06.08.2016 / 22:28
1
answer

Get the module of a negative number in R

Is there a function in R to get the module of a negative number or a vector of numbers? example: v <- c(1,-2,3,-4) module(v) #> [1] 1 2 3 4     
asked by 03.06.2016 / 14:54
1
answer

Determine size of circles in the legend of a GGPLOT2 chart

Hello I inserted these commands there in the R: library(ggplot2) lm_smooth <- geom_smooth(method = lm, size = 1) qplot(percwhite, percbelowpoverty, data = midwest, weight = popdensity, size = popdensity) + lm_smooth And R returned thi...
asked by 12.08.2018 / 07:44
2
answers

How can I find out which packages / libraries belong to the functions of a routine written in R?

I have stopped using many routines because programmers do not tell which packages / libraries the functions that are in these routines use. I know that many of these functions are authored by the programmer and are not found in any repository, b...
asked by 25.11.2015 / 18:11