<div>Edson,</div><br><div>Segue uma possível solução. Deixo a conferência dos resultados com você.</div><br><div>Tive que fazer algumas correções na tabela devido a forma como os dados estão armazenados. Evite utilizar pontuação nas palavras (ex<span data-emoji-typing="true">:</span> Discordância, prefira Discordancia ) e acredito que o nome das colunas podem ser melhor escolhido para facilitar o entendimento.</div><br><div>Segue um dput da planilha editada que utilizei.</div><br><div>dados <-structure(list(id = 1:30, entrevistado = structure(c(NA, NA, </div><div>22L, 20L, 18L, 7L, 10L, 21L, 28L, 6L, 19L, 3L, 9L, 15L, 26L, </div><div>13L, 4L, 5L, 16L, 1L, 24L, 27L, 17L, 25L, 11L, 8L, 2L, 12L, 23L, </div><div>14L), .Label = c("agenorsantos01@gmail.com", "andreavieira.am@gmail.com", </div><div>"anymargareth@gmail.com", "aruana@acritica.com", "byjuniorbrasil@gmail.com", </div><div>"cardoso.orlando@gmail.com", "carlos.bonatelli@redeamazonica.com.br", </div><div>"cassiadiaslima.ap@gmail.com", "contato@correiodenoticia.com.br", </div><div>"czarwanderley@gmail.com", "daniwalen@gmail.com", "dantegraca@gmail.com", </div><div>"elissanpaula@gmail.com", "faber.teixeira@yahoo.com", "geisy.negreiros@redeamazonica.com.br", </div><div>"gilvancostarr@gmail.com", "hc.cintia@gmail.com", "hiellevy@gmail.com", </div><div>"irineia.barbosa@redeamazonica.com.br ", "luciano.falbo@acritica.com", </div><div>"machristina.imprensa@gmail.com", "marioadolfoemtempo@gmail.com", </div><div>"rascunhoserascunhos@yahoo.com.br", "ricardoamaral.roraima@gmail.com", </div><div>"rodineyjornalista76@gmail.com", "sergiobartholo@hotmail.com", </div><div>"shirleyfolha@hotmail.com", "thiago.cabral@redeamazonica.com.br"</div><div>), class = "factor"), v_ist_presr = structure(c(1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Indiferente"), class = "factor"), v_ist_gov_fed = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Discordancia"), class = "factor"), v_ist_gov_est = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Discordancia"), class = "factor"), v_ist_gov_mun = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 2L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Discordancia", "Indiferente"), class = "factor"), v_prev_temvida = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Indiferente"), class = "factor"), v_soc_con_ac = structure(c(1L, </div><div>2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, </div><div>2L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L), .Label = c("Concordancia", </div><div>"Discordancia"), class = "factor"), v_ores_div_mcom = structure(c(1L, </div><div>2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, </div><div>2L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L), .Label = c("Concordancia", </div><div>"Discordancia"), class = "factor"), v_mveic_diss = structure(c(2L, </div><div>1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>2L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L), .Label = c("Concordancia", </div><div>"Discordancia", "Indiferente"), class = "factor"), o_ap_auto_impc = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Indiferente"), class = "factor"), o_ap_continuadas = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Indiferente"), class = "factor"), o_ind_fund_meiocom = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Indiferente"), class = "factor"), c_com_prtrab = structure(c(2L, </div><div>1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 3L, 1L, 1L, 2L, 1L, 3L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L), .Label = c("Concordancia", </div><div>"Discordancia", "Indiferente"), class = "factor"), c_con_atr_site = structure(c(3L, </div><div>1L, 1L, 1L, 2L, 2L, 1L, 1L, 3L, 2L, 3L, 1L, 1L, 1L, 1L, 3L, 1L, </div><div>1L, 2L, 1L, 3L, 1L, 3L, 1L, 1L, 1L, 2L, 2L, 1L, 2L), .Label = c("Concordancia", </div><div>"Discordancia", "Indiferente"), class = "factor"), c_be_inf_ist = structure(c(3L, </div><div>1L, 1L, 1L, 3L, 1L, 3L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 3L, </div><div>1L, 1L, 1L, 3L, 1L, 1L, 3L, 1L, 2L, 1L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>"Discordancia", "Indiferente"), class = "factor"), c_mat_edicao = structure(c(3L, </div><div>1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 2L), .Label = c("Concordancia", </div><div>"Discordancia", "Indiferente"), class = "factor"), c_camp_div_meiocomun = structure(c(1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Concordancia", class = "factor"), </div><div>    c_gt_imp_enfr = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, </div><div>    1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Concordancia", class = "factor"), </div><div>    c_acomp_div = structure(c(2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, </div><div>    1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, </div><div>    1L, 1L, 1L, 1L, 1L, 2L, 2L), .Label = c("Concordancia", "Discordancia", </div><div>    "Indiferente"), class = "factor"), c_inf_rep_gov_fed = structure(c(3L, </div><div>    1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 3L, 1L, 2L, 1L, 1L, 2L, </div><div>    1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 3L, 1L, 2L, 1L, 1L, 1L), .Label = c("Concordancia", </div><div>    "Discordancia", "Indiferente"), class = "factor"), c_inf_rep_gov_est = structure(c(3L, </div><div>    3L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 3L, 1L, 2L, 1L, 1L, 1L, </div><div>    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 2L, 1L, 2L, 1L), .Label = c("Concordancia", </div><div>    "Discordancia", "Indiferente"), class = "factor"), c_inf_rep_gov_mun = structure(c(3L, </div><div>    2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 3L, 1L, 2L, 1L, 1L, 2L, </div><div>    1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 2L, 2L), .Label = c("Concordancia", </div><div>    "Discordancia", "Indiferente"), class = "factor")), class = "data.frame", row.names = c(NA, </div><div>-30L))</div><br><div>head(dados)</div><div>#install.packages(tidyr)</div><div>library(tidyr)</div><div>#Organiza a tabela em formato longo</div><div>corrigido <- dados%>% gather('v_ist_presr','v_ist_gov_fed','v_ist_gov_est','v_ist_gov_mun','v_prev_temvida','v_soc_con_ac','v_ores_div_mcom','v_mveic_diss','o_ap_auto_impc','o_ap_continuadas','o_ind_fund_meiocom','c_com_prtrab','c_con_atr_site','c_be_inf_ist','c_mat_edicao','c_camp_div_meiocomun','c_gt_imp_enfr','c_acomp_div','c_inf_rep_gov_fed','c_inf_rep_gov_est','c_inf_rep_gov_mun',key= "Perguntas",value="Respostas")</div><div>#Transforma o tipo dos dados para fator</div><div>corrigido <-transform(corrigido,entrevistado=factor(entrevistado),Perguntas=factor(Perguntas),Respostas=factor(Respostas))</div><div>#install.packages("dplyr")</div><div>library(dplyr)</div><div>#Tabela final agrupada por Perguntas e Resposta</div><div>tabela_final <- as.data.frame(corrigido%>%group_by(Perguntas,Respostas)%>% summarize(n=n()))</div><div>tabela_final</div><br><div class="gmail_quote_attribution">On Sep 27 2018, at 11:37 am, Edson Lira <edinhoestat@yahoo.com.br> wrote:</div><blockquote><br><div><div><div><div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Fernando Souza, abaixo o link de um banco para vc avaliar. </font></font></div><div><br></div><div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><a href="https://www.datafilehost.com/d/e570a703" title="https://www.datafilehost.com/d/e570a703">https://www.datafilehost.com/d/e570a703</a></font></font></div></div><div><br></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">[  ]'s</font></font></div><div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Prof. Edson Lira, Me</font></font></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Estatístico</font></font></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Manaus-Amazonas</font></font></div></div></div><div><br></div><div><br></div></div><div><div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">Em quarta-feira, 26 de setembro de 2018 16:54:42 AMT, Fernando Souza <nandodesouza@gmail.com> escreveu:</font></font></span></font></font></div><div><br></div><div><br></div><div><div><div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">Mande um CMR porque montar uma tabela baseada em sua descrição ou criar soluções de cabeça é isso. Bom mínimo de um dput dos dados ou parte representativa deles, copie e cole aqui</font></font></span></font></font></div><br><div><div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">Em qua, 26 de set de 2018 12:52, Edson Lira via R-br <</font></font></span></font></font><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><a href="mailto:r-br@listas.c3sl.ufpr.br" title="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a></font></font></span></font></font><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">> escreveu:</font></font></span></font></font></div></div><blockquote><div><div><div><div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Bom dia a todos!  Tenho um banco aonde da coluna 19 a coluna 29 tenho respostas do tipo: Concordância, Indiferente e Discordância, com um banco de  29 linhas.</font></font></font></font></span></div><div><br></div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">O meu objetivo é somar por linha (por cada indivíduo, a quantidade e o percentual de Concordância), ou seja acrescentar mais duas colunas por indivíduo. </font></font></font></font></span></div><div><br></div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Abaixo as respostas de um indivíduo (uma linha).</font></font></font></font></span></div><div><br></div><div><br></div><div><div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"> Concordância Concordância Concordância Concordância Concordância Concordância  Concordância Discordância Concordância   Concordância     Concordância Discordância  Indiferente </font></font></font></font></span></div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Indiferente Indiferente       Concordância Concordância Discordância     Indiferente     Indiferente     Indiferente</font></font></font></font></span></div><div><br></div></div><div><br></div><br></div><div><br></div><br></div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">[  ]'s</font></font></font></font></span></div><div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Prof. Edson Lira, Me</font></font></font></font></span></div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Estatístico</font></font></font></font></span></div><div><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif">Manaus-Amazonas</font></font></font></font></span></div></div></div></div></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">_______________________________________________</font></font></span></font></font></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">R-br mailing list</font></font></span></font></font></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><a href="mailto:R-br@listas.c3sl.ufpr.br" title="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a></font></font></span></font></font></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" title="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a></font></font></span></font></font></div><div><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">Leia o guia de postagem (</font></font></span></font></font><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif"><a href="http://www.leg.ufpr.br/r-br-guia" title="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a></font></font></span></font></font><font style="font-size:16px"><font style="font-family:"times new roman", "new york", times, serif"><span style="color:rgb(38, 40, 42)"><font style="font-size:13px"><font style="font-family:"Helvetica Neue", Helvetica, Arial, sans-serif">) e forneça código mínimo reproduzível.</font></font></span></font></font></div></blockquote></div></div></div></div></div></div></div></div></blockquote>