Comment imprimer un certain nombre de lignes à partir d'une lecture.table en R Studio

da=read.table("m-ibm6708.txt",header=T)  #<== Load data with header

#<== Check dimension of the data (row = sample size, col = variables)
###############502 rows, col 1 = date, col 2 = ibm, col 3 = sprtn
#<== Print out the first 6 rows of the data object "da".
printrows <- da[1:6]
printrows    

L'impression des lignes n'a pas fonctionné. J'ai essayé un tas de choses. Je pense qu'il pourrait utiliser cbind. da est une grande table, mais je n'ai besoin que les 6 premières lignes affichées.

  • Vous pouvez utiliser le head fonction: head(da, 6)
  • Merci les gars pour l'aider!
InformationsquelleAutor user3553260 | 2014-09-04