Displaying 20 results from an estimated 500 matches similar to: "Looking for example of usage of function unz"
2008 Oct 09
1
Reading zipped data directly from an FTP url
Hi
Sorry, I am clearly missing something here.
I want to read this file directly:
ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5.txt.gallus_gallus.
zip
I tried using
read.table(gzfile("ftp://ftp.sanger.ac.uk/pub/mirbase/targets/v5/arch.v5
.txt.gallus_gallus.zip"))
But I got an error:
Error in open.connection(file, "r") : cannot open the connection
In addition:
2007 Dec 19
1
unexpected behavior from gzfile and unz
I get unexpected behavior from "readLines()" and
"scan()" depending on how the file is opened with
"gzfile" or "unz". More specifically:
> file <- gzfile("file.gz")
> readLines(file,1)
[1] "a\tb\tc"
> readLines(file,1)
[1] "a\tb\tc"
> close(file)
It seems that the stream is rewound between calls to
readLines.
2024 Oct 25
1
readLines() and unz() and non-empty final line
Hi,
you could use "scan" instead, it seems to work fine also when wrapped
around "unz".
Or, alternatively, you could use "unzip" instead of "unz". It works as
expected, i.e. reads the last incomplete line and throws a warning about
this.
So it seems to me that "unz" creates a non-blocking connection, whereas
"unzip" creates a
2003 Jul 11
2
unz()
I am having problems getting the unz() function to work as a connection to
start reading a file...
z <- unz("c:/temp/stoxx.zip", "close_tmi_components.txt", "r")
readLines(z,2)
yields the following problems:
> z <- unz("c:/temp/stoxx.zip", "close_tmi_components.txt", "r")
Error in unz("c:/temp/stoxx.zip",
2024 Oct 25
1
readLines() and unz() and non-empty final line
Hi again,
The unz connection is non-blocking by default. I checked do_unz which calls
R_newunz which calls init_con and the only place in any of those functions
that sets 'blocking' is init_con which sets it to FALSE:
https://github.com/wch/r-source/blob/0c26529e807a9b1dd65f7324958c17bf72e1de1a/src/main/connections.c#L713
I'll open an issue on R-bugzilla and see if they're
2024 Oct 24
2
readLines() and unz() and non-empty final line
Dear list,
I'm seeing a strange interaction with readLines() and unz() when reading
a file without an empty final line. The final line gets dropped silently:
> cat("hello", file = "hello.txt")
> zip("hello.zip", "hello.txt")
adding: hello.txt (stored 0%)
> readLines(unz("hello.zip", "hello.txt"))
character(0)
The
2024 Oct 24
3
readLines() and unz() and non-empty final line
But note:
> zip("hello.zip", "hello.txt")
updating: hello.txt (stored 0%)
> readChar(unz("hello.zip","hello.txt"),100)
[1] "hello"
I leave it to you and other wiser heads to figure out.
Cheers,
Bert
On Thu, Oct 24, 2024 at 8:57?AM Iris Simmons <ikwsimmo at gmail.com> wrote:
> Hi Mikko,
>
>
> I tried running a few
2005 Aug 24
1
How to get the list of the files when you read zip file by gzfile or unz
Dear List,
Does somebody know how to get the filename lists in the ziped when
"gzfile" or "unz" command is used ?
Thanks for your help.
Shawn Lee
--
The information contained in this communication and any atta...{{dropped}}
2003 Jul 24
0
unz( "x.zip", "y.csv" ) != pipe( "unzip -p x.zip y.csv" )
Not sure this is a bug in R.
Maybe its a bug in my understanding of unz().
The character 'b2' (hexadecimal) is in position 535 of line 1
of 'naughty.csv'. This character appears as superscript '2' and came to me
in an EXCEL file that I converted to text in a comma separated ( *.csv )
format.
The first line gets truncated by readLines after 534 characters using
unz():
2012 Jan 31
2
how to unzip files in R
Hi,
I have downloaded a bunch of bz2 files. I wonder if R will be able to
unzip them in a batch mode or even one at a time?
I was looking at the unz function. But it didn't work well. Say I have
a bz2 file in H:/Temp/65502805_532.pair.bz2. Anyone has any
suggestion?
thanks
John
> setwd("H:\\Temp\\")
> getwd()
[1] "H:/Temp"
>
2010 Sep 20
0
unz() ignores encoding argument
Hi!
I'm trying to read individual files from a ZIP archive, using the unz() function. Some of the files contain non-ASCII characters and I'd like to avoid unpacking them in a temporary directory.
My problem is that unz() seems to ignore the encoding="latin1" option I need to read the non-ASCII characters properly. I can't find a clear indication in the documentation that
2010 Apr 27
1
Cairo package failure to load backend
Hi R friends,
I've been attempting to create plots with multiple alpha values using
Cairo to save them on a windows (32b XP) platform as it doesn't support
more than 3 alpha values. This worked well until I wanted a postscript
file (unsupported) and as a attempted work around I installed RGtk2. So
far so good, however now when I try to use a
>CairoPDF("alpha.pdf", 6, 6,
2007 Jun 06
1
opening a file from within a zipfile that is online
Hi
Reading the help for ?unz I was wondering if I can read data into R from within
an zipfile that is on some website, like maybe:
dtaa =
read.table(unz("http://www.ats.ucla.edu/stat/examples/alsm/alsm.zip","Ch01pr19.dat"))
Thanks for letting me know if you came acros such a thing before.
Toby
2011 Jul 07
2
UNZ FM TOWNS Emulator not reading discs
Hello all,
I've got Unz (FM Towns emulator) running under wine but its not capable of reading the original FM Towns CDROM images on my Mac.
I have it working under Windows XP using Daemon Tools to mount the ISO but under OSX it does not work. I have the ISO mounted under finder and have pointed my wine configuration to the mount point. No luck.
Has anyone successfully got this running under
2012 May 30
1
reading file in zip archive
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/commonNorm/twoHrs/af2hrs.zip'
z <- unz(pathToZip, 'goCats.txt', 'r')
zT
2012 Mar 02
3
subseting a data frame
HI,
this is my problem I want to subset this file df, using only unique
df$exon printing the line once even if df$exon appear several times:
unique(df$exon) will show me the unique exons
If I try to print only the unique exon lines
with df[unique(df$exon),] -this doesn't print only the unique ones :(
could you help?
thanks
Nat
exon size chr start
2009 Nov 17
1
strange read.table results
Hi I hope someone can shed some light on this:
For some reason when I
read.table("bfx.txt")
R decides to only give back the first character from each column in each row as one single column.
Like this:
V1
1 ÿþr
2 \n
3 r
4 1
5 0
6 A
7 G
8 \n
9 r
10 1
11 0
12 T
13 C
14 \n
The data should be:
2007 Nov 22
3
question about extreme value distribution
Hello,
I have a question about using extreme
value distribution in R.
I have two variables, X and Y, and have pairs
of points (X1,Y1),(X2,Y2), (X3,Y3) etc.
When I plot X against Y, it looks
like the maximum value of Y (for a particular X) is
correlated with X.
Indeed, when I bin the data by X-value into
equally sized bins, and test whether the maximum
value of Y for a bin is correlated with
2004 May 27
2
Stats package
Hi
The cor function in the stats package calculates the correlation between
columns of data, does anyone know if it is at all possible to calculate
the correlation between rows instead ?
Or is there an appropriate package or function that is more appropriate
I'd like to calculate spearman & pearson correlations between rows.
Many thanks
Jason
--
--------------------------------
2009 Apr 23
1
Accessing all the first sub-elements of a list of list
Hello,
The 179th and 180th elements of my list of lists look like this:
[[179]]
[[179]]$desc
[1] ">ipi|IPI00646510|IPI00646510.2 ISOFORM P60-HCK OF TYROSINE-PROTEIN
KINASE HCK."
[[179]]$seq
[1]
"MGGRSSCEDPGCPRDEERAPRMGCMKSKFLQVGGNTFSKTETSASPHCPVYVPDPTSTIKPGPNSHNSNTP
GIREAGSEDIIVVALYDYEAIHHEDLSFQKGDQMVVLEESGEWWKARSLATRKEGYIPSNYVARVDSLETEE