Windows 7, R-2.11.1 and R-2.12.0beta When I do file.info(list.files(getwd())) I get what I expect, a dataframe with a lot of variables, especially isdir, which tells me if the named object is a file or a directory. In the result of file.info(list.files(paste(R.home(),"library",sep="/"))) all variables have only NA values, even when I start R in elevated mode.
Try with full.names = TRUE argument in list.files: file.info(list.files(paste(R.home(),"library",sep="/"), full.names = TRUE)) On Thu, Oct 7, 2010 at 9:37 AM, Erich Neuwirth <erich.neuwirth@univie.ac.at>wrote:> Windows 7, R-2.11.1 and R-2.12.0beta > > When I do > > file.info(list.files(getwd())) > > I get what I expect, a dataframe with a lot of variables, > especially isdir, which tells me if the named object > is a file or a directory. > > In the result of > > file.info(list.files(paste(R.home(),"library",sep="/"))) > > all variables have only NA values, even when I start R > in elevated mode. > > ______________________________________________ > R-help@r-project.org mailing list > 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. >-- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
On 07/10/2010 8:37 AM, Erich Neuwirth wrote:> Windows 7, R-2.11.1 and R-2.12.0beta > > When I do > > file.info(list.files(getwd())) > > I get what I expect, a dataframe with a lot of variables, > especially isdir, which tells me if the named object > is a file or a directory. > > In the result of > > file.info(list.files(paste(R.home(),"library",sep="/"))) > > all variables have only NA values, even when I start R > in elevated mode.You should look at the result of the inner expression list.files(paste(R.home(),"library",sep="/")) It doesn't include the path, so file.info doesn't know where to find them. You need "full.names=TRUE" in the list.files call. Duncan Murdoch