FAQ
Hi,

I saved the following as a UTF-8 encoded file named amberutil.r

as.factor.loop <- function(df, cols){

if (!is.null(df) && !is.null(cols) && length(cols) > 0)
{
for(col in cols)
{
df[[col]] <- as.factor(df[[col]])
}
}
df
}

And got this warning message,
source('D:/ambertuil.r')
Warning message:
In readLines(file) : incomplete final line found on 'D:/ambertuil.r'

Can you help with this?

Regards,

Xiaobo Gu

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
groupr-help @
categoriesr
postedDec 11, '11 at 3:01a
activeDec 11, '11 at 11:29a
posts5
users4
websiter-project.org
irc#r

People

Translate

site design / logo © 2022 Grokbase