Posts by Guilherme Parreira • 2,060 points
68 posts
-
1
votes1
answer117
viewsA: Ordering Feeling Table(Tidytext)
Add the code PedraFilosofal$Capitulo <- factor(PedraFilosofal$Capitulo, levels = cap) right after creating your tibble
-
1
votes1
answer91
viewsA: How to upload to Google Drive from R
Hello! Just do the following: library(googledrive) write.csv(mtcars, file = "dados.cars.csv") # Arquivo de exemplo para fazer o upload googledrive::drive_upload(media =…
-
1
votes2
answers1147
viewsA: Color scale adjustment on R
First, I created a database that resembles your: # Criando conjunto de dados df <- data.frame(Var1 = 9, Var2 = 5, Var3 = 7, Var4 = 4, Var6 = 9, Var7 = 8) long <- reshape2::melt(df) long…
-
2
votes1
answer58
viewsA: Bootstrapped confidence interval for GLMM model parameters
I circled that way: (gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), data = cbpp, family = binomial)) b_par <- bootMer(x = gm1, FUN = fixef, nsim = 50)…
-
3
votes1
answer111
viewsA: Double factor in r with letters for differentiation
I recommend using the package emmeans vignette Interaction analysis in emmeans: library(emmeans) l1 <- emmeans(aovalt, "cul", "trat") # Cria o objeto emmeans no caso de interação CLD(l1,…
-
2
votes1
answer75
viewsA: Error in generation of bookdown
The error suggests for you to delete the file _main.Rmd and put delete_merged_file = TRUE. If you can’t write the file _main.Rmd, use a different book_filenamein the _bookdown.yml…
-
1
votes1
answer43
viewsA: GLMM - Prediction with ID
For you to make the predictions without using the random effect, that is, without particularizing for your "ID", do: predict(mm2, n11, type="response", re.form = NA) or predict(mm2, n11,…
-
2
votes1
answer136
viewsA: Which object identifier should I use?
class evaluates what is the class of the object. Objects in R have different functions that can be assigned to them depending on the class. You can use this function together with methods() to…
ranswered Guilherme Parreira 2,060 -
2
votes2
answers1053
viewsA: read.table, data.frame
A file .dat is general and can be structured in text/data form. What happens in your case is that the options default of read.table do not read the file correctly. Follow what you can do: 1º) Use…
ranswered Guilherme Parreira 2,060 -
2
votes1
answer75
viewsA: R - Graphs with information from different columns
First you will need to tidy up your data set so that you have only 2 columns: base2 <- read.csv2("base2.csv") # Base de dados do seu exemplo nova.base <- data.frame(Escolaridade =…
-
3
votes1
answer85
viewsA: Graphic with same color lines for factors
You need to specify each Animal in the group, and specify color in the geom_line: a <- read.csv2("dados.csv") library(ggplot2) ggplot(data = a, aes(x = Dia, y = Consumo, group = Animal)) +…
-
2
votes1
answer857
viewsA: "Error: caption Outside float" in R Markdown
You need to use a \caption{} within a table environment (\being{table} ... \end{table} or figures \begin{figure} ... \end{figure}. Otherwise, you will have trouble compiling.…
-
3
votes1
answer245
viewsA: How to separate text answers in R?
Use the function multi.split package questionr. To view the result, use multi.table. v <- c("red,blue","green","red,green","blue,red") multi.split(v, split.char = ",") ## Tabela de frequências…
ranswered Guilherme Parreira 2,060 -
2
votes1
answer227
viewsA: How to classify a "labelled" variable and assign new labels?
It may not be the best code, but do the task: niveis <- data.frame(Antigo = letters[1:10]) a <- data.frame(Niveis = niveis, Novo = paste0(rep("NV", 10), rep(1:5,each = 2))) merge(niveis, a, by…
ranswered Guilherme Parreira 2,060 -
2
votes1
answer62
viewsA: Presenting tabulated linear regression result
You will need to work a little to your matrix, especially to put "Variables" because it does not even belong to the row.names nor the col.names, which are the arguments used by the most common…
ranswered Guilherme Parreira 2,060 -
3
votes1
answer311
viewsA: Corrplot package
For this, I use the package PerformanceAnalytics. Behold: PerformanceAnalytics::chart.Correlation(iris[, -5]) Via corrplot it is not possible/would have to do a lot of programming. In that question,…
ranswered Guilherme Parreira 2,060 -
2
votes1
answer170
viewsA: How to pass my data set from wide format to long cm multiple variables in R
Hello, to do this task it is necessary to combine primarily the functions to melt and the dcast package reshape2 along with the function sub. require(reshape2) longo <- melt(df,…
databaseanswered Guilherme Parreira 2,060 -
9
votes7
answers9711
viewsA: Remove accents
Use this function: fa <- function(x) iconv(x, to = "ASCII//TRANSLIT") fa(c("pelé","época")) [1] "pele" "epoca"
ranswered Guilherme Parreira 2,060