Displaying 20 results from an estimated 20000 matches similar to: "character vector to text with returns"
2011 Sep 14
1
rJython matrix message
Hello,
I've posted something similar under a different subject and never received a
solution. Trying again with (hopefully) a better description.
Objective: Send a matrix of string data in an email message. The message
must have authentication and be sent via an R script.
I'm almost there!
Here is where I am at:
I collect long error message lines in 'errs', which is a matrix.
2006 Nov 13
2
Embedded carriage returns in text document
Colleagues,
I am using R 2.4.0 on both a Mac (10.4.8) and Linux (RedHat 9). To
read data from an Excel spreadsheet, I do "save as" in Excel, then
select the "Text (tab-delimited)" format. The resulting file uses a
tab separator and I can usually read the file using read.delim.
Sometimes, the header row contains embedded carriage returns. When I
view the file,
2011 May 17
5
Email out of R (code)
Hi all,
I thought I would post code to send an email out of R. The code uses
Grothendieck and Bellosta's interface package rJython for executing Python
from R. The code itself provides basic email functionality for email servers
requiring authentication. It should be easy to extend it (e.g., for sending
attachments). I hope it's useful.
require(rJython)
rJython <- rJython()
2011 Sep 27
3
remove NaN from element in a vector in a list
Hello,
What is the best way to turn a matrix into a list removing NaN's? I'm new to
R...
Start:
> mt = matrix(c(1,4,NaN,5,3,6),2,3)
> mt
[,1] [,2] [,3]
[1,] 1 NaN 3
[2,] 4 5 6
Desired result:
> lst
[[1]]
[1] 1 3
[[2]]
[1] 4 5 6
Thanks!
Ben
[[alternative HTML version deleted]]
2013 Sep 12
1
problem with rJython and modules
Dear R People:
I have been experimenting with rPython, rSymPy, and rJython. Here is my
latest snag:
> library(rJython)
Loading required package: rJava
Loading required package: rjson
> library(rSymPy)
> rJython <- rJython()
> x <- "x"
> y <- "y"
> rJython$exec("from sympy import *")
Error in .jcall("RJavaTools",
2007 Mar 08
1
reading a text file with a stray carriage return
Hi,
I'm hoping someone has a suggestion for handling a simple problem. A
client gave me a comma separated value file (call it x.csv) that has
an id and name and address for about 25,000 people (25,000 records).
I used read.table to read it, but then discovered that there are stray
carriage returns on several records. This plays havoc with read.table
since it starts a
2011 Dec 11
2
Encoding y (r)Jython.-
Hola,
Tengo un problemillo con el encoding de unas palabras y trabajarlas en R
por medio de rJython.
Os explico: cuando quiero utilizar cualquier dato que contenga acentos o
eñes o cualquiera de estos caracteres que no usan los angloparlantes
obtengo un error. Ejemplo, en R:
> jython.call(rJython,''ascii'',''señoría'')
Error en jython.exec(rJython,
2008 Jul 16
2
Postgres text field returns wrong data
I am having an interesting problem. I have a Postgres database with a
table containing a text field. In the text field is stored data that in
some cases has a ''*'' and a newline return as the first line first few
characters followed by several other lines.
The strange part is when a record is written the data looks correct,
however, when the record is read all line feed and
2012 Jun 25
1
Replacing text with a carriage return
I have a comma separated data file with no carriage returns and what
I'd like to do is
1. read the data as a block text
2. search for the string that starts each record "record_start", and
replace this with a carriage return. Replace will do, or just add a
carriage return before it. The string is the same for each record, but
it is enclosed in double quote marks in the file.
2006 Aug 19
1
need to find (and distinguish types of) carriage returns in a file that is scanned using scan
Hope this is not too trivial
I am reading a large file using scan.
In one part of this file there is a chunk of text within which i need to know the positions of line breaks. But scan seems only
An example of the file is:
"
a 0 1 0
bftt 020
cftt T 1 R
a 0 1 2 1 2
b 0 1 2 2 2
c 0 10 00
"
so precisely i need in the scanned file in R to know where each carriage return is in the file
2011 Sep 02
2
previous monday date
Hello,
I'm attempting to return the date (in form '%Y-%m-%d') of the Monday
previous to the current date. For example: since it is 2011-09-02 today, I
would expect 2011-08-29 to be the return value.
I found the following in:
http://www.mail-archive.com/r-help@r-project.org/msg144184.html
Start quote from link:
prevmonday <- function(x) 7 * floor(as.numeric(x-1+4) / 7) +
2010 Aug 04
1
Carriage return character issue
Hi all,
I imported a file (in CSV format) into R for processing, then imported the
result into MySQL. However, there are *carriage return* characters
(hexadecimal: *0D*) that are appended to the characters in the last field of
the table.
i.e *\r* appended to the character values (as shown below)
Before importing into MySQL: asdf
After importing into MySQL: asdf*\r*
**
**
Are there any options
2010 May 11
1
has_one/belongs_to -- accessing the subordinate
With a has_one/belongs_to relationship, what''s the best way to guarantee
that the belongs_to object gets created and is accessible alongside the
has_one object? I *think* the after_create callback is a good choice,
but I discovered an oddity while trying it.
F''rinstance, if every horse has a carriage:
============
ActiveRecord::Schema.define do
create_table(:horses) {|t|
2019 Sep 06
2
[PATCH 1/1] log: do not print carriage return
From: Christian Hesse <mail at eworm.de>
Logging to stderr results in line endings being terminated with carriage
return (\r) and new line (\n). While this is fine for terminals it may
have undesired effects when running from crond and logging to syslog
or similar.
I run ssh from cron on an recent linux host. Viewing logs with
journalctl I see:
Sep 06 16:50:01 linux CROND[152575]: [96B
2009 Sep 01
2
antispam-plugin 1.2 and trailing carriage-returns
Guys,
Dovecot 1.0.15 [1], just built the latest antispam-plugin 1.2 (tarball)
for testing, mailtrain backend for SA integration. Both built from
custom spec files.
The mail that is being trained is different than its respective source
in the mbox file. The trained one shows added, trailing carriage-return
chars for all headers, which are not in the headers in the mbox file.
This breaks sa-learn
2011 Oct 12
1
Tinn-R change editor background color
Hello,
Does anyone know how to change the Tinn-R editor background color? White is
rough on the eyes...
Thanks,
Ben
[[alternative HTML version deleted]]
2011 Aug 23
1
R.oo modify an object inside another classes method
Can someone show me how to modify one (R.oo) class's object inside another
(R.oo) class's method? Is that possible with the R.oo package? A quick
example or reference to an example would be outstanding...
Thanks,
Ben
[[alternative HTML version deleted]]
2011 Sep 10
1
DBS to R
Hello,
I have a bunch of data files all with "dbs" file extensions. They are
generated via a SQL query from another program and source. Does anyone know
(or have ideas) how to get the data from a dbs file type into R (or into
some other format that can imported to R)? I've searched online for 4 hours
now...
Thanks!
Ben
[[alternative HTML version deleted]]
2011 Oct 11
1
apply for each value
Hello,
There has to be a more R'ish way to do this. I have two matrices, one has
the values I want, but I want to NA some of them. The other matrix has
binary values that tell me if I want to NA the values in the other matrix. I
produce a third matrix based on this. I've also tried apply() passing in
c(1,2) for rows and columns with no success yet.
Example (this works, but I'm
2011 Oct 06
1
counts in quantiles in and from a matrix
Hello,
I'm trying to get the count of values in each row that are above and below
quantile thresholds. Thanks!
Example:
> x = matrix(1:30,5,6)
> x
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1 6 11 16 21 26
[2,] 2 7 12 17 22 27
[3,] 3 8 13 18 23 28
[4,] 4 9 14 19 24 29
[5,] 5 10 15 20 25 30
> qtl = t(apply(x, 1,