Re: [R] Reading File Sizes: very slow!

2021-09-27 Thread Rui Barradas
Hello, R 4.1.0 on Ubuntu 20.04, sessionInfo at the end. I'm arriving a bit late to this thread but here are the timings I'm getting on an 10+ years old PC. 1. I am not getting anything even close to 5 or 10 mins running times. 2. Like Bill said, there seems to be a caching effect, the first r

Re: [R] Reading File Sizes: very slow!

2021-09-26 Thread Leonard Mada via R-help
On 9/27/2021 1:06 AM, Leonard Mada wrote: > > Dear Bill, > > > Does list.files() always sort the results? > > It seems so. The option: full.names = FALSE does not have any effect: > the results seem always sorted. > > > Maybe it is better to process the files in an unsorted order: as > stored o

Re: [R] Reading File Sizes: very slow!

2021-09-26 Thread Leonard Mada via R-help
Dear Bill, Does list.files() always sort the results? It seems so. The option: full.names = FALSE does not have any effect: the results seem always sorted. Maybe it is better to process the files in an unsorted order: as stored on the disk? Sincerely, Leonard On 9/25/2021 8:13 PM, Bill

Re: [R] Reading File Sizes: very slow!

2021-09-26 Thread Jiefei Wang
What kind of disk do you use? The hardware differences might be important to this issue. Best, Jiefei Leonard Mada via R-help 于 2021年9月26日周日 下午9:04写道: > Dear Bill, > > > - using the Ms Windows Properties: ~ 15 s; > > [Windows new start, 1st operation, bulk size] > > - using R / file.info() (2nd

Re: [R] Reading File Sizes: very slow!

2021-09-26 Thread Leonard Mada via R-help
Dear Bill, - using the Ms Windows Properties: ~ 15 s; [Windows new start, 1st operation, bulk size] - using R / file.info() (2nd operation): still 523.6 s [and R seems mostly unresponsive during this time] Unfortunately, I do not know how to clear any cache. [The cache may play a role only

Re: [R] Reading File Sizes: very slow!

2021-09-25 Thread Richard O'Keefe
On a $150 second-hand laptop with 0.9GB of library, and a single-user installation of R so only one place to look LIBRARY=$HOME/R/x86_64-pc-linux-gnu-library/4.0 cd $LIBRARY echo "kbytes package" du -sk * | sort -k1n took 150 msec to report the disc space needed for every package. That' On Sun,

Re: [R] Reading File Sizes: very slow!

2021-09-25 Thread Bill Dunlap
On my Windows 10 laptop I see evidence of the operating system caching information about recently accessed files. This makes it hard to say how the speed might be improved. Is there a way to clear this cache? > system.time(L1 <- size.f.pkg(R.home("library"))) user system elapsed 0.482

[R] Reading File Sizes: very slow!

2021-09-25 Thread Leonard Mada via R-help
Dear List Members, I tried to compute the file sizes of each installed package and the process is terribly slow. It took ~ 10 minutes for 512 packages / 1.6 GB total size of files. 1.) Package Sizes system.time({         x = size.pkg(file=NULL); }) # elapsed time: 509 s !!! # 512 Packages

Re: [R] reading file labels into R

2017-01-27 Thread PIKAL Petr
Hi Did you try ?list.files Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of WRAY > NICHOLAS > Sent: Friday, January 27, 2017 1:07 PM > To: r-help ; r-help-request project.org> > Subject: [R] reading file labels i

[R] reading file labels into R

2017-01-27 Thread WRAY NICHOLAS
Hello R-ren I have a list of csv files in a folder which are labelled essentially in this way (actual data has scores of files) F010116, F020116, F030116 G020116, G030116, G040116, G 050116 H020116, H030116 where F G and H are engines I've got data from and the numbers are the dates. I can ma

Re: [R] reading file in zip archive

2012-05-31 Thread David Winsemius
mode. See if open="rb" is any more successful. -- David. Best Iain From: Phil Spector To: Iain Gallagher Cc: r-help Sent: Thursday, 31 May 2012, 0:06 Subject: Re: [R] reading file in zip archive Iain - Do you see the same behaviour if yo

Re: [R] reading file in zip archive

2012-05-31 Thread Iain Gallagher
May 2012, 0:06 Subject: Re: [R] reading file in zip archive Iain -   Do you see the same behaviour if you use z <- unz(pathToZip, 'x.txt') instead of z <- unz(pathToZip, 'x.txt','r')                     - Phil Spector                     Statistical Co

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
ep='\t') Error in read.table(z, header = FALSE, sep = "\t") :   seek not enabled for this connection As I said in my previous email readLines fails as well. Rather strange really. Anyway, as before any advice would be appreciated. Best Iain _

Re: [R] reading file in zip archive

2012-05-30 Thread Peter Langfelder
On Wed, May 30, 2012 at 12:47 PM, Iain Gallagher wrote: > Hi Phil > > Thanks, but this still doesn't work. > > > Here's a reproducible example (was wrapping my head around these functions > before). > > x <- as.data.frame(cbind(rep('a',5), rep('b',5))) > y <- as.data.frame(cbind(rep('c',5), rep('

Re: [R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
'x.txt', 'r') zT <- read.table(z, header=FALSE, sep='\t') Error in read.table(z, header = FALSE, sep = "\t") :   seek not enabled for this connection As I said in my previous email readLines fails as well. Rather strange really. Anyway, as before an

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
Iain - Once you specify the file to unzip in the call to unz, there's no need to repeat the filename in read.table. Try: z <- unz(pathToZip, 'goCats.txt', 'r') zT <- read.table(z, header=TRUE, sep='\t') (Although I can't reproduce the exact error which you saw.)

[R] reading file in zip archive

2012-05-30 Thread Iain Gallagher
Hi List I have a series of zip archives each containing several files. One of these files is called goCats.txt and I would like to read it into R from the archive. It's a simple tab delimited text file. pathToZip <- '/home/iain/Documents/Work/Results/bovineMacRNAData/deAnalysis/afInfection/comm

Re: [R] Reading file

2011-04-27 Thread Jeff Newmiller
I don't know the answer to your question, but I avoid these problems by saving my data as csv and avoiding direct interaction with Excel files. Excel is NOT a database, even though it has supposed support through ODBC. I find this holds true regardless of the programming environment from which I

[R] Reading file

2011-04-27 Thread Val
Hi all, I am trying to read Excel file usingthe follwoing commnad library(RODBC) data=odbcConnectExcel(file.choose()) sqlTables(data) Bdat=sqlFetch(data, "test") odbcClose(data) head(Bdat) 1. The above script works if the Excel file is opened. If the excel file is not

[R] Reading file names containing Metacharacters

2011-01-31 Thread Jeisson F
I am trying to read some file names from an specific directory and such names contains metacharacters. The file names is like V4.35_T01-400720.csv In total I have 14 files for which the value T01 goes up to T14. I need to read the files into a string vector that looks like >names"V4.35_T01-4007

Re: [R] Reading file

2010-06-01 Thread David Winsemius
On Jun 1, 2010, at 3:19 PM, Robert Tsutakawa wrote: I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source(" file name"). I need some examples or detailed instructions

Re: [R] Reading file

2010-06-01 Thread Stephan Kolassa
Have you set the correct working directory? ?setwd ?getwd HTH Stephan Robert Tsutakawa schrieb: I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source(" file name"). I n

[R] Reading file

2010-06-01 Thread Robert Tsutakawa
I am trying to read a source program into a mac pro laptop, which uses Snow Leopard. R is unable to find the file containing my source program. I'm using the function source(" file name"). I need some examples or detailed instructions. I have no problem reading the file using PC. Bob

Re: [R] Reading file from remote location or network drive.

2009-01-02 Thread Prof Brian Ripley
This is an FAQ (both in the main FAQ and the rw-FAQ) http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-file-names-work-in-Windows_003f http://cran.r-project.org/bin/windows/base/rw-FAQ.html#R-can_0027t-find-my-file You may find it easier to map your network drives: most users do. See also ?Qu

Re: [R] Reading file from remote location or network drive.

2009-01-02 Thread ONKELINX, Thierry
m a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Namens Harsh Verzonden: vrijdag 2 januari 2009 8:46 Aan: r-help@r-project.org Onderwerp: [R] Reading file from remote location or network drive. Hello,

[R] Reading file from remote location or network drive.

2009-01-01 Thread Harsh
Hello, I'm trying to pull data from a network drive on a windows machine. The location is read into a string and then used later with a data input command. > rem<- "\\192.192.192.3\Shared\iris1.csv" Warning messages: 1: '\S' is an unrecognized escape in a character string 2: '\i' is an unrecogni