[R] Script/function/procedure with loop

Luca Meyer lucam1968 at gmail.com
Mon Jul 11 22:24:35 CEST 2016


Can anyone point me to an R script/function/procedure which, starting from
the following sample data

#sample data
#NB: nrow(df) is variable

date =
c("07-jul-16","07-jul-16","07-jul-16","08-jul-16","08-jul-16","08-jul-16","09-jul-16","09-jul-16")
varA = c("text A1","text A2","text A3","text A4","text A5","text A6","text
A7","text A8")
varB = c("link B1","link B2","link B3","link B4","link B5","link B6","link
B7","link B8")
df = data.frame(date, varA, varB)

allows me to obtain a text output such as:

> 07-jul-16

text A1
link B1

text A2
link B2

text A3
link B3

> 08-jul-16

text A4
link B4

text A5
link B5

text A6
link B6

> 09-jul-16

text A7
link B7

text A8
link B8

etc...

Thanks,

Luca

	[[alternative HTML version deleted]]



More information about the R-help mailing list