Displaying 20 results from an estimated 3000 matches similar to: "Converting a whole dataframe (including attributes) from latin1 to UTF-8"
2009 Apr 08
1
read.spss, locale and encodings
I must be missing something obvious here:
According to the help page for read.spss, the reencode option is only
active when R is run under a UTF-8 locale.
read.spss can only import the SPSS file when run under a iso88591(5)
locale, under a UTF-8 locale I get:
Error in read.spss("wo.sav") : error reading system-file header
In addition: Warning message:
In read.spss("wo.sav")
2009 Apr 29
3
how to word-wrap text in labels in plots?
c <- structure(c(2L, 2L, 1L, 3L, 4L, 2L, 3L, 2L, 3L, 2L, 5L), .Label = c("foo",
+ "bar", "a really really long variable label mostly here to show the need of word-wrapping text in labels",
+ "a not so important value", "baz"), class = "factor")
plot(c)
Is there a way to get the long variable labels to automatically wrap so that all
2008 Feb 19
3
simple usage of "for"
Hi list
I have a data frame I would like to loop over. To begin with I would
like crosstabulations using the first variabel in the data frame,
which is called "meriter".
> table(meriter[[1]], meriter[[3]])
ja nej
Annan 0
2007 Nov 01
2
ploting a comparison of two scores, including the labels in the plot
Hello r-help!
I have data with two kind of ratings on status of 100 occupations. The
first kind of rating is on the percieved "objective" status that these
occupations have in society at large, and the second kind or rating is
on the status that the respondents think that these occuption *should*
have.
The ratings were originally integer values in the rage 1-9, but in the
current data,
2009 Feb 17
1
frequency table for multiple variables
Hi r-help!
Consider the following data-frame:
var1 var2 var3
1 3 1 4
2 2 2 3
3 2 2 3
4 4 4 NA
5 4 3 5
6 2 2 3
7 3 4 3
How can I get R to convert this into the following?
Value 1 2 3 4 5
var1 0 3 2 2 0
var2 1 3 1 2 0
var3 0 0 4 1 1
TIA,
--
Hans Ekbrand (http://sociologi.cjb.net) <hans at
2010 Sep 30
7
how to make list() return a list of *named* elements
If I combine elements into a list
b <- c(22.4, 12.2, 10.9, 8.5, 9.2)
my.c <- sample.int(round(2*mean(b)), 5)
my.list <- list(b, my.c)
the names of the elements seems to get lost in the process:
> str(my.list)
List of 2
$ : num [1:5] 22.4 12.2 10.9 8.5 9.2
$ : int [1:5] 11 8 6 9 20
If I explicitly name the elements at list-creation, I get what I want:
my.list <- list(b=b,
2009 Jul 28
1
Sys.setlocale
When checking an R package of mine, I get
* checking R files for syntax errors ... WARNING
Warning in Sys.setlocale("LC_CTYPE", "en_US") :
OS reports request to set locale to "en_US" cannot be honored
'Sys.setlocale' is not used in any of my R functions. What should I do
to fix the Warning? I have never seen this before.
My locale is "sv_SE",
[PATCH 1/3] lib: Add internal function to calculate strlen for strings encoded in Latin1 or UTF-16LE
2014 Jan 08
0
[PATCH 1/3] lib: Add internal function to calculate strlen for strings encoded in Latin1 or UTF-16LE
---
lib/hivex-internal.h | 1 +
lib/utf16.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h
index 6bc8638..7f4cc3c 100644
--- a/lib/hivex-internal.h
+++ b/lib/hivex-internal.h
@@ -277,6 +277,7 @@ extern char * _hivex_recode (const char *input_encoding,
_hivex_recode ("LATIN1", _input, _len, "UTF-8",
2006 Oct 18
1
latin1,utf-8...encoding and data
Hello,
I have some questions concerning encoding and package distribution. We
develop the ade4 package. For some data sets included in the package,
there are accentued character (e.g. ?,?...). The data sets have been
saved using latin1 encoding, but some of us use utf-8 and can not see
some data sets which contains accented chracters.
e.g:
librarry(ade4)
data(rankrock)
rankrock
in this case,
2019 Jan 14
0
Setting 'unix charset' kills the samba share
On Mon, 14 Jan 2019 16:27:04 -0500
Gilbert Soucy <gsoucy at 36pix.com> wrote:
> Yes, I have tried testparam. All is OK . Note that I can write
> anything for unix charset and testparm does not complain.
>
> Load smb config files from /etc/samba/smb.conf
> rlimit_max: increasing rlimit_max (1024) to minimum Windows limit
> (16384) Processing section
2007 May 23
0
make check fails tools-Ex in 2.5.0
Hi folks,
I'm attempting to compile and install 2.5.0, and "make check" is failing
one of the earlier sanity tests. I'll append the relevant portion of the
Rout.fail file below, but I've narrowed it down manually to a single
command:
> sessionInfo()
R version 2.5.0 (2007-04-23)
x86_64-unknown-linux-gnu
locale:
2011 Jan 20
1
Generating time progressing line for Google Earth
Dear,
I am trying to visualise a time-progressing line (it's supposed to
represent spread patterns) using brew package and Google Earth.
The idea is to have a function which takes start and end point
geographic coordinates, as well as number of intervals to chop the path
up, and returns the collection of points segmenting this line.
Unfortunately my calculations fail for large distances,
2009 Oct 27
1
Locales and filenames
I have a file which contains non-ASCII characters (umlauts, accented
characters, etc.) both in its filename as well as its content. The
only way I have been able to see these characters is inside vim,
where they are displayed correctly no matter what I have LANG set
to. My default LANG is en_US.utf8, but I have tried de_DE.utf8,
de_DE.iso88591, and various others. In the output of a
2006 Dec 05
1
Horizontal stripplot
I have a plot similar to the following
library(lattice)
stripplot(1:15, rep(1:3, each=5))
In order to save space for a presentation, I would like to have
horizontal strips instead of vertical. The argument 'horiz' turns the
arguments around, but not the plot. The documentation for 'stripplot'
('xyplot'), 'panel.stripplot' and the FAQ do not seem to provide
2010 Feb 19
0
Error using update.packages
I'm updating packages by
$ sudo R --vanilla
.....
> update.packages()
when I (finally) get the error message:
Error in unloadNamespace(pkg_name) :
name space 'survival' is still used by: 'eha'
* removing '/usr/local/lib64/R/library/survival'
* restoring previous '/usr/local/lib64/R/library/survival'
---------
I have never seen this before. I guess that R
2005 Jan 19
1
looking for a basic spatial diff function
Background:
OS: Linux Mandrake 10.1
release: R 2.0.0
editor: GNU Emacs 21.3.2
front-end: ESS 5.2.3
---------------------------------
Colleagues
Is there a function to calculate distances between adjacent latitude/
longitude pairs in a matrix? It is basically a spatial diff() function that
I have in mind.
Data:
long1, lat1
long2, lat2
long3, lat3
looking for: diff(data$long, data$lat)
2010 Apr 29
2
getting random integers
I want 100 integers. Each integer, x, can be in the range 1 =< x => 10.
Does the following code give 1 and 10 the same chances to be selected as
2:8?
round(runif(100, min = 1, max = 10))
--
Hans Ekbrand
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL:
2012 Feb 25
5
which is the fastest way to make data.frame out of a three-dimensional array?
foo <- rnorm(30*34*12)
dim(foo) <- c(30, 34, 12)
I want to make a data.frame out of this three-dimensional array. Each dimension will be a variabel (column) in the data.frame.
I know how this can be done in a very slow way using for loops, like this:
x <- rep(seq(from = 1, to = 30), 34)
y <- as.vector(sapply(1:34, function(x) {rep(x, 30)}))
month <- as.vector(sapply(1:12,
2010 Jul 23
1
Midpoint between coordinates
Dear R users,
I need to find the coordinates for the point (midpoint) located half
way between two pairs of coordinates (lon1,lat1 and lon2,lat2)
assuming a straight line between them. What would be the best way? I
tried to find an answer in the help archives but without success. I
would greatly appreciate any help.
df<- data.frame(lon1=c(-4.568,-4.3980), lat1=c(59.235,56.369),
2008 Feb 26
4
rsync-3.0.0pre10 and iconv
Hello,
I am trying to get rsync-3.0.0pre10 --iconv option working between two linux hosts in local network.
The client host is running Fedora Core 4 (kernel 2.6.17) and is using iso8859-1 character set. LANG=en_US
The daemon host is running Centos 5 (kernel 2.6.18) and is using utf-8 character set. LANG=en_US.UTF-8
Rsync is transferring files properly without --iconv switch:
fc4: (connected