Questions tagged as 'r'

1
answer

color gradient R

How do I change the color of the graph in a gradient way with the variable years, starting from white to intense red. colourCount = length(unique(tabela.estacao$ano)) getPalette = colorRampPalette(brewer.pal(9,"Reds")) ggplot(tabela.estacao,...
asked by 13.10.2016 / 15:00
1
answer

Calculating Integral using R

I need to calculate this simple integral below: Thisisthestandardnormalizedquantilfunction,whereweknowfromthefrontthat,q_0.5(z)=0,forexample.Thatis,foreachtheta(percentile)itgivesmeanumberinstandardizednormaldensity.Thetagoesfrom0to1.Igenera...
asked by 26.10.2016 / 18:22
2
answers

Color scale adjustment in R

Good afternoon, I created a bar chart using a gauge to fill in the colors of the bars, where the nearest to red is bad, and the closer to green is good. It turns out that he adjusted according to the data, so the number 29 turned green when i...
asked by 16.11.2018 / 20:31
1
answer

Sum of the regression square of the R models

The presented models are different in only one additional coefficient (f), which multiplies the independent variable (x), allowing the calculation of the increase of the sum of the square of the regression, including the coefficient f with a val...
asked by 26.02.2018 / 14:33
1
answer

Max of a numeric field returning NA

I'm starting to learn R and I came across a situation I do not understand. I downloaded ENEM 2014 data (CSV file) and read it using: dados_enem <- read.csv(file="MICRODADOS_ENEM_2014.csv", header = TRUE, sep = ",") When I ask you to calc...
asked by 25.02.2016 / 14:56
2
answers

Attempting to generate a graph of a time series

That's what I did .. #Lê a base de dados ano1<-read.csv("os dados abaixo...",header = TRUE ,sep=";", row.names=1) #Cria a série temporal ano<-ts(ano1[,1],start=c(2009,1), end=c(2010,12),freq=12) #plota a série plot(ano,ylab='indice', x...
asked by 07.06.2016 / 20:38
2
answers

Convert column from date frame of characters to numeric

When trying to convert the text values of the columns of a data.frame , created using Stringasfactor = FALSE , numeric, I got an abnormal result by coercion: > str(ccredito$Restaurantes) chr [1:20] "49,74" "15,98" "59,4" "14" "...
asked by 12.05.2016 / 21:30
1
answer

Error as.POSIXlt.character when importing MDB in R

Hello, I looked for this answer all over the internet and I did not find:) I am importing an MDB (Ms Access db) into R Studio (Windows 7 R v32b) using RODBC but when I give the sqlFetch command I am having an error importing a date column that...
asked by 18.05.2016 / 00:36
1
answer

Select first lines depending on group efficiently

Suppose I have the following database set.seed(100) base <- expand.grid(grupo = c("a", "b", "c", "d"), score = runif(100)) And I want to select the lines with the lowest score depending on the group according to the table below:...
asked by 28.01.2015 / 13:50
1
answer

Operation with three-dimensional arrays

Reframing the question, I would like to implement the following equation: WhereDisanarrayoforderixkxl,lambdaisamatrixkxjandpk={1,2,3,4,5,6}.ForthisIneedsomefunctionthatoperateswiththree-dimensionalarrayinsteadofnestedloops.Belowthepostaddedby...
asked by 26.05.2015 / 02:37