[R-br] Problemas com criação de listas

Paulo Henrique Pimenta paulopimenta6 em hotmail.com
Sexta Outubro 23 19:19:25 BRST 2015


Olá FHRB,
A solução  lista <- doBy::splitBy(formula = ~ V2, data = arq_1) parece interessante, no entanto o computador que eu uso não possui para mim acesso para realizar atualizações, assim o pacote doBy não pode ser usado, ele não esta disponível para a versão 2.14.1 do R
Abraços.

Paulo Henrique de A. S. Pimenta.
Graduando em Meteorologia (Bacharelado) - IAG/USP.
Fone: +5511981318435.

From: paulopimenta6 em hotmail.com
To: r-br em listas.c3sl.ufpr.br
Subject: Problemas com criação de listas
Date: Fri, 23 Oct 2015 18:31:56 +0000







Olá Listeiros,
Estou com um problema na criação de novas listas no R. Abaixo segue parte do meu código:

arq_1 <- read.table("C:/Users/Paulo/Documents/Alturas_Ilha_Fiscal-2015-10-22/Alturas_Ilha_Fiscal/50140002560102196123121961ALT_MOD.xls")

######################################################################################################## Fazendo a mao mes a mes ####################

jan <- arq_1[which(arq_1$V2==1),]
fev <- arq_1[which(arq_1$V2==2),]
mar <- arq_1[which(arq_1$V2==3),]
abril <- arq_1[which(arq_1$V2==4),]
maio <- arq_1[which(arq_1$V2==5),]
junho <- arq_1[which(arq_1$V2==6),]
julho <- arq_1[which(arq_1$V2==7),]
agosto <- arq_1[which(arq_1$V2==8),]
setembro <- arq_1[which(arq_1$V2==9),]
outubro <- arq_1[which(arq_1$V2==10),]
novembro <- arq_1[which(arq_1$V2==11),]
dezembro <- arq_1[which(arq_1$V2==12),]
################automatizando#####################
for (i in 1:12){
mes[i] <- arq_1[which(arq_1$V2==i),]
             
               }

Eu gostaria de poder automatizar o primeiro processo, a captação de um bloco da lista arq_1 para a variável mes[i], porém eu recebo a mensagem:

There were 12 warnings (use warnings() to see them)
e ao abrir os warnings:

Warning messages:
1: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
2: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
3: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
4: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
5: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
6: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
7: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
8: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
9: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
10: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
11: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length
12: In mes[i] <- arq_1[which(arq_1$V2 == i), ] :
  number of items to replace is not a multiple of replacement length

Fazendo pelo processo manual dá certo, mas pq fazendo pelo processo “automatizado" não é possível. Peço ajuda de vocês para encontrar uma saída!

Um grande abraço a todos

Paulo.



Sent from Windows Mail
 		 	   		  
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20151024/4e098d88/attachment.html>


Mais detalhes sobre a lista de discussão R-br