Re: [R] Updating github R packages

2016-02-16 Thread Jeff Newmiller
AFAIK the answer is no. That would be one of the main drawbacks of depending on 
github for packages. It isn't really a package repository so much as it is a 
herd of cats.
-- 
Sent from my phone. Please excuse my brevity.

On February 16, 2016 6:43:02 PM PST, "Hoji, Akihiko"  wrote:
>Hi, 
>
>Is there a way to update a R package and its dependencies,  installed
>from the github repo by a simple command equivalent to
>“update_packages()”?
>
>Thanks. 
>
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] Randomizing list independence

2016-02-16 Thread filaro1964 .
Bonjour, Hi,

English follow (google trad.)


Mon fils fait des course de ski alpin. Lors des courses, il y a un tirage
au sort pour déterminer l'ordre de départ. Au fil du temps, j'ai remarqué
que sa position de départ semblait répondre à un certain patron. Il se
retrouve très souvent en début de liste (2 ou 3eme) ou en fin de liste (2
ou 3eme avant dernier). De plus, un autre courreur se retrouve toujours
juste avant ou juste après à une ou deux position près. Je cherche donc un
test statistique qui pourrait me dire s'il y a un biais dans le tirage au
hasard. Je sais que le tirage au hasard est fait sous Excel et que le
générateur de nombres aléatoires est biaisé (nombreux articles
scientifiques sur le sujet). Pour gagner mon point, je cherche un test
statistique qui m'aiderait à vérifier si il y a une corrélation entre la
liste des courreurs (triée par club et âge) et la liste de départ après
tirage aléatoire.

Merci,

François.


Cas d'exemple de listes de départ après tirage aléatoire sous excel


Courreur-1
Courreur-2
Fils
Ami
Courreur-5
...

-=-=-=

...
Fils
Ami
Courreur-n
Courreur-n+1

-=-=-=

Courreur-1
Courreur-2
Fils
Courreur-4
Ami
Courreur-6
...

--Google trad

My son made the ski race. During the races, there is a draw to determine
the starting order. Over time, I noticed that his starting position seemed
to respond to a boss. It is very often top of the list (2 or 3rd) or end of
the list (2 or 3rd before last). In addition, another runner is always
found just before or just after one or two position closely. I seek a
statistical test that could tell me if there is a bias in the random draw. I
know the random drawing is done in Excel and the random number generator is
biased (many scientific articles on the subject). To win my point, looking
for a statistical test that would help me to check if there is a
correlation between the list of runners (sorted by age and club) and the
start list after randomization.

Thank you,

François.


Case of start lists after randomization in Excel


Runner-1
Runner-2
Son
Friend
Runner-5
...

- = - = - =

...
Son
Friend
Runner-n
Runner-n + 1

- = - = - =

Runner-1
Runner-2
Son
Runner-4
Friend
Runner-6
...

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] MCMCglmm and iteration

2016-02-16 Thread Ben Bolker
Rémi Lesmerises  yahoo.ca> writes:

>  Hi everyone, I'm running a bayesian regression using the package
> MCMCglmm (Hadfield 2010) and to reach a normal posterior
> distribution of estimates, I increased the number of iteration as
> well as the burnin threshold. However, it had unexpected
> outcomes. Although it improved posterior distribution, it also
> increased dramatically the value of estimates and decrease DIC. 
> Here's an example:

head(spring)

pres large_road  small_road  cab 
0  2011 32 78 
1   102179204 
0  1256654984 
1   187986756 
021438 57 
113  5439 

# pres is presence/absence data and other variable are distance to these
features
# with 200,000 iteration and 30,000 burnin

prior <- list(R = list(V = 1, nu=0.002))
sp.simple <- MCMCglmm(pres ~ large_road + cab + small_road,
   family = "categorical", nitt = 20, thin = 200,
burnin = 3, data = spring, prior = prior, verbose = FALSE, pr = TRUE)


(1) you will do much better with this kind of question on r-sig-mixed-models.
(2) it looks like your chain is mixing very, very badly.  If I'm reading
the output correctly, it looks like your effective sample sizes for the
first run (200K iterations) are 1-3 (!) -- you should be aiming for 
effective sample sizes of 100s to 1000s.  Even with a million iterations
you're only getting up to effective sample sizes of ~150 for some
parameters.  I would recommend (a) centring and scaling your parameters
to improve mixing and (b) cross-checking with a different method
(e.g. lme4 or glmmADMB) to make sure you're in the right ballpark.

  You shouldn't necessarily expect a Normal posterior as you increase
the number of iterations; the posterior distributions are only 
asymptotically Normal as the number of *observations* increases.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] Updating github R packages

2016-02-16 Thread Hoji, Akihiko
Hi, 

Is there a way to update a R package and its dependencies,  installed from the 
github repo by a simple command equivalent to “update_packages()”?

Thanks. 


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] MCMCglmm and iteration behaviour (new attempt)

2016-02-16 Thread Rémi Lesmerises
Here a new attempt in trying to improve the visual of my request: 

I'm running a bayesian regression using the package MCMCglmm (Hadfield 2010) 
and to reach a normal posterior distribution of estimates, I increased the 
number of iteration as well as the burnin threshold. However, it had unexpected 
outcomes. Although it improved posterior distribution, it also increased 
dramatically the value of estimates and decrease DIC. 

Here an example: 

>head(spring) 

pres large_road  small_road  cab 
0  2011 32 78 
1   102179204 
0  1256654984 
1   187986756 
021438 57 
113  5439 



>#pres is presence/absence data and other variable are distance to these 
>features 

>## with 200,000 iteration and 30,000 burnin 
>prior <- list(R = list(V = 1, nu=0.002)) 
>sp.simple <- MCMCglmm(pres ~ large_road + cab + small_road, family = 
>"categorical", nitt = 20, thin = 200, burnin = 3, 
  data = spring, prior = prior, verbose = FALSE, pr = TRUE) 

>summary(sp.simple) 

Iterations = 30001:199801 
Thinning interval  = 200 
Sample size  = 850 

DIC: 14045.31 

R-structure:  ~units 

  post.mean   l-95%   CI u-95% CI eff.samp 
units   294.7 1.621621.9  1.982 

Location effects: pres ~ large_road + cab + small_road 

   post.mean   l-95%   CIu-95% CIeff.samppMCMC 
(Intercept)5.76781 0.77622 9.24375 1.829   <0.001 ** 
large_road 0.37487 0.02692 0.75282 3.310   <0.001 ** 
cab0.94639 0.09906 1.57939 2.096   <0.001 ** 
small_raod-1.62192-2.60873-0.20191 2.002   <0.001 ** 



>## with 1,000,000 iteration and 500,000 burnin 
>prior <- list(R = list(V = 1, nu=0.002)) 
>sp.simple <- MCMCglmm(pres ~ large_road + cab + small_road, family = 
>"categorical", nitt = 100, thin = 200, burnin = 50, 
  data = spring, prior = prior, verbose = FALSE, pr = TRUE) 

>summary(sp.simple) 

Iterations = 51:999801 
Thinning interval  = 200 
Sample size  = 2500 

DIC: 858.6316 

R-structure:  ~units 

post.meanl-95%   CI u-95% CI eff.samp 
units 26764  17548  34226 124.5 

Location effects: pres ~ large_road + cab + small_road 

  post.mean   l-95%CI u-95%CIeff.samppMCMC 
(Intercept)   60.033   47.360  70.042   137.9 <4e-04 *** 
large_road 3.9771.279   6.616  1484.6 0.0080 ** 
cab9.9136.761  13.020   333.7 <4e-04 *** 
small_raod   -16.945  -20.694 -13.492   194.9 <4e-04 *** 




I'm then wandering if it is because more iteration produce better estimates and 
then a model that had a better fit with the data. 

Anyone can help me? 


Rémi Lesmerises
Université du Québec à Rimouski

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] error message for every parenthesis

2016-02-16 Thread Tara Kerin
Thank you both for your quick reply!
I did install 3.2.3, it appears that was just a typo in my earlier message.

Yes! deleting the workspace and history seems to correct the problem. I
will also not continue the practice of saving my workspace. I have also now
downloaded R studio.  Thank you for the tip. The interface is nice, and I
hope this will help my transition over to R.  I'll have to send my thanks
to Garrett as well. :)

I appreciate your help with this, and your patience with a R newbie!

Thanks,
Tara

On Tue, Feb 16, 2016 at 3:42 AM, Michael Dewey 
wrote:

> Dear Tara
>
> 1 - why did you install 3.2.1 when 3.2.3 is the latest version
> 2 - what happens if you delete .RData and .Rapp.history from your
> workspace?
> 3 - you do have a function try as it is part of R
>
> On 16/02/2016 02:49, Tara Kerin wrote:
>
>> Hi,
>>
>> I seem to be having the same problem Garrett (below) had in 2009.
>> However, I do not have functions named try written in my active code.
>> In fact, I don't have any of my own functions written at all yet.  I
>> did just install version 3.2.1 today, and the errors started after
>> that.  Please advise!
>>
>> Thank you,
>>
>> Tara Kerin
>>
>> An example from my GUI is below:
>>
>> [Workspace restored from /Users/tarakerin/.RData]
>> [History restored from /Users/tarakerin/.Rapp.history]
>>
>> Error in try(gsub("\\s+", " ",
>> paste(capture.output(print(args(library))),  :
>>unused argument (silent = TRUE)
>>
>>> library()
>>>
>>
>>
>>
>> On 7/13/2009 12:35 PM, Garrett Grolemund wrote:
>>
>>> * Whenever I type a parenthesis immediately following a word (as if I'm
>>>
>> *>* entering a function) R displays the following error
>> *> >* Error in try(gsub("\\s+", " ",
>> paste(capture.output(print(args(try))),  :
>> *>*   unused argument(s) (silent = TRUE)
>> *>>* try(
>> *> >* The above is pasted from my R console. The error appears above the
>> command
>> *>* because it appears immediately upon typing the parenthesis.  It does
>> not
>> *>* wait until I try to execute the command.  This happens for every
>> function.
>> *>* I can finish typing the function and execute it.  But these error
>> messages
>> *>* make it difficult to debug my code.  In particular, if I have
>> options(error
>> *>* = recover) set, the above crashes R.
>> *> >* I can avoid the error by typing the parentheses first and then
>> moving the
>> *>* cursor back to type in the word. This error displays on the console
>> whether
>> *>* I'm typing in the console or in an open document window.
>> *> >* I'm using the mac GUI for R.  The error only occurs on my Macbook
>> (OS X
>> *>* 10.5.7), which I bought a few months ago.  It has occurred  every
>> time I use
>> *>* R on this computer.  It has happened with R 2.8 and now R 2.91.
>> *> >* Any idea what may be going on?
>> *
>> Presumably this has something to do with command completion or argument
>> hints.  From the "silent = TRUE" error, and your example, I would guess
>> you have a function named try(), and the GUI is finding yours instead of
>> the one in the base package.
>>
>> The GUI shouldn't do that, it should look in the right place, but as a
>> workaround, you could remove your function named "try", and call it
>> something else.
>>
>> Duncan Murdoch
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=CwIC-g&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=prT9XxFuaRugndr7R7tjdw&m=HVCyKiQWRxny54BBUQ0nDk5GMBt-Tqu5QKL9lPLHz68&s=q4D_wqmRhBJGJthwMhvTyghlur-p0y7tvRFFyQzEKrY&e=
>> PLEASE do read the posting guide
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=CwIC-g&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=prT9XxFuaRugndr7R7tjdw&m=HVCyKiQWRxny54BBUQ0nDk5GMBt-Tqu5QKL9lPLHz68&s=Q6yO2ncF0da0PoI6_hWTYJpGUERfu3iQB1Uvl_-rr_I&e=
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> --
> Michael
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dewey.myzen.co.uk_home.html&d=CwIC-g&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=prT9XxFuaRugndr7R7tjdw&m=HVCyKiQWRxny54BBUQ0nDk5GMBt-Tqu5QKL9lPLHz68&s=dg8BMn7W326f_R6GuQUhbH3-QoXSzP40qHbv_wLeNkI&e=

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] MCMCglmm and iteration

2016-02-16 Thread Rémi Lesmerises
Hi everyone,
I'm running a bayesian regression using the package MCMCglmm (Hadfield 2010) 
and to reach a normal posterior distribution of estimates, I increased the 
number of iteration as well as the burnin threshold. However, it had unexpected 
outcomes. Although it improved posterior distribution, it also increased 
dramatically the value of estimates and decrease DIC. 
Here an example:
>head(spring)
pres   large_road    small_road    cab0             2011                32      
     781              102               179          2040              1256     
        654          9841              187               986          7560      
         21                438           571               13                   
5           439    
>#pres is presence/absence data and other variable are distance to these 
>features
>## with 200,000 iteration and 30,000 burnin>prior <- list(R = list(V = 1, 
>nu=0.002))>sp.simple <- MCMCglmm(pres ~ large_road + cab + small_road, family 
>= "categorical", nitt = 20, thin = 200, burnin = 3,
> data = spring, prior = prior, verbose = FALSE, pr = 
>TRUE)
>summary(sp.simple)
 Iterations = 30001:199801 Thinning interval  = 200 Sample size  = 850 
 DIC: 14045.31 
 R-structure:  ~units
         post.mean     l-95%     CI u-95%     CI eff.sampunits     294.7        
 1.621        621.9            1.982
 Location effects: pres ~ large + cab + small + Coupe_0_5 + Regeneration + 
Res_mature + DH + Autre + Eau + Pert_nonregen + MF + Coupe_6_20 
                     post.mean     l-95%       CI  u-95%     CI eff.samp     
pMCMC   (Intercept)     5.76781      0.77622       9.24375          1.829       
     <0.001 **large             0.37487      0.02692       0.75282           
3.310            <0.001 **cab               0.94639      0.09906       1.57939  
         2.096            <0.001 **small           -1.62192     -2.60873      
-0.20191           2.002            <0.001 **


>## with 1,000,000 iteration and 500,000 burnin>prior <- list(R = list(V = 1, 
>nu=0.002))>sp.simple <- MCMCglmm(pres ~ large_road + cab + small_road, family 
>= "categorical", nitt = 100, thin = 200, burnin = 50,  
>   data = spring, prior = prior, verbose = FALSE, pr = 
>TRUE)
>summary(sp.simple)
 Iterations = 51:999801 Thinning interval  = 200 Sample size  = 2500 
 DIC: 858.6316 
 R-structure:  ~units
         post.mean    l-95%   CI u-95%     CI eff.sampunits     26764      
17548      34226             124.5
 Location effects: pres ~ large_road + cab + small_road 
                   post.mean    l-95%    CI u-95%    CI eff.samp      pMCMC    
(Intercept)     60.033      47.360     70.042          137.9            <4e-04 
***large_road      3.977        1.279       6.616        1484.6            
0.0080 ** cab_road        9.913        6.761     13.020          333.7          
  <4e-04 ***small           -16.945     -20.694    -13.492          194.9       
     <4e-04 ***

 
I'm then wandering if it is because more iteration produce better estimates and 
then a model that had a better fit with the data.
Anyone can help me? 

Rémi


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Recommendation for updating packages such as nlme

2016-02-16 Thread Jeff Newmiller
Isn't /usr/local for software your sysadmin (you, when you wear that hat) have 
compiled, while /usr/lib is managed by the system package manager (apt-get for 
Ubuntu)?

FWIW I usually only manage my personal R library and ignore the system R 
library... I never specify instLib myself, and never run R as root. There might 
be advantages to specifying instLib, but I have not encountered them. 
-- 
Sent from my phone. Please excuse my brevity.

On February 16, 2016 12:01:22 PM PST, Frank Harrell  
wrote:
>I use this function to update my installed R packages:
>
>updatePac <- function (checkBuilt = FALSE, ...)
>update.packages(repos = "http://cran.rstudio.com";, instlib = 
>"/usr/local/lib/R/site-library",
> checkBuilt = checkBuilt, ...)
>
>When I type updatePac() I get:
>
>Warning: package 'MASS' in library '/usr/lib/R/library' will not be
>updated
>Warning: package 'Matrix' in library '/usr/lib/R/library' will not be 
>updated
>Warning: package 'mgcv' in library '/usr/lib/R/library' will not be
>updated
>Warning: package 'nlme' in library '/usr/lib/R/library' will not be
>updated
>Warning: package 'nnet' in library '/usr/lib/R/library' will not be
>updated
>Warning: package 'spatial' in library '/usr/lib/R/library' will not be 
>updated
>
>Should I not try to update recommended packages in 
>/usr/local/lib/R/site-library on my Ubuntu system but specify 
>/usr/lib/R/library instead?
>
>-- 
>
>Frank E Harrell Jr Professor and Chairman  School of Medicine
>
>   Department of *Biostatistics*   *Vanderbilt University*
>
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Recommendation for updating packages such as nlme

2016-02-16 Thread Frank Harrell
I use this function to update my installed R packages:

updatePac <- function (checkBuilt = FALSE, ...)
update.packages(repos = "http://cran.rstudio.com";, instlib = 
"/usr/local/lib/R/site-library",
 checkBuilt = checkBuilt, ...)

When I type updatePac() I get:

Warning: package 'MASS' in library '/usr/lib/R/library' will not be updated
Warning: package 'Matrix' in library '/usr/lib/R/library' will not be 
updated
Warning: package 'mgcv' in library '/usr/lib/R/library' will not be updated
Warning: package 'nlme' in library '/usr/lib/R/library' will not be updated
Warning: package 'nnet' in library '/usr/lib/R/library' will not be updated
Warning: package 'spatial' in library '/usr/lib/R/library' will not be 
updated

Should I not try to update recommended packages in 
/usr/local/lib/R/site-library on my Ubuntu system but specify 
/usr/lib/R/library instead?

-- 

Frank E Harrell Jr  Professor and Chairman  School of Medicine

Department of *Biostatistics*   *Vanderbilt University*


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] this is not a list, not a data frame, but what ?

2016-02-16 Thread ruipbarradas
Hello,

What you want is a list of lists.
Try something like

Parameters <- list(PC_h_m = list(descript = "Point de convergence  
hauteur en metre", value = 5),
        PC_Q_m3 = list(descript = "Point de convergence debit en  
m3/s", value = 805.00))

Hope this helps,

Rui Barradas
 

Citando MAURICE Jean - externe :

> HI,
> I am new to R and English is not my natural language.
>
> I am working on an old R application where there is a matrix  
> containing parameters. Something like :
> parametres=matrix(NA,15,3)
> parametres[1,1]<- "Point de convergence hauteur en metre"
> parametres[1,2]<- 5.00
> parametres[1,3]<- "PC_h_m"
> parametres[2,1]<- "Point de convergence debit en m3/s"
> parametres[2,2]<- 805.00
> parametres[2,3]<- "PC_Q_m3"
> and so on.
>> From 15 parameters, we shall reach 40.
>
> I'd like to be able to use something like
> Parameters$PC_h_m$descript to have "Point de convergence hauteur en metre"
> Parameters$PC_h_m$value to have 5
> Parameters$ PC_Q_m3$descript to have "Point de convergence debit en m3/s"
> Parameters$ PC_Q_m3$value to have 805.00
>
> It's a lot more 'readable' by humans ... Is it possible and, if yes, how ?
>
> Thanks in advance for your answers ...Jean in France

 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] this is not a list, not a data frame, but what ?

2016-02-16 Thread Ulrik Stervbo
Hi Maurice,

Could you use a data.frame with a description  and a value column?

Something like

data.frame(description1 = c ("Point de convergence hauteur en metre",
"Point de convergence debit en m3/s"),
description2 = c ( "PC_h_m", "PC_Q_m3" ),
value = c (  5.00, 805.00 ))

You can then subset the data.frame to get the values you are interested in.

Best,
Ulrik

MAURICE Jean - externe  schrieb am Di., 16.
Feb. 2016 19:22:

> HI,
> I am new to R and English is not my natural language.
>
> I am working on an old R application where there is a matrix containing
> parameters. Something like :
>   parametres=matrix(NA,15,3)
>   parametres[1,1]<- "Point de convergence hauteur en metre"
>   parametres[1,2]<- 5.00
>   parametres[1,3]<- "PC_h_m"
>   parametres[2,1]<- "Point de convergence debit en m3/s"
>   parametres[2,2]<- 805.00
>   parametres[2,3]<- "PC_Q_m3"
> and so on.
>
> >From 15 parameters, we shall reach 40.
>
> I'd like to be able to use something like
>   Parameters$PC_h_m$descript to have "Point de convergence hauteur en
> metre"
>   Parameters$PC_h_m$value to have 5
>   Parameters$ PC_Q_m3$descript to have "Point de convergence debit en m3/s"
>   Parameters$ PC_Q_m3$value to have 805.00
>
> It's a lot more 'readable' by humans ... Is it possible and, if yes, how ?
>
> Thanks in advance for your answers ...
> Jean in France
>
>
>
>
> Ce message et toutes les pièces jointes (ci-après le 'Message') sont
> établis à l'intention exclusive des destinataires et les informations qui y
> figurent sont strictement confidentielles. Toute utilisation de ce Message
> non conforme à sa destination, toute diffusion ou toute publication totale
> ou partielle, est interdite sauf autorisation expresse.
>
> Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de
> le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou
> partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de
> votre système, ainsi que toutes ses copies, et de n'en garder aucune trace
> sur quelque support que ce soit. Nous vous remercions également d'en
> avertir immédiatement l'expéditeur par retour du message.
>
> Il est impossible de garantir que les communications par messagerie
> électronique arrivent en temps utile, sont sécurisées ou dénuées de toute
> erreur ou virus.
> 
>
> This message and any attachments (the 'Message') are intended solely for
> the addressees. The information contained in this Message is confidential.
> Any use of information contained in this Message not in accord with its
> purpose, any dissemination or disclosure, either whole or partial, is
> prohibited except formal approval.
>
> If you are not the addressee, you may not copy, forward, disclose or use
> any part of it. If you have received this message in error, please delete
> it and all copies from your system and notify the sender immediately by
> return message.
>
> E-mail communication cannot be guaranteed to be timely secure, error or
> virus-free.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] this is not a list, not a data frame, but what ?

2016-02-16 Thread MAURICE Jean - externe
HI,
I am new to R and English is not my natural language.

I am working on an old R application where there is a matrix containing 
parameters. Something like :
  parametres=matrix(NA,15,3)
  parametres[1,1]<- "Point de convergence hauteur en metre"
  parametres[1,2]<- 5.00
  parametres[1,3]<- "PC_h_m"
  parametres[2,1]<- "Point de convergence debit en m3/s"
  parametres[2,2]<- 805.00
  parametres[2,3]<- "PC_Q_m3"
and so on.

>From 15 parameters, we shall reach 40.

I'd like to be able to use something like
  Parameters$PC_h_m$descript to have "Point de convergence hauteur en metre"
  Parameters$PC_h_m$value to have 5
  Parameters$ PC_Q_m3$descript to have "Point de convergence debit en m3/s"
  Parameters$ PC_Q_m3$value to have 805.00

It's a lot more 'readable' by humans ... Is it possible and, if yes, how ?

Thanks in advance for your answers ...
Jean in France




Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à 
l'intention exclusive des destinataires et les informations qui y figurent sont 
strictement confidentielles. Toute utilisation de ce Message non conforme à sa 
destination, toute diffusion ou toute publication totale ou partielle, est 
interdite sauf autorisation expresse.

Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le 
copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si 
vous avez reçu ce Message par erreur, merci de le supprimer de votre système, 
ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support 
que ce soit. Nous vous remercions également d'en avertir immédiatement 
l'expéditeur par retour du message.

Il est impossible de garantir que les communications par messagerie 
électronique arrivent en temps utile, sont sécurisées ou dénuées de toute 
erreur ou virus.


This message and any attachments (the 'Message') are intended solely for the 
addressees. The information contained in this Message is confidential. Any use 
of information contained in this Message not in accord with its purpose, any 
dissemination or disclosure, either whole or partial, is prohibited except 
formal approval.

If you are not the addressee, you may not copy, forward, disclose or use any 
part of it. If you have received this message in error, please delete it and 
all copies from your system and notify the sender immediately by return message.

E-mail communication cannot be guaranteed to be timely secure, error or 
virus-free.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Comparing variance components

2016-02-16 Thread Bert Gunter
I'll save you the trouble.

Yes, they're bigger. Or smaller. Certainly differ between experiments.  So
what? That is just the way things work.

 Google "weighting in meta-analysis" or similar for ways folks try to deal
with this.

Cheers,

Bert

On Tuesday, February 16, 2016, Wen Huang  wrote:

> Hi Harold,
> R
> Thank you for your input. I was not very clear. I wanted to compare the
> sigma2_A’s from the same model fitted to two different data sets. The same
> for sigma2_e’s. The motivation is when I did the same experiment at two
> different times, whether the variance due to A (sigma2_A) is bigger at one
> time versus another. The same for sigma2_e, whether the residual variance
> is bigger for one experiment versus another.
>
> Thanks,
> Wen
>
> > On Feb 16, 2016, at 12:40 PM, Doran, Harold  > wrote:
> >
> > (adding R mixed group). You actually do not want to do this test, and
> there is no "shrinkage" here on these variances. First, there are
> conditional variances and marginal variances in the mixed model. What you
> are have below as "A" is the marginal variances of the random effects and
> there is no shrinkage on these, per se.
> >
> > The conditional means of the random effects have shrinkage and each
> conditional mean (or BLUP) has a conditional variance.
> >
> > Now, it seems very odd to want to compare the variance between A and
> then what you have as sigma2_e, which is presumably the residual variance.
> These are variances of two completely different things, so a test comparing
> them seems strange, though I suppose some theoretical reason could exists
> justifying it, I cannot imagine one though.
> >
> >
> >
> >
> >
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org ] On
> Behalf Of Wen Huang
> > Sent: Tuesday, February 16, 2016 10:57 AM
> > To: r-help@r-project.org 
> > Subject: [R] Comparing variance components
> >
> > Dear R-help members,
> >
> > Say I have two data sets collected at different times with the same
> design. I fit a mixed model using in R using lmer
> >
> > lmer(y ~ (1|A))
> >
> > to these data sets and get two estimates of sigma2_A and sigma2_e
> >
> > What would be a good way to compare sigma2_A and sigma2_e for these two
> data sets and obtain a P value for the hypothesis that sigma2_A1 =
> sigma2_A2? There is obvious shrinkage on these estimates, should I be
> worried about the differential levels of shrinkage on these estimates and
> how to account for that?
> >
> > Thank you for your thoughts and inputs!
> >
> >
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org  mailing list -- To UNSUBSCRIBE and
> more, see 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.
>
> __
> R-help@r-project.org  mailing list -- To UNSUBSCRIBE and
> more, see
> 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.



-- 
Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Comparing variance components

2016-02-16 Thread Wen Huang
Hi Harold,

Thank you for your input. I was not very clear. I wanted to compare the 
sigma2_A’s from the same model fitted to two different data sets. The same for 
sigma2_e’s. The motivation is when I did the same experiment at two different 
times, whether the variance due to A (sigma2_A) is bigger at one time versus 
another. The same for sigma2_e, whether the residual variance is bigger for one 
experiment versus another.

Thanks,
Wen

> On Feb 16, 2016, at 12:40 PM, Doran, Harold  wrote:
> 
> (adding R mixed group). You actually do not want to do this test, and there 
> is no "shrinkage" here on these variances. First, there are conditional 
> variances and marginal variances in the mixed model. What you are have below 
> as "A" is the marginal variances of the random effects and there is no 
> shrinkage on these, per se.
> 
> The conditional means of the random effects have shrinkage and each 
> conditional mean (or BLUP) has a conditional variance. 
> 
> Now, it seems very odd to want to compare the variance between A and then 
> what you have as sigma2_e, which is presumably the residual variance. These 
> are variances of two completely different things, so a test comparing them 
> seems strange, though I suppose some theoretical reason could exists 
> justifying it, I cannot imagine one though. 
> 
> 
> 
> 
> 
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Wen Huang
> Sent: Tuesday, February 16, 2016 10:57 AM
> To: r-help@r-project.org
> Subject: [R] Comparing variance components
> 
> Dear R-help members,
> 
> Say I have two data sets collected at different times with the same design. I 
> fit a mixed model using in R using lmer
> 
> lmer(y ~ (1|A))
> 
> to these data sets and get two estimates of sigma2_A and sigma2_e
> 
> What would be a good way to compare sigma2_A and sigma2_e for these two data 
> sets and obtain a P value for the hypothesis that sigma2_A1 = sigma2_A2? 
> There is obvious shrinkage on these estimates, should I be worried about the 
> differential levels of shrinkage on these estimates and how to account for 
> that?
> 
> Thank you for your thoughts and inputs!
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] Comparing variance components

2016-02-16 Thread Doran, Harold
(adding R mixed group). You actually do not want to do this test, and there is 
no "shrinkage" here on these variances. First, there are conditional variances 
and marginal variances in the mixed model. What you are have below as "A" is 
the marginal variances of the random effects and there is no shrinkage on 
these, per se.

The conditional means of the random effects have shrinkage and each conditional 
mean (or BLUP) has a conditional variance. 

Now, it seems very odd to want to compare the variance between A and then what 
you have as sigma2_e, which is presumably the residual variance. These are 
variances of two completely different things, so a test comparing them seems 
strange, though I suppose some theoretical reason could exists justifying it, I 
cannot imagine one though. 





-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Wen Huang
Sent: Tuesday, February 16, 2016 10:57 AM
To: r-help@r-project.org
Subject: [R] Comparing variance components

Dear R-help members,

Say I have two data sets collected at different times with the same design. I 
fit a mixed model using in R using lmer

lmer(y ~ (1|A))

to these data sets and get two estimates of sigma2_A and sigma2_e

What would be a good way to compare sigma2_A and sigma2_e for these two data 
sets and obtain a P value for the hypothesis that sigma2_A1 = sigma2_A2? There 
is obvious shrinkage on these estimates, should I be worried about the 
differential levels of shrinkage on these estimates and how to account for that?

Thank you for your thoughts and inputs!



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Comparing variance components

2016-02-16 Thread Wen Huang
Dear R-help members,

Say I have two data sets collected at different times with the same design. I 
fit a mixed model using in R using lmer

lmer(y ~ (1|A))

to these data sets and get two estimates of sigma2_A and sigma2_e

What would be a good way to compare sigma2_A and sigma2_e for these two data 
sets and obtain a P value for the hypothesis that sigma2_A1 = sigma2_A2? There 
is obvious shrinkage on these estimates, should I be worried about the 
differential levels of shrinkage on these estimates and how to account for that?

Thank you for your thoughts and inputs!



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] NaNs produced as a returned value for a function

2016-02-16 Thread Maram SAlem
Thanks for helping Dunlap.

I just don't get why does the function bettarg() executes well if I
evaluate it (by hand) step-by step . nut for the same input values , if I
tried to execute bettarg() it will give me the error

Error in if (y <= accept.prob) { : missing value where TRUE/FALSE needed
 Although both y and accept.prob have values and are not missing.

Any help would be appreciated as this error is causing my entire(large and
complicated) code to stop execution.

Maram Salem

On 14 February 2016 at 22:08, William Dunlap  wrote:

> You can do things like
>while ( !is.nan( r <- randomFunction(x) )) {}
># r will be a non-NaN value of randomFunction(x) now
> or
>for(i in seq_len(1000)) {
>   if (!is.nan( r <- randomFunction(x))) {
>   break
>   }
>   if (i == 1000) {
>   stop("no good values of randomFunction(x) in 1000 tries")
>   }
>}
> to avoid infinite loops when randomFunction [almost] always produces a NaN.
>
> You may  be able to avoid some NaNs by replacing log(b^n) with n*log(b) and
> log(prod(x^b)) with sum(b*log(x)).  That would avoid unneeded Inf values,
> which
> can lead to NaN down the line (Inf-Inf -> NaN, Inf/Inf -> NaN).
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Sun, Feb 14, 2016 at 9:22 AM, Maram SAlem 
> wrote:
>
>> Hi all,
>>
>> I'm trying to write 2 functions(as a part of a larger code) to evaluate a
>> certain equation.  The function is :
>>
>> X= c (0.3893094  2.0962311  2.6007558  3.0761810  3.3246947  3.3917976
>>  4.1981546  6.8826140 12.3128013 15.5588470)
>> R=c (0 1 0 0 0 1 1 1 0 1)
>>
>> alpha.update=function(X, R, alpha.curr, beta.curr=1 ,m=10,
>> hyp=c(3,15,6,22.5))
>>
>>   {
>>
>>   o<-numeric(m)
>>
>>  for (i in 1:m) {
>>
>>o[i]<- (1+R[i])*((X[i])^(beta.curr))
>>
>> }
>>
>>sh<-sum(o) + hyp[2] + (hyp[4]* beta.curr)
>>
>>rg<-rgamma(1, shape= m+hyp[1]+hyp[3] , rate = sh )
>>
>>return(rg)
>>
>>}
>>
>>
>> alpha.curr<- alpha.update(X, R, alpha.curr=0.2, beta.curr=1 ,m, hyp)
>>
>>
>> bettarg<- function(X, R, alpha.curr, beta.curr=1 ,m=10,
>> hyp=c(3,15,6,22.5))
>>
>>{
>>
>>o<-numeric(m)
>>
>>for (i in 1:m) {
>>
>>o[i]<- (1+R[i])*((X[i])^( beta.curr))
>>
>> }
>>
>>   logbt<- log(beta.curr ^(m+hyp[3]-1)) + log(prod((X)^( beta.curr
>> -1)))
>> + (-1*alpha.curr *(sum(o) +  (hyp[4]* beta.curr)))
>>
>>
>>
>>   bt<- exp(logbt)
>>
>>   return(bt)
>>
>>}
>>
>>
>> The problem is that the function bettarg() sometimes produces   NaN, and
>> this stops the evaluation of my equation, so how can I force it to ignore
>> the NaNs produced and repeat the evaluation again till it prroduces a
>> number?
>>
>>
>> Thanks in advance,
>>
>>
>> Maram Salem
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>>
>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] Estimating Mean of a Poisson Distribution Based on interval censoring

2016-02-16 Thread mohsen hs via R-help
Hi Terry,
Thank you for your reply and your time. I really appreciate your time and I 
know that you should be very busy.
Please forgive me for any possible technical mistake as I am not a professional 
in statistic.
R has a package with the name of fitdist that gave me the estimation. It seems 
that lifereg does not support Poisson at list without any specific modification,
(https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_lifereg_sect019.htm).
Please let me explain my problem which you can find below. Since, you are 
interested to know the problem, I tried to explain the problem clearly. Please 
forgive me if it is too long:( . I really appreciate your time, consideration, 
and feedback.


Many thanks,Mohsen
We collected the data from some devices and they are able to count the data 
within a minute. For example, we had 10 observations in 12:01, 15 in 12:02, and 
so forth. I randomly distributed the data (10 obs) in the first 60 sec, and the 
15 obs in (60 to 120 sec) and count the interarrival of obs. In this case, I 
got a result like this:1, 2002, 4003, 150The first row means I had 200 objects 
that arrived with the difference of 1 second, 400 objects with the difference 
of two seconds (interarrival rate was 2 sec for 400 objects), and so on. To do 
that, I wrote a function to repeat 1, two hundred times, repeat 2, four hundred 
times, and ... Now, I would like to investigate which distribution they follow. 
Since some of the devices were faulty and  for some other reasons such as tails 
of QQ plot, I decided to censor some of the data, and those are 
interarrival(obs)<3 sec and interarrival(obs)>500 sec. 

On a different topic related to difference between R and SAS, I have provided 
you with the mu, sigma, and codes.

In SAS and R, I used interval censoring with the boundaries of 3, and 500 and 
formed a table like this:

        count & t1  & t2           1     & 1   & 3             1     & 1   & 3  
           2     & 2   & 3             3     & 3   & 3            3     & 3   & 
3             4     & 4   & 4             ..    & ..  & ..            500   & 
500 & 500          501   & 500 & 501           ..    & ..  & ..           39011 
& 500 & 39011

count is the observed value and is the response variable, t1 is the bound of 
right censoring and t2 is the bound of left censoring. This is done by the 
following command in SAS
 loss count/ lc=t2 rc=t1;

SAS estimated:
 $\mu=3.67361$ , $\sigma=1.45265$ 
http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_severity_sect037.htm
      The LOSS statement specifies the left and right boundary of each group as 
the       right-censoring and left-censoring limits, respectively.       lc=t2 
rc=t1;      t1   t2      1    3      1    3      500  600      500  4500
SAS code,/
                 data df;                                                       
                                                                             
infile "/home/Username/PathAll_TWOMONTH _BothDirection715_2.csv"                
                                                              LRECL=1000  
DLM=',' firstobs=2;                                                             
                                       input                                    
                                                                                
              timenumn count right left                                         
                                                                     ;          
                                                                                
                                            run;       data t1(drop=count left 
right rename=(timenumn=t1)) ;                                                   
                                                                              
set df;                                                                         
                                                             do i = 1 to count; 
                                                                                
                                          output;                               
                                                                                
                       end;                                                     
                                                                                
    run;           data t2(drop=count left right rename=(timenumn=t2));         
                                                                                
                                             set df;                            
                                                                                
                          do i = 1 to count;                                    
                                                                                
       output;            

Re: [R] Need your favour : twitter sentiment issue while cleaning the corpus

2016-02-16 Thread Sandeep Rana
Hi,
In continuation to my initial mail I also observed that as I include more 
number of tweets, the likelihood of getting this error increases.

Platform I’m using:
- Mac Yosemite
- R version 3.2.2(RStudio) 

I have below questions:
- Does this error has to do anything with the default locale set in R session? 
I have had it set from Mac terminal “defaults write org.R-project.R force.LANG 
en_US.UTF-8” 
- Before creating the Corpus() I had the tweets converted to character by using 
this command tw_text <- sapply(tw, function(x) x$getText()). Is it the 
recommended approach ?

How should I go about getting this issue resolved ?

Regards,
Sunny Singha


> On 16-Feb-2016, at 5:22 PM, Sandeep Rana  
> wrote:
> 
> Hi,
> I need your favour. I received below warning while cleaning the corpus of 
> tweets which is not allowing me to further the analysis:
> 
> Warning message:
> In mclapply(content(x), FUN, ...) :
>   scheduled core 1 encountered error in user code, all values of the job will 
> be affected
> 
> Code used: for cleaning. 
> tw_clean <- tm_map(tw_corpus, removePunctuation)
> tw_clean <- tm_map(tw_clean, content_transformer(tolower))
> tw_clean <- tm_map(tw_clean, removeWords, stopwords('english'))
> tw_clean <- tm_map(tw_clean, removeNumbers)
> tw_clean <- tm_map(tw_clean, stripWhitespace)
> 
> Code used to create the corpus:
> tw_corpus <- Corpus(VectorSource(tw_text))
> 
> The error is raised for each of the above line of code. 
> 
> I some how found a way to ignore the error/warning message by including 
> ‘lazy=TRUE’ argument in the tm_map() function
> but when attempted to view the wordcloud(tw_clean)  below error is raised 
> with the same warning.
> 
> Error in UseMethod("meta", x) : 
>   no applicable method for 'meta' applied to an object of class "try-error"
> 
> In addition: Warning message:
> In mclapply(unname(content(x)), termFreq, control) :
>   scheduled core 1 encountered error in user code, all values of the job will 
> be affected
> 
> Regards,
> Sunny Singha


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

[R] Need your favour : twitter sentiment issue while cleaning the corpus

2016-02-16 Thread Sandeep Rana
Hi,
I need your favour. I received below warning while cleaning the corpus of 
tweets which is not allowing me to further the analysis:

Warning message:
In mclapply(content(x), FUN, ...) :
  scheduled core 1 encountered error in user code, all values of the job will 
be affected

Code used: for cleaning. 
tw_clean <- tm_map(tw_corpus, removePunctuation)
tw_clean <- tm_map(tw_clean, content_transformer(tolower))
tw_clean <- tm_map(tw_clean, removeWords, stopwords('english'))
tw_clean <- tm_map(tw_clean, removeNumbers)
tw_clean <- tm_map(tw_clean, stripWhitespace)

Code used to create the corpus:
tw_corpus <- Corpus(VectorSource(tw_text))

The error is raised for each of the above line of code. 

I some how found a way to ignore the error/warning message by including 
‘lazy=TRUE’ argument in the tm_map() function
but when attempted to view the wordcloud(tw_clean)  below error is raised with 
the same warning.

Error in UseMethod("meta", x) : 
  no applicable method for 'meta' applied to an object of class "try-error"

In addition: Warning message:
In mclapply(unname(content(x)), termFreq, control) :
  scheduled core 1 encountered error in user code, all values of the job will 
be affected

Regards,
Sunny Singha
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Re: [R] error message for every parenthesis

2016-02-16 Thread Michael Dewey

Dear Tara

1 - why did you install 3.2.1 when 3.2.3 is the latest version
2 - what happens if you delete .RData and .Rapp.history from your workspace?
3 - you do have a function try as it is part of R

On 16/02/2016 02:49, Tara Kerin wrote:

Hi,

I seem to be having the same problem Garrett (below) had in 2009.
However, I do not have functions named try written in my active code.
In fact, I don't have any of my own functions written at all yet.  I
did just install version 3.2.1 today, and the errors started after
that.  Please advise!

Thank you,

Tara Kerin

An example from my GUI is below:

[Workspace restored from /Users/tarakerin/.RData]
[History restored from /Users/tarakerin/.Rapp.history]

Error in try(gsub("\\s+", " ", paste(capture.output(print(args(library))),  :
   unused argument (silent = TRUE)

library()




On 7/13/2009 12:35 PM, Garrett Grolemund wrote:

* Whenever I type a parenthesis immediately following a word (as if I'm

*>* entering a function) R displays the following error
*> >* Error in try(gsub("\\s+", " ", paste(capture.output(print(args(try))),  :
*>*   unused argument(s) (silent = TRUE)
*>>* try(
*> >* The above is pasted from my R console. The error appears above the command
*>* because it appears immediately upon typing the parenthesis.  It does not
*>* wait until I try to execute the command.  This happens for every function.
*>* I can finish typing the function and execute it.  But these error messages
*>* make it difficult to debug my code.  In particular, if I have options(error
*>* = recover) set, the above crashes R.
*> >* I can avoid the error by typing the parentheses first and then moving the
*>* cursor back to type in the word. This error displays on the console whether
*>* I'm typing in the console or in an open document window.
*> >* I'm using the mac GUI for R.  The error only occurs on my Macbook (OS X
*>* 10.5.7), which I bought a few months ago.  It has occurred  every time I use
*>* R on this computer.  It has happened with R 2.8 and now R 2.91.
*> >* Any idea what may be going on?
*
Presumably this has something to do with command completion or argument
hints.  From the "silent = TRUE" error, and your example, I would guess
you have a function named try(), and the GUI is finding yours instead of
the one in the base package.

The GUI shouldn't do that, it should look in the right place, but as a
workaround, you could remove your function named "try", and call it
something else.

Duncan Murdoch

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] [FORGED] Error installing the package "Cairo"

2016-02-16 Thread Sandeep Mallya
I tried the command below

sudo yum install cairo-devel.x86_64

Package cairo-devel-1.8.8-6.el6_6.x86_64 already installed and latest
version
Nothing to do

I have also tried installing libpng-devel

Still the error persists.

Thanks,
Sandeep


On Tue, Feb 16, 2016 at 3:09 AM, Rolf Turner 
wrote:

> On 15/02/16 22:51, Sandeep Mallya wrote:
>
>> Hello all,
>>
>> I am trying to install the package Cairo on RedHat running R version
>> 3.2.3.
>> So far I have tried install.packages("Cairo")
>> R CMD INSTALL Cairo_1.5-9.tar.gz
>>
>> Both the approaches giving me the same error below.
>>
>>
>> Error : .onLoad failed in loadNamespace() for 'Cairo', details:
>>call: dyn.load(file, DLLpath = DLLpath, ...)
>>error: unable to load shared object
>> '/home/sandeep/R/x86_64-pc-linux-gnu-library/3.2/Cairo/libs/Cairo.so':
>>libpng15.so.15: cannot open shared object file: No such file or
>> directory
>> Error: loading failed
>> Execution halted
>>
>>
>> Can someone please guide me.
>>
>
> You apparently do not have the "cairo infrastructure" installed on your
> computer.  You probably need to do something like:
>
> sudo yum install cairo.x86_64 # Prob'ly not necessary, this package
>   # should be already there.
> sudo yum install cairo-devel.x86_64
>
> You may not need to include the ".x86.64" strings, I'm not sure.  Or you
> may need *not* to include them!
>
> HTH.
>
> cheers,
>
> Rolf Turner
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] error in try

2016-02-16 Thread Tara Kerin
Hi,

I seem to be having the same problem Garrett (below) had in 2009.
However, I do not have functions named try written in my active code.
In fact, I don't have any of my own functions written at all yet.  I
did just install version 3.2.1 today, and the errors started after
that.  Please advise!

Thank you,

Tara Kerin

An example from my GUI is below:

[Workspace restored from /Users/tarakerin/.RData]
[History restored from /Users/tarakerin/.Rapp.history]

Error in try(gsub("\\s+", " ", paste(capture.output(print(args(library))),  :
  unused argument (silent = TRUE)
> library()



On 7/13/2009 12:35 PM, Garrett Grolemund wrote:
>* Whenever I type a parenthesis immediately following a word (as if I'm
*>* entering a function) R displays the following error
*> >* Error in try(gsub("\\s+", " ", paste(capture.output(print(args(try))),  :
*>*   unused argument(s) (silent = TRUE)
*>>* try(
*> >* The above is pasted from my R console. The error appears above the command
*>* because it appears immediately upon typing the parenthesis.  It does not
*>* wait until I try to execute the command.  This happens for every function.
*>* I can finish typing the function and execute it.  But these error messages
*>* make it difficult to debug my code.  In particular, if I have options(error
*>* = recover) set, the above crashes R.
*> >* I can avoid the error by typing the parentheses first and then moving the
*>* cursor back to type in the word. This error displays on the console whether
*>* I'm typing in the console or in an open document window.
*> >* I'm using the mac GUI for R.  The error only occurs on my Macbook (OS X
*>* 10.5.7), which I bought a few months ago.  It has occurred  every time I use
*>* R on this computer.  It has happened with R 2.8 and now R 2.91.
*> >* Any idea what may be going on?
*
Presumably this has something to do with command completion or argument
hints.  From the "silent = TRUE" error, and your example, I would guess
you have a function named try(), and the GUI is finding yours instead of
the one in the base package.

The GUI shouldn't do that, it should look in the right place, but as a
workaround, you could remove your function named "try", and call it
something else.

Duncan Murdoch

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] error message for every parenthesis

2016-02-16 Thread Tara Kerin
Hi,

I seem to be having the same problem Garrett (below) had in 2009.
However, I do not have functions named try written in my active code.
In fact, I don't have any of my own functions written at all yet.  I
did just install version 3.2.1 today, and the errors started after
that.  Please advise!

Thank you,

Tara Kerin

An example from my GUI is below:

[Workspace restored from /Users/tarakerin/.RData]
[History restored from /Users/tarakerin/.Rapp.history]

Error in try(gsub("\\s+", " ", paste(capture.output(print(args(library))),  :
  unused argument (silent = TRUE)
> library()



On 7/13/2009 12:35 PM, Garrett Grolemund wrote:
>* Whenever I type a parenthesis immediately following a word (as if I'm
*>* entering a function) R displays the following error
*> >* Error in try(gsub("\\s+", " ", paste(capture.output(print(args(try))),  :
*>*   unused argument(s) (silent = TRUE)
*>>* try(
*> >* The above is pasted from my R console. The error appears above the command
*>* because it appears immediately upon typing the parenthesis.  It does not
*>* wait until I try to execute the command.  This happens for every function.
*>* I can finish typing the function and execute it.  But these error messages
*>* make it difficult to debug my code.  In particular, if I have options(error
*>* = recover) set, the above crashes R.
*> >* I can avoid the error by typing the parentheses first and then moving the
*>* cursor back to type in the word. This error displays on the console whether
*>* I'm typing in the console or in an open document window.
*> >* I'm using the mac GUI for R.  The error only occurs on my Macbook (OS X
*>* 10.5.7), which I bought a few months ago.  It has occurred  every time I use
*>* R on this computer.  It has happened with R 2.8 and now R 2.91.
*> >* Any idea what may be going on?
*
Presumably this has something to do with command completion or argument
hints.  From the "silent = TRUE" error, and your example, I would guess
you have a function named try(), and the GUI is finding yours instead of
the one in the base package.

The GUI shouldn't do that, it should look in the right place, but as a
workaround, you could remove your function named "try", and call it
something else.

Duncan Murdoch

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


[R] Matrix-free fused lasso

2016-02-16 Thread Antony Lee
Hi,
I am looking for an implementation of the fused lasso that allows the
predictor matrix to be an "abstract" linear operator, namely the cumulative
sum (that is, (X.b)_i = sum(b_k, k=1..i)) (due to the size of the problem,
forming the entire matrix is unlikely to be a good approach).  Any pointers
would be welcome.
Thanks!
Antony

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.


Re: [R] filtering a data frame from a column of type integer

2016-02-16 Thread Stefano Sofia
Thank you
Stefano


Da: Huzefa Khalil [huzefa.kha...@umich.edu]
Inviato: luned� 15 febbraio 2016 17.52
A: Stefano Sofia
Cc: r-help@r-project.org
Oggetto: Re: [R] filtering a data frame from a column of type integer

This is because of the presence of NA's in your "station_RT" column. If you use 
which(), it will give you the correct result:

station_list <- df[which(df$station_RT==142), ]

best,
huzefa

On Mon, Feb 15, 2016 at 11:39 AM, Stefano Sofia 
mailto:stefano.so...@regione.marche.it>> wrote:
Dear R list users,
I am not able to perform a trivial filter of a data frame.
>From a txt file (df_file.txt) of this form:

sensor_RM station_RM place_RM municipality_RM Y_init_RM M_init_RM D_init_RM 
Y_fin_RM M_fin_RM D_fin_RM goes_on notes sensor_RT station_RT net Omogneneous
2000 1510 Candelara Pesaro 1951 1 1 1997 8 4 NO NA NA NA NA NO
2004 2230 Montemonaco Montemonaco 1951 1 1 2008 1 1 Y NA 1586 142 RT Y
2011 2240 Diga_di_Carassai Carassai 1951 1 1 2008 1 1 Y 
passata_in_RT_il_20140314_chiamata_Carassai 2976 708 RT Y
2012 2250 Monterubbiano Monterubbiano 1951 1 1 2008 1 1 NO NA NA NA NA NO
2014 1700 Fonte_Avellana Serra_S_Abbondio 1951 1 1 2005 1 4 Y NA 1206 109 RT Y
2016 1710 Pergola Pergola 1951 1 1 2008 1 7 Y NA 1198 108 RT Y

I load it with

df <- read.table(file="df_file.txt", header = TRUE, sep=" ", 
stringsAsFactors=FALSE)

There are 16 columns, some of them are integer and others are character.

My problem is that

station_list <- df[df$station_RT==142, ]

should give me only the second row, while I get

 sensor_RM station_RMplace_RM municipality_RM Y_init_RM M_init_RM
NA  NA NANANA
2 2004   2230 Montemonaco Montemonaco  1951 1
NA.1NA NANANA
 D_init_RM Y_fin_RM M_fin_RM D_fin_RM goes_on notes sensor_RT station_RT
NA  NA   NA   NA   NA  NA NA
21 200811   Y1586142
NA.1NA   NA   NA   NA  NA NA
  net Omogneneous
NA   
2  RT   Y
NA.1 

Why? I struggled for a long time trying to understand where is the bug.
Could you please help me in that?

Thank you
Stefano




AVVISO IMPORTANTE: Questo messaggio di posta elettronica pu� contenere 
informazioni confidenziali, pertanto � destinato solo a persone autorizzate 
alla ricezione. I messaggi di posta elettronica per i client di Regione Marche 
possono contenere informazioni confidenziali e con privilegi legali. Se non si 
� il destinatario specificato, non leggere, copiare, inoltrare o archiviare 
questo messaggio. Se si � ricevuto questo messaggio per errore, inoltrarlo al 
mittente ed eliminarlo completamente dal sistema del proprio computer. Ai sensi 
dell�art. 6 della DGR n. 1394/2008 si segnala che, in caso di necessit� ed 
urgenza, la risposta al presente messaggio di posta elettronica pu� essere 
visionata da persone estranee al destinatario.
IMPORTANT NOTICE: This e-mail message is intended to be received only by 
persons entitled to receive the confidential information it may contain. E-mail 
messages to clients of Regione Marche may contain information that is 
confidential and legally privileged. Please do not read, copy, forward, or 
store this message unless you are an intended recipient of it. If you have 
received this message in error, please forward it to the sender and delete it 
completely from your computer system.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To 
UNSUBSCRIBE and more, see
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.




AVVISO IMPORTANTE: Questo messaggio di posta elettronica pu� contenere 
informazioni confidenziali, pertanto � destinato solo a persone autorizzate 
alla ricezione. I messaggi di posta elettronica per i client di Regione Marche 
possono contenere informazioni confidenziali e con privilegi legali. Se non si 
� il destinatario specificato, non leggere, copiare, inoltrare o archiviare 
questo messaggio. Se si � ricevuto questo messaggio per errore, inoltrarlo al 
mittente ed eliminarlo completamente dal sistema del proprio computer. Ai sensi 
dell�art. 6 della DGR n. 1394/2008 si segnala che, in caso di necessit� ed 
urgenza, la risposta al presente messaggio di posta elettronica pu� essere 
visionata da persone estranee al destinatario.
IMPORTANT NOTICE: This e-mail message is intended to be received only by 
persons entitled to receive the confidential information it may contain. E-mail 
messages to clients of Regione Marche may contain information that is 
co