similar to: Issue with Control-Z in a text file on Windows - readLines() appears to truncate

Displaying 20 results from an estimated 2000 matches similar to: "Issue with Control-Z in a text file on Windows - readLines() appears to truncate"

2013 Apr 09
1
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
2001 Nov 01
3
Lost backslashes in parse()
I'm comparing R-1.3.0 on Solaris 2.6 to R-1.3.1 on WindowsNT. The following 5-line script returns TRUE on Unix but FALSE on NT: fnam <- tempfile() file.create(fnam) txt <- paste("file.exists(\"", fnam, "\")", sep="") expr <- parse(text=txt) eval(expr) The issue seems to be that backslashes get lost in the parsing. A workaround is to change
2013 May 03
1
untar() error
Dear List, I have a list of 600+ *.gz files that I would like to extract and read the geotiffs contained within them. I tried using the untar() function to simplify this task but I am stumped by an error. I've combed the Internet for a solution without luck. The details are below, and any help in solving this matter is appreciated. > files = list.files(path = "J:/GIMMS/NDVI",
2008 May 21
1
rawToChar(raw(0))
Hi, right now we have (on R v2.7.0 patched (2008-04-23 r45466)) that: > rawToChar(raw(0)) [1] "" > rawToChar(raw(0), multiple=TRUE) character(0) Is this intended or should both return character(0)? Personally, I would prefer that an empty input vector returns an empty output vector. Same should then apply to charToRaw(), but right now we get: > x <- character(0) >
2007 Aug 07
2
Embedded nuls in strings
Hi, ?rawToChar 'rawToChar' converts raw bytes either to a single character string or a character vector of single bytes. (Note that a single character string could contain embedded nuls.) Allowing embedded nuls in a string might be an interesting experiment but it seems to cause some troubles to most of the string manipulation functions. A string with an embedded 0:
2008 Apr 28
4
R 2.7.0, match() and strings containing \0 - bug?
Hi, A piece of my code that uses readBin() to read a certain file type is behaving strangely with R 2.7.0. This seems to be because of a failure to match() strings after using rawToChar() when the original was terminated with a "\0" character. Direct equality testing with == still works as expected. I can reproduce this as follows: > x <- "foo" > y <-
2013 May 08
1
getting corrupted data when using readBin() after seek() on a gzfile connection
Hi, I'm running into more issues when reading data from a gzfile connection. If I read the data sequentially with successive calls to readBin(), the data I get looks ok. But if I call seek() between the successive calls to readBin(), I get corrupted data. Here is a (hopefully) reproducible example. See my sessionInfo() at the end (I'm not on Windows, where, according to the man page,
2013 Jul 15
2
Serialize data.frame to database
Dear R-Users, I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database. This is what I tried to do: library(RSQLite) con <- dbDriver("SQLite") db <- dbConnect(con, "test") dbSendQuery(db, 'CREATE TABLE frames("simID" INT, "data" BLOB)') data.bin <-
2011 Apr 19
1
print.raw - but convert ASCII?
Does anyone know if there is a simple way to print raw vectors, such that ASCII characters are printed for bytes in the ASCII range, and their hex representation otherwise? rawToChar doesn't work when we have something like c(0x00, 0x00, 0x44, 0x00). -Matt
2008 Oct 28
2
writting null (\000 or ^@) to an external text file without the new warning
I have some functions that write an external text file for postprocessing by another program. Some instructions to the other program need to be indicated by null values (\000 or ^@). The function currently uses code like: writeChar(rawToChar(as.raw(0)), con) where con is a connection to the file. Previous to version 2.8.0 this worked fine. With 2.8.0 it still works, but I get a warning
2010 Dec 14
1
Installing R-packages in Windows
Hi there, I have the following problem and I hope somebody might help me. First of all: I am using WinXP SP3 (english and/or german) with R in Version 2.10.0. Now I am trying to install some packages but unfortunately I am getting a weird error. No matter which package I am trying to install - I nearly get the same error. It looks like this:
2006 Oct 05
1
mixed models: correlation between fixed and random effects??
Hello, I built 4 mixed models using different data sets and standardized variables as predictors. In all the models each of the fixed effects has an associated random effect (same predictor). What I find is that fixed effects with larger (absolute) standardized parameter estimates have also a higher estimate of the related random effect. In other words, the higher the average of the absolute
2006 Nov 03
2
Rank transformation and the linear mixed model
Hello, I am looking for references about mixed models built on rank transformed data. Did anybody ever consider this topic? Thank you, Bruno ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bruno L. Giordano, Ph.D. CIRMMT Schulich School of Music, McGill University 555 Sherbrooke Street West Montr?al, QC H3A 1E3 Canada http://www.music.mcgill.ca/~bruno/
2008 Sep 25
1
Saving R-objects to a database
Someone solved the problem of saving R-objects to a database? These are the two varaints I've tried so far without success: 1) ser = rawToChar(serialize(obj, NULL, ascii=TRUE)) dbSendQuery(link, paste("insert into table values(1, '",ser,"')",sep='')) The field to save the object in the MySQL Database is of type text. unser = dbGetQuery(link,"select
2006 Sep 05
1
serialize changes for 2.4.0
I noticed today that in R 2.3.1, I get > serialize(list(1,2,3), NULL, ascii = TRUE) [1] "A\n2\n131841\n131840\n19\n3\n14\n1\n1\n14\n1\n2\n14\n1\n3\n" > but in R 2.4.0 alpha I get > serialize(list(1,2,3), NULL, ascii = TRUE) [1] 41 0a 32 0a 31 33 32 30 39 36 0a 31 33 31 38 34 30 0a 31 39 0a 33 0a 31 34 [26] 0a 31 0a 31 0a 31 34 0a 31 0a 32 0a 31 34 0a 31 0a 33 0a >
2011 Oct 21
2
Change column/row-name
Hi, I am very happy. My problems are solved without one little thing: (Iske <- matrix(c(1, 1, 1, 2, 2, 2, 1, 1, 1, 5, 1, 2, 2, 2, 1, 1, 1, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 2), ncol = 5)) #My Matrix Iske<- Iske+33 #I want see the letters (Iske.char<-apply(Iske, 1, function(x) rawToChar(as.raw(x)))) #Numbers to
2006 Aug 10
1
logistic discrimination: which chance performance??
Hello, I am using logistic discriminant analysis to check whether a known classification Yobs can be predicted by few continuous variables X. What I do is to predict class probabilities with multinom() in nnet(), obtaining a predicted classification Ypred and then compute the percentage P(obs) of objects classified the same in Yobs and Ypred. My problem now is to figure out whether P(obs) is
2012 Sep 19
2
Rcmd check problem
Hi, all. I was trying to build my R package with R 2.15.1 32bit and win7. I basically follow the routine in Steven Mosher's blog http://stevemosher.wordpress.com/step-10-build/ After I fixed the path, and built the skeleton of the package, I started command prompt and used the following commands in building my package Rcmd check myPackageName Rcmd build myPackageName Rcmd check
2004 Jun 22
1
Need for advise for Correspondence Analysis
Dear R users, I m quite a novice in using R for factor analysis and I would need some help to choose the right function. I have a contingency table and I would like to perform a Correspondence analysis on this table, followed by a hirarchical clustering of my variables projected in on the first principal components. Here are my question : - what is the more appropriate function to do so ...
2010 Nov 02
4
Debian/squeeze: domU live migraton hangs
Hi, In view of the problems I was having with DomU network timeout after a live migration (I posted that problems here a while ago but never got anything except from private emails) I finally updated my Debian/Squeeze Dom0s last night to a new kernel, from 2.6.32-23 to 2.6.32-26. Now live migration just hangs...Any ideas? Xen-related Debian packages (all from Debian repositary, except drbd