MacQueen, Don | 1 Feb 01:46 2011

list.files() error message: 'translateCharUTF8' must be called on a CHARSXP

I'm using list.files() on my home directory, like this:

   crnt.files <- list.files(dir.to.check, full.names=TRUE, all.files=TRUE,
recursive=TRUE)

With dir.to.check set to the full path to my home directory.

After a while I get:

Error in list.files(dir.to.check, full.names = TRUE, all.files = TRUE,  :
  'translateCharUTF8' must be called on a CHARSXP

This happens on one of my two machines, not the other.
Presumably there is a "file" somewhere in my home directory that, well,
isn't a file?
Or maybe has some strange character in its file name? That maybe isn't
valid in my LOCALE?

I would appreciate some advice on how to find this "file" so I can get rid
of it, or rename it, or something.

Also, does this message possibly represent a problem that the R developers
should pay attention to? I'm not sure.

Thanks
-Don

> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
(Continue reading)

刘力平 | 1 Feb 01:06 2011
Picon

Re: Unable to require installed package

Hi,

I uploaded my package to http://win-builder.r-project.org/ and had it built.

It can work on one machine, but on the other, it reports:

Loading required package: grt
Error: package 'grt' was built for i386-pc-mingw32
In addition: Warning message:
package 'grt' was built under R version 2.12.1
Execution halted

Is it because the package is built for win32? But in the manual it says R
for win32 works good on win64.

Note that the package has some C++ code.

best,
Liping Liu

On Thu, Jan 27, 2011 at 1:21 AM, Prof Brian Ripley <ripley <at> stats.ox.ac.uk>wrote:

> On Thu, 27 Jan 2011, Barry Rowlingson wrote:
>
>  On Thu, Jan 27, 2011 at 7:57 AM, 刘力平 <liping.liulp <at> gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I write a package in Linux and ready to distribute, and I can install it
>>> in
(Continue reading)

Dimitri Liakhovitski | 1 Feb 02:39 2011
Picon

Re: Regularization of a matrix that has some tiny negative eigenvalues

Thanks a lot, Kjetil!

On Mon, Jan 31, 2011 at 1:15 PM, Kjetil Halvorsen
<kjetilbrinchmannhalvorsen <at> gmail.com> wrote:
> The Matrix package (which should already be insatlled on your
> computer, since it is "Recommended") have the function
> nearPD, which should do the job.
>
> Kjetil
>
> On Sat, Jan 29, 2011 at 1:32 AM, Dimitri Liakhovitski
> <dimitri.liakhovitski <at> gmail.com> wrote:
>> Dear all:
>>
>> In what I am doing I sometimes get a (Hessian) matrix that has a
>> couple of tiny negative eigenvalues (e.g. -6 * 10^-17). So, I can't
>> run a Cholesky decomp on it - but I need to.
>> Is there an established way to regularize my (Hessian) matrix (e.g.,
>> via some transformation) that would allow me to get a semi-positive
>> definite matrix to be used in Cholesky decomp?
>>
>> Or should I try some other decomp method on the back end that is less
>> sensitive than Cholesky?
>> Dimitri
>>
>> ______________________________________________
>> R-help <at> r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
(Continue reading)

Gundala Viswanath | 1 Feb 02:45 2011
Picon

List of List in Data Frame

Dear sirs,

I have a data that is generated like this:

> dat1 <- data.frame(V1 = rep(1, 5), V2 = sample(c(40:45), 5))
> dat2 <- data.frame(V1 = sample(c(0,1), 5, replace = TRUE), V2 = sample(c(40:45), 5, replace = TRUE))

What I want to do is to obtain a data frame that contain list of list.

> hiv
$hiv.dat1
$hiv.dat1$V1[[1]]
[1] 1 1 1 1 1

$hiv.dat1$V2[[1]]
[1] 41 42 43 40 44

$hiv.dat2
$hiv.dat2$V1[[1]]
[1] 0 1 1 0 0

$hiv.dat2$V2[[1]]
[1] 42 43 40 44 43

But why this line of command failed to create that?

> hiv <- list(hiv.dat1 = as.list(dat1), hiv.dat2 = as.list(dat2))

Especially it gives  "$hiv.dat1$V1" instead of "$hiv.dat1$V1[[1]]".

(Continue reading)

Sebastián Daza | 1 Feb 04:08 2011
Picon

Re: Latent Class Logit Models in discrete choice experiments

See: https://www.msu.edu/~chunghw/downloads.html
Maybe you can find something useful there!

Regards

On 1/31/2011 12:35 PM, Daniel Vecchiato wrote:
> Dear R users,
>
> I would like to perform Latent Class Logit Models for the analysis of choice experiments in environmental valuation.
>
> This kind of analysis is usually performed with NLogit Software (http://www.limdep.com).
>
> I attach the results I usually obtain using NLogit and NLogit model specifications.
>
> For Random parameter models and Logit Models I usually perform my analysis with the package mlogit (
http://cran.r-project.org/web/packages/mlogit/index.html ).
>
> The models I would like to run are presented in this ppt:
>
> http://pages.stern.nyu.edu/~wgreene/.../Lectures/Part13-LatentClassModels.ppt
>
> and an overview is given in this paper by Hoyos:
>
> http://dx.doi.org/10.1016/j.ecolecon.2010.04.011
>
> Anybody has any package to suggest for this kind of analysis? (poLCA does not provide me the same estimates)
>
>
> Thanks in advance
>
(Continue reading)

MarquisDM | 1 Feb 03:39 2011
Picon

Simple Boxplot Question- unexpected string constant error


Hi everyone,

Sorry for the newbie question but whenever I enter the following code into r
it gives me an  unexpected string constant in
"boxplot(Abs~Conc,ylab='Absorbency',xlab'Ethanol(%)'" error. I have tried
everything to eliminate it and have searched these forums to no avail, can
anyone tell me what to do to allow r to generate my boxplot for me? Here is
my code:

A=c(0.37,0.38,1.1,1.1,0.65,0.61,0.56,0.74,0.71,0.60)
B=c(0.66,0.63,0.85,0.9,0.8,0.9,0.8,0.8,0.41,0.49)
C=c(1.2,1.2,1.4,1.35,1.2,1.2,1.35,1.75,0.86,0.8)
D=c(1.1,1.2,1.2,0.8,1.1,0.85,0.94,1.4,0.88,0.63)

Abs=c(A,B,C,D)
Conc=c('0','0','0','0','0','0','0','0','0','0','20','20','20','20','20','20','20','20','20','20','30','30','30','30','30','30','30','30','30','30','40','40','40','40','40','40','40','40','40','40')

boxplot(Abs~Conc,ylab='Absorbency',xlab'Ethanol(%)')
--

-- 
View this message in context: http://r.789695.n4.nabble.com/Simple-Boxplot-Question-unexpected-string-constant-error-tp3250421p3250421.html
Sent from the R help mailing list archive at Nabble.com.

Nick Matzke | 1 Feb 05:04 2011
Picon

how to check if a library is loaded, from a function

Hi,

I've written a function which I load with a source command. 
  The function requires a certain library, phangorn, to work.

I would like the function to check if phangorn is loaded as 
a library before running.  For some reason, just putting 
require(phangorn) into the sourced function doesn't do anything.

This must be simple, but I can't figure it out!  Any help 
appreciated...

Cheers!
Nick

--

-- 
====================================================
Nicholas J. Matzke
Ph.D. Candidate, Graduate Student Researcher

Huelsenbeck Lab
Center for Theoretical Evolutionary Genomics
4151 VLSB (Valley Life Sciences Building)
Department of Integrative Biology
University of California, Berkeley

Graduate Student Instructor, IB200B
Principles of Phylogenetics: Ecology and Evolution
http://ib.berkeley.edu/courses/ib200b/
http://phylo.wikidot.com/
(Continue reading)

David Winsemius | 1 Feb 05:12 2011
Picon
Picon

Re: Simple Boxplot Question- unexpected string constant error


On Jan 31, 2011, at 9:39 PM, MarquisDM wrote:

> boxplot(Abs~Conc,ylab='Absorbency',xlab'Ethanol(%)')
missing "="..............................^.....
David Winsemius, MD
West Hartford, CT

Dennis Murphy | 1 Feb 05:18 2011
Picon

Re: Simple Boxplot Question- unexpected string constant error

Hi:

Put an equals sign between xlab and '

Dennis

On Mon, Jan 31, 2011 at 6:39 PM, MarquisDM <mszenteczki <at> gmail.com> wrote:

>
> Hi everyone,
>
> Sorry for the newbie question but whenever I enter the following code into
> r
> it gives me an  unexpected string constant in
> "boxplot(Abs~Conc,ylab='Absorbency',xlab'Ethanol(%)'" error. I have tried
> everything to eliminate it and have searched these forums to no avail, can
> anyone tell me what to do to allow r to generate my boxplot for me? Here is
> my code:
>
> A=c(0.37,0.38,1.1,1.1,0.65,0.61,0.56,0.74,0.71,0.60)
> B=c(0.66,0.63,0.85,0.9,0.8,0.9,0.8,0.8,0.41,0.49)
> C=c(1.2,1.2,1.4,1.35,1.2,1.2,1.35,1.75,0.86,0.8)
> D=c(1.1,1.2,1.2,0.8,1.1,0.85,0.94,1.4,0.88,0.63)
>
> Abs=c(A,B,C,D)
>
> Conc=c('0','0','0','0','0','0','0','0','0','0','20','20','20','20','20','20','20','20','20','20','30','30','30','30','30','30','30','30','30','30','40','40','40','40','40','40','40','40','40','40')
>
> boxplot(Abs~Conc,ylab='Absorbency',xlab'Ethanol(%)')
>
(Continue reading)

David Winsemius | 1 Feb 05:19 2011
Picon
Picon

Re: List of List in Data Frame


On Jan 31, 2011, at 8:45 PM, Gundala Viswanath wrote:

> Dear sirs,
>
> I have a data that is generated like this:
>
>> dat1 <- data.frame(V1 = rep(1, 5), V2 = sample(c(40:45), 5))
>> dat2 <- data.frame(V1 = sample(c(0,1), 5, replace = TRUE), V2 =  
>> sample(c(40:45), 5, replace = TRUE))
>
> What I want to do is to obtain a data frame that contain list of list.
>
>> hiv
> $hiv.dat1
> $hiv.dat1$V1[[1]]
> [1] 1 1 1 1 1
>
> $hiv.dat1$V2[[1]]
> [1] 41 42 43 40 44
>
>
> $hiv.dat2
> $hiv.dat2$V1[[1]]
> [1] 0 1 1 0 0
>
> $hiv.dat2$V2[[1]]
> [1] 42 43 40 44 43
>
> But why this line of command failed to create that?
(Continue reading)


Gmane