Questions tagged as 'r'

1
answer

Excel DISTF Equivalent in R

I would like to know if there is a function similar to Excel function, DISTF in the R software? The Excel DISTF function returns the F (right-tail) probability distribution (diversity level) for two sets of data. You can use this function to...
asked by 16.02.2018 / 21:15
2
answers

Changing variable value

Good evening colleagues: I have a numeric variable:    cv1 [1:10] [1] 0 0 108919 4152 317 334403 0 35092   12762 NA I want to create the variable cv2, replacing the absolute values of zero (0) with "NA". Using the "gsub" function it re...
asked by 10.03.2018 / 23:38
1
answer

The R Strata function was not found (Ubuntu)

Good afternoon, I am studying R in Ubuntu (16.04 LTS). When trying to use the strata function through the command below: amostra = strata(infert, c("education"), size = c(5, 48, 47), method = "srswor") The error below occurs: Error in st...
asked by 19.11.2017 / 17:32
3
answers

Find an exponent of the equation that fits the data, R

I would like to know how to adjust this equation / model below to my observed data (which are simple) so as to find the exponent p of that model y~x^(-p) My data is: y=c(1.1178329,1.0871448,1.0897010,1.0759255,1.0535190,0.8725332)...
asked by 22.08.2017 / 00:51
1
answer

Alternative to Miktex

Hello. I am making a document in RMD in Rstudio and would like to export it to word or pdf. I saw that for this I need to install Miktex. However, even following all the steps (the most summarized tutorial is here , which synthesizes what I've...
asked by 13.07.2018 / 16:54
2
answers

How to add a [closed]

train <- read.csv("train.csv") train$color <- as.numeric(as.factor(train$color)) train.scale <- scale(train[,2:5]) train.scale$color <- train$color ERROR:    In train.scale $ color
asked by 20.09.2017 / 16:10
1
answer

Problem installing graphics with ggplot2 R

I'm trying to put a graph in R to display the maximum and minimum values of some variables in addition to a line to mark 0 of y, however the points in the chart go completely out of order. I'm using the following table: cultivar <- c("IB...
asked by 27.08.2016 / 20:17
1
answer

problems with the agricolae package

I'm having trouble using the agricolae package. When I put the require (agricolae) command, the following error appears: require(agricolae) Carregando pacotes exigidos: agricolae Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths(...
asked by 01.03.2017 / 18:39
1
answer

Calculate mean, standard deviation and coefficient of variation in historical series in R

Good morning, I need to generate the average, standard deviation, and coefficient of variation of the data frame below, from columns mat13 to mat16, as follows: library(plyr) co_entidade<-c(23, 40, 58, 82, 104, 171, 198, 201, 202,244)...
asked by 23.05.2017 / 16:10
2
answers

Repetition structure of a function

Hello! I'm having trouble finding my error in the program below. I want to generate random values from a level vector, however I want my function to return an array of generated values. My program is returning an array, but the values of the col...
asked by 08.09.2015 / 17:44