[R] How do I best create a R procedure from a R file?

Luca Meyer lucam1968 at gmail.com
Wed Feb 8 10:27:54 CET 2017


Hi,

I am working on the following file:

> str(elencositi)
'data.frame':    641 obs. of  2 variables:
 $ indirizzo.sito: chr  "10ahora.com.ar" "abceconomia.co" "accmag.com" "
actu.orange.fr" ...
 $ nome.sito     : chr  "10ahora" "ABC economia" "Acc Magazine" "Orange
Actu" ...

> head(elencositi)
          indirizzo.sito    nome.sito
1         10ahora.com.ar      10ahora
2         abceconomia.co ABC economia
3             accmag.com Acc Magazine
4         actu.orange.fr  Orange Actu
5   affaires.lapresse.ca    La Presse
6 agipapress.blogspot.it   Agigapress

Which is regularly updated and I consequently need to update a procedure
that takes elencositi data to update dati$FONTE as indicated below:

dati$FONTE <- ifelse(dati$FONTE=='10ahora.com.ar','10ahora',dati$FONTE)
dati$FONTE <- ifelse(dati$FONTE=='abceconomia.co','ABC economia',dati$FONTE)
dati$FONTE <- ifelse(dati$FONTE=='accmag.com','Acc Magazine',dati$FONTE)

Currently I am using a time consuming procedure involving Excel to update
that, but how can I make that automatic?

Thank you in advance,

Luca

	[[alternative HTML version deleted]]



More information about the R-help mailing list