Questions tagged as 'r'

1
answer

How to change rows of tables in R by values of the same row only of another column [closed]

[,1] [,2] [1,] "NAO INFORMADO" "1" [2,] "2" "3" [3,] "NAO INFORMADO" "5" [4,] "4" "1" [5,] "NAO INFORMADO" "3" [6,] "6" "5" I wanted to change all values not reported by the values in colum...
asked by 09.02.2016 / 02:56
1
answer

Convert labels to numeric labels

I have labels stored as letters and want to convert to numeric, for example: a <- c("A", "B", "A", "A", "C", "E", "D", "A", "B") Desired output [1] 1 2 1 1 3 5 4 1 2     
asked by 14.11.2016 / 16:14
2
answers

Text in bar graph stacked in R

I want to create a stacked bar chart similar to the one below Iusedthefollowingcommandbarplot(t(dadosAQI),xlab="%", col=colAQI, horiz = TRUE, cex.axis = 0.8, cex.names = 0.8, las=1 ) But I...
asked by 15.09.2015 / 16:51
1
answer

Probabilities with pnorm function R

Statistics and Probability is not my area. There was a doubt, I think I'm doing it right but the result is strange. This is my series: y=structure(c(-0.276926746036887, 5.1002303288006, -4.45902094037891, -3.65240790618631, -0.554369416754141...
asked by 24.10.2016 / 22:34
1
answer

Select a part of the database in R

I am doing an evaluation of the portal database of transparency that can be obtained in this link , the problem is that I would like to select only a part of the database, my evaluation is only about the data of teachers. I could do a data clea...
asked by 28.10.2016 / 20:49
2
answers

How to do sequence in R?

I need to do this sequence in a repeat structure to use with a bigger N, but I can not do it, does anyone have any idea how to do this? n=8 names <- c (seq(1 , n), seq(2,n+1 ), seq (3,n+2), seq(4 ,n+3), seq(5,n+5 ),seq(6,n+5),seq(7, n+6 ),...
asked by 13.04.2015 / 00:09
1
answer

Pass data CSV file to array in R (BARPLOT)

I need to plot a chart in R by importing a csv file. After doing the csv import and calling the barplot it accuses the variable that I imported the csv is not a vector. So how do I transform into a vector to use in the barplot? I would like to u...
asked by 28.06.2016 / 21:43
1
answer

How to replace a series of blanks by just one in a string in R?

How do I replace a series of blanks with just one, in R? For example, suppose we have a string: x <- " non non non non" I want to make the content of x be "non non non non".     
asked by 08.01.2015 / 18:46
1
answer

In R, how to define a function with undefined arguments of the same nature

Hi, I'm defining one function from another. However, I want to define my new function with several arguments of the same nature. For example My basic function is well-defined funcaobase(data, argumento1) But my new function I want you to...
asked by 02.03.2015 / 20:39
1
answer

How to create a function in R

I want to create a function to control students' grades. I'm trying the following function: note_eng<-read.csv2("note.csv",header=TRUE) note_eng$Média<-(note_eng[,1]+note_eng[,2]+note_eng[,3])/3 for(i in 1:length(note_eng$Média)){...
asked by 21.03.2015 / 22:26