[R] Strange message after reading multiple scripts from one folder
Fox, John
jfox at mcmaster.ca
Fri Jul 29 14:44:20 CEST 2016
Dear Frank,
What you see isn't a "message" but the result returned by sapply(). The ?s indicate that sapply() didn't know what to do with the corresponding element. In an individual use of source(), the result, a 2-element list, is returned invisibly, so you don't see it.
To see what's going on, try
res <- lapply(pathnames, FUN = source)
str(res)
I hope this helps,
John
-----------------------------
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
Web: socserv.mcmaster.ca/jfox
> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Frank S.
> Sent: July 29, 2016 6:52 AM
> To: r-help at r-project.org
> Subject: [R] Strange message after reading multiple scripts from one folder
>
> Dear list,
>
> I have one folder named "scripts_JMbayes", wich contains 10 R scripts.
> I can read them properly by doing:
>
> > pathnames <- list.files(pattern="[.]R", path="Mydir/scripts_JMbayes",
> > full.names = TRUE) sapply(pathnames, USE.NAMES = FALSE, FUN = source,)
>
> However, R generates the following message:
>
> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
> value ? ? ? ? ? ? ? ? ? ?
> visible FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
>
> What does it mean and what should I change to avoid this message?
> Any help would be appreciated!
>
> Best,
>
> Frank
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list