Sean O'Riordain
2013-Apr-09 08:33 UTC
[Rd] Fwd: R unzip method gives filenames as character
Question: would it be better if the contents list of the unzip() function returned the filenames as character rather than factor since they are probably unique strings?> tmp <- unzip(fnam, list=TRUE) > str(tmp)'data.frame': 31 obs. of 3 variables: $ Name : Factor w/ 31 levels "fred1.csv",..: 1 2 3 4 5 6 7 8 9 10 ... $ Length: num 424486 2664277 219798 442383 480857 ... $ Date : POSIXct, format: "2012-12-01 04:05:00" "2012-12-02 04:06:00" "2012-12-03 04:45:00" "2012-12-04 03:52:00" ... thanks, Sean [[alternative HTML version deleted]]
Prof Brian Ripley
2013-Apr-10 09:41 UTC
[Rd] Fwd: R unzip method gives filenames as character
On 09/04/2013 09:33, Sean O'Riordain wrote:> Question: would it be better if the contents list of the unzip() function > returned the filenames as character rather than factor since they are > probably unique strings?That is what the help page says it does, so this is bug -- now corrected in R-patched (for one of the methods, only).> >> tmp <- unzip(fnam, list=TRUE) >> str(tmp) > 'data.frame': 31 obs. of 3 variables: > $ Name : Factor w/ 31 levels "fred1.csv",..: 1 2 3 4 5 6 7 8 9 10 ... > $ Length: num 424486 2664277 219798 442383 480857 ... > $ Date : POSIXct, format: "2012-12-01 04:05:00" "2012-12-02 04:06:00" > "2012-12-03 04:45:00" "2012-12-04 03:52:00" ... > > thanks, > Sean-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595