Re: [R] How a clustering algorithm in R can end up with negative silhouette values?

2016-02-22 Thread Martin Maechler
> ABABAEI, Behnam 
> on Mon, 22 Feb 2016 16:15:32 + writes:

> Thank you Martin.
> I finally came up with this idea: use clara with 100 samples of the size 
of 1000, then use the clusters as initial runs for kmeans. I think this 
combines the advantages of clara and kmeans. It gives more distinct clusters 
than kmeans alone, less time required compared to kmeans alone, and no need for 
large samples for clara, which take too long to process.

> Yet I cannot prove which one is better. Clara alone, or that combination 
method?! Do you have any suggestion?

[Replying to the mailing list, this should have been kept there]

Just a gut feeling:

Clara alone will be simpler and faster, and I cannot see that
extra kmeans iterations would in general be beneficial.

As I said earlier in this thread, I *would* strongly consider using
rngR = TRUE  and more than one (random) run so you get a feeling
about the influence of the random sample at start.
In addition, from the several runs, you could keep the best one.

Martin

> Best,

> Behnam



> On Mon, Feb 22, 2016 at 8:09 AM -0800, "Martin Maechler" 
> wrote:

> Martin Maechler 
> on Mon, 22 Feb 2016 16:48:39 +0100 writes:

> Sarah Goslee 
> on Fri, 19 Feb 2016 15:22:22 -0500 writes:

>>> Ah, my guess about the confusion was wrong, then. You're
>>> misunderstanding silhouette() instead.

 From ?silhouette:

>>> Observations with a large s(i) (almost 1) are very
>>> well clustered, a small s(i) (around 0) means that the
>>> observation lies between two clusters, and observations
>>> with a negative s(i) are probably placed in the wrong
>>> cluster.


>>> In more detail, they're looking at different things.
>>> clara() assigns each point to a cluster based on the
>>> distance to the nearest medoid.

>>> silhouette() does something different: instead of
>>> comparing the distances to the closest medoid and the next
>>> closest medoid, which is what you seem to be assuming,
>>> silhouette() looks at the mean distance to ALL other
>>> points assigned to that cluster, vs the mean distance to
>>> all points in other clusters. The distance to the medoid
>>> is irrelevant, except as it is one of the points in that
>>> cluster.

>>> So a negative silhouette value is entirely possible, and
>>> means that the cluster produced doesn't represent the
>>> dataset very well.

>> Indeed ... and this extends to pam(), even; as you say above,
>> " silhouette() does something different " :

>> If your look at the plots of

>> example(silhouette)

>> where the silhouettes of   pam(ruspini, k = k')  ,  k' = 2,..,6
>> are displayed, or if you directly look at

>> plot( silhouette(ruspini, k = 6) )

> oops... that should have been

> plot( silhouette(pam(ruspini, k = 6)) )

>> you will notice that pam() itself can easily lead to negative
>> silhouette values.

>> Martin Maechler  [  == maintainer("cluster")  ]



>>> On Fri, Feb 19, 2016 at 3:04 PM, ABABAEI, Behnam
>>>  wrote:
 Sarah, sorry for taking up your time.
 
 I totally agree with you about how it works. But please
 let's take a look at this part of the description:
 
 "Once k representative objects have been selected from
 the sub-dataset, each observation of the entire dataset
 is assigned to the nearest medoid. The mean (equivalent
 to the sum) of the dissimilarities of the observations to
 their closest medoid is used as a measure of the quality
 of the clustering. The sub-dataset for which the mean (or
 sum) is minimal, is retained. A further analysis is
 carried out on the final partition."
 
 It says each observation is finally assigned to the
 closest medoid. The whole clustering process may be
 imperfect in terms of isolation of clusters, but each
 observation is already assigned to the closest one and
 according to the silhouette formula, the silhouette value
 cannot be negative, as a must be always less than b.
 
 Regards, Behnam.
 
  From: Sarah
 Goslee  Sent: 19 February 2016
 20:58 To: ABABAEI, Behnam Cc: r-help@r-project.org
 Subject: Re: [R] How a clustering algorithm in R can end
 up with negative silhouette values?
 
 You need to think more carefully about the details of the
 clara() method.
 
 The algorithm draws repeated samples of sampsize from the
 larger dataset, as specified by the arguments to the

Re: [R] How to merge two tables

2016-02-22 Thread Jim Lemon
Hi Xiyan,
It looks like your tables have different numbers of cases. There are:

66 DEAD FEMALES in "cross"
56 DEAD FEMALES in "age"

48 NON-DEAD FEMALES in "cross"
58 NON-DEAD FEMALES in "age"

and so on. Perhaps there is some mistake with the counts. If this is the
problem you could expand the counts to individual lines in a merged data
frame using the sex and death information.

Jim

On Tue, Feb 23, 2016 at 5:46 AM, Xiyan Lon  wrote:

> Dear all,
> I am currently studying categorical data analysis, if I have two tables:
>
> R> cross
>   sex cross death count
> 1  FEMALE   WEF   YES26
> 2MALE   WEF   YES14
> 3  FEMALE   OGG   YES32
> 4MALE   OGG   YES43
> 5  FEMALE   TGA   YES 8
> 6MALE   TGA   YES10
> 7  FEMALE   WEFNO 6
> 8MALE   WEFNO 7
> 9  FEMALE   OGGNO26
> 10   MALE   OGGNO12
> 11 FEMALE   TGANO16
> 12   MALE   TGANO26
>
> R> age
>  sex age death count
> 1 FEMALE 17Y   YES16
> 2   MALE 17Y   YES 4
> 3 FEMALE 18Y   YES40
> 4   MALE 18Y   YES51
> 5 FEMALE 17YNO32
> 6   MALE 17YNO42
> 7 FEMALE 18YNO26
> 8   MALE 18YNO15
>
> - How to merge two tables.
> - How to expand both tables such as:
>
> sex age cross death
> FEMALE 17Y WEF YES
> ...
> FEMALE 18Y TGA NO
>
>
> Warm regards,
> Xiyan Lon
>
> This email has been sent from a virus-free computer protected by Avast.
> www.avast.com 
> <#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> [[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] Password-Shiny

2016-02-22 Thread Venky
Hi R users,

Please anyone help me how to create password access in shiny


Thanks and Regards
Venkatesan

[[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] Fwd: Shiny-Wordcloud

2016-02-22 Thread Venky
Hi R users,

I need Shiny *server and UI* code for creating Uni gram,Bi gram,and Trig
ram.
 for Word cloud from my desktop data.

I gone through this link: http://shiny.rstudio.com/gallery/word-cloud.html

It contains the source data from some where, but i need to use these word
cloud for my *DESKTOP* data

in this example (http://shiny.rstudio.com/gallery/word-cloud.html)  *"A mid
Summer night dreams",The merchant of Venice "* is drop down

In that drop-down i need to set my own Desktop file (csv) variable to show
the word cloud.

*For example*

column  1 column 2   column
3

what are you?   am finei am from Chennai
Who are you?   Thanking you   my name is venky
bye take carei will do thatplease give me


I want to create column 1 word cloud instead of *A mid Summer night
dreams",*
and column 2 word cloud  instead of* The merchant of Venice from the * (
http://shiny.rstudio.com/gallery/word-cloud.html)

I need to create word cloud for separate,separate columns

Please help me to figure out this one




Thanks and Regards
Venkatesan

[[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] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch

On 22/02/2016 6:19 PM, Santosh wrote:

Sorry.. I forgot to mention that I wanted it be published in MS Word,
because it goes into a Report this is prepared using MS Word.


I can't help you with that.



Hence,the above effort.. yes, it's a lot easier to send it to Latex..

I was also wondering if it is possible to add "\hline" separating the
categories in a table..

Using tabular, I get this:

\begin{tabular}{l}
\hline
"Name"  & "Value1" & \multicolumn{1}{c}{"Value2"} \\
\hline
\nopagebreak A1  &   0.06 &   1.2 \\
\nopagebreak A5  &   0.62 &   8.9 \\
\nopagebreak A6  &   0.48 &   4.2 \\
\rule{0pt}{1.7\normalbaselineskip}A2  &   1.50 &   1.27 \\
\nopagebreak A7  &   0.11 &   4.3 \\
\nopagebreak A3  &   0.01 &   3.1 \\
\rule{0pt}{1.7\normalbaselineskip}A4  &   2.19 &   1.0 \\
\nopagebreak B1.  &  0.03 &   2.0 \\
\nopagebreak B2.  &  0.011 &  1.8 \\
\rule{0pt}{1.7\normalbaselineskip}B3  &  0.10 &  2.7 \\
\nopagebreak B4.  &  0.02 &   1.6 \\
\nopagebreak C1.  &  0.01 &   1.1 \\
\hline
\end{tabular}

But, I want in this way.. (with horizontal lines and customized text
inserted at the beginning of a group..



If you wanted LaTeX output, you could do this like the example at the 
end of section 2.1.5 in the vignette.  (You might want to combine that 
with subsetting as in section 3.3.)


Duncan Murdoch


\begin{tabular}{l}
\hline
"Name"  & "Value1" & \multicolumn{1}{c}{"Value2"} \\
\hline
\multicolumn{5}{l}{\textbf{Hardened}}\\
\hline
\nopagebreak A1  &   0.06 &   1.2 \\
\nopagebreak \tA5  &   0.62 &   8.9 \\
\nopagebreak \tA6  &   0.48 &   4.2 \\
\rule{0pt}{1.7\normalbaselineskip}A2  &   1.50 &   1.27 \\
\nopagebreak \tA7  &   0.11 &   4.3 \\
\nopagebreak \tA3  &   0.01 &   3.1 \\
\rule{0pt}{1.7\normalbaselineskip}A4  &   2.19 &   1.0 \\
\hline
\multicolumn{3}{l}{\textbf{Pulverized}}\\
\hline
\nopagebreak B1.  &  0.03 &   2.0 \\
\nopagebreak B2.  &  0.011 &  1.8 \\
\rule{0pt}{1.7\normalbaselineskip}B3  &  0.10 &  2.7 \\
\nopagebreak B4.  &  0.02 &   1.6 \\
\hline
\multicolumn{3}{l}{\textbf{Molten}}\\
\hline
\nopagebreak C1.  &  0.01 &   1.1 \\
\hline
\end{tabular}

Thanks so much for your help!
Santosh

On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch 
wrote:


On 22/02/2016 3:46 PM, Santosh wrote:


Just figured out..

as.data.frame(as.matrix(),stringsAsFactors=F)

could work! :)



Why do you want to produce Markdown output?  the tables package (lowercase
t!) can produce output in either LaTeX or HTML.  Just tell knitr to leave
the output alone, e.g. for PDF output

```{r results="asis"}
require(tables)
tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
latex(tab)
```

or for HTML output

```{r results="asis"}
require(tables)
tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
(Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
html(tab)
```


Duncan Murdoch




On Mon, Feb 22, 2016 at 12:17 PM, Santosh  wrote:

Dear Rxperts..

I am able to generate tables using Tables R package..
However, when I have been unsuccessful in using kable (from knitr
package)
to generate the table in R markdown script..

It's because the output generated by "tabular" in Tables package is of
class "tabular". The kable function in knitr package accepts data.frame.

Is there a way to convert the tabular class objects into data.frame
   objects?

Or is there a way that kable can accept "tabular" class object?


Thanks so much..
Santosh



 [[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] majority guessing

2016-02-22 Thread Alnazer Elbedairy
dear there
what the steps I can find the knn by using majority guessing.
thanks.

[[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] FD package

2016-02-22 Thread Fabio Monteiro
Im sorry for everything.

I didnt mean to make you loose your time, its just im really new at r and
i'm still trying to understand some things. plus my english is not great :/

I'm really sorry.

My problem is solved, thank you for your help.

Kind regards

Fábio Monteiro

2016-02-22 19:54 GMT+00:00 Jeff Newmiller :

> "data" is the name of a function in base R. It is not a good idea to use
> that as the name of an actual data object (to which the "$" operator is
> being applied here). It is not clear from what you have provided what
> variable names you are working with... you are not communicating yet using
> reproducible examples, so you are depending on our psychic powers to fill
> in the gaps, which is not likely to work reliably. I suspect that Stephen
> used the generic term "data" since he did not know what variable name you
> were actually using.
>
>
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>
>
> On Mon, 22 Feb 2016, Fabio Monteiro wrote:
>
> hist(data$FRic)
>>>
>> Error in data$FRic : object of type 'closure' is not subsettable
>>
>> 2016-02-22 14:10 GMT+00:00 stephen sefick :
>>
>> Please see ?dput. What you provided is not a minimal, reproducible example
>>> (i.e., there is no R code).
>>>
>>> What kind of plot are you trying to plot? hist(data$FRic) will plot your
>>> data. I guess we need more information to be helpful.
>>>
>>>
>>> On Mon, Feb 22, 2016 at 8:03 AM, Fabio Monteiro <
>>> fabio.monteiro1...@gmail.com> wrote:
>>>
>>> This is the output.

 I want to plot, for example FRic

 $nbsp
  com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
 com13 com14 com15 com16
172118121520161218151816
  10111720
 com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
 com29 com30 com31 com32
 91311101115121618181119
  12131312
 com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
 com45 com46 com47 com48
151115 8 71210 912151313
  15131016
 com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
 com61 com62 com63 com64
141214131413151311121613
   9 81115
 com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
 com77 com78 com79 com80
131813151011121114 81012
  11121413
 com81 com82
 912

 $sing.sp
  com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
 com13 com14 com15 com16
172118121520161218151816
  10111720
 com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
 com29 com30 com31 com32
 91311101115121618181119
  12131312
 com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
 com45 com46 com47 com48
141115 8 71210 912151313
  15131016
 com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
 com61 com62 com63 com64
141213131413151311121613
   9 81115
 com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
 com77 com78 com79 com80
131713151011121114 81012
  11121413
 com81 com82
 912

 $FRic
 com1 com2 com3 com4 com5
 com6 com7
 3.669752e-04 6.898164e-04 6.893918e-04 3.935451e-05 1.436140e-04
 1.012949e-03 2.934536e-04
 com8 com9com10com11com12
  com13com14
 1.001556e-04 6.425547e-04 1.740235e-04 5.561802e-04 2.964362e-04
 1.480860e-05 1.060512e-04
com15com16com17com18com19
  com20com21
 4.121157e-04 5.346433e-04 1.108007e-06 5.726895e-05 8.593435e-06
 1.452446e-05 1.855957e-05
com22com23com24com25com26
  com27com28
 2.128971e-04 8.438329e-05 3.216279e-04 2.529525e-04 4.980317e-04
 3.111325e-05 6.290088e-04
com29com30com31com32com33
  com34com35
 3.559802e-05 5.907167e-05 8.906878e-05 2.510168e-05 1.929088e-04
 1.234508e-04 2.784301e-04
com36com37com38com39com40
  com41com42
 1.480560e-08 1.411752e-06 5.576549e-05 2.445569e-05 6.167242e-06
 

Re: [R] Tables, knitr markdown

2016-02-22 Thread Gergely Daróczi
On Mon, Feb 22, 2016 at 3:36 PM, Santosh  wrote:
> Thanks, Gergely.. I wonder if it allows to insert lines etc as sent in
> previous email which might need some additional preprocessing..

AFAIK that's not possible, as pandoc's markdown has no markup to add
horizontal/vertical lines in tables as per
http://pandoc.org/README.html#tables
But a possible workaround is to generate HTML and load that in Word/OpenOffice.

>
> Best,
> Santosh
>
>
> On Mon, Feb 22, 2016 at 3:27 PM, Gergely Daróczi  wrote:
>>
>> On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch
>>  wrote:
>> >
>> > On 22/02/2016 3:46 PM, Santosh wrote:
>> >>
>> >> Just figured out..
>> >>
>> >> as.data.frame(as.matrix(),stringsAsFactors=F)
>> >>
>> >> could work! :)
>> >
>> >
>> > Why do you want to produce Markdown output?  the tables package
>> > (lowercase t!) can produce output in either LaTeX or HTML.  Just tell knitr
>> > to leave the output alone, e.g. for PDF output
>> >
>> > ```{r results="asis"}
>> > require(tables)
>> > tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
>> >  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
>> > latex(tab)
>> > ```
>> >
>> > or for HTML output
>> >
>> > ```{r results="asis"}
>> > require(tables)
>> > tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
>> > (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
>> > html(tab)
>> > ```
>>
>>
>> In case of you would rather generate markdown instead of HTML/LaTeX to
>> be independent from the resulting output document format, you can give
>> a try to the "pander" package, which can transform quite many R object
>> types into markdown, eg:
>>
>> #> library(tables)
>> #> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
>> #+  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
>> #> pander::pander(tab)
>>
>> 
>>  \\Sepal.Length\\Sepal.Width\\
>>   Species n meansd   meansd
>>     --- 
>>   *setosa*505.01   0.35  3.43   0.38
>>
>> *versicolor*  505.94   0.52  2.77   0.31
>>
>> *virginica*   506.59   0.64  2.97   0.32
>>
>>*All* 1505.84   0.83  3.06   0.44
>> 
>>
>> Please find more details at
>> http://rapporter.github.io/pander/#generic-pander-method, or the
>> knitr+pander vignette at
>> https://cran.rstudio.com/web/packages/pander/vignettes/knitr.html
>>
>> Best,
>> Gergely
>>
>>
>> >
>> >
>> >
>> >
>> > Duncan Murdoch
>> >
>> >
>> >>
>> >>
>> >> On Mon, Feb 22, 2016 at 12:17 PM, Santosh 
>> >> wrote:
>> >>
>> >>> Dear Rxperts..
>> >>> I am able to generate tables using Tables R package..
>> >>> However, when I have been unsuccessful in using kable (from knitr
>> >>> package)
>> >>> to generate the table in R markdown script..
>> >>>
>> >>> It's because the output generated by "tabular" in Tables package is of
>> >>> class "tabular". The kable function in knitr package accepts
>> >>> data.frame.
>> >>>
>> >>> Is there a way to convert the tabular class objects into data.frame
>> >>>   objects?
>> >>>
>> >>> Or is there a way that kable can accept "tabular" class object?
>> >>>
>> >>>
>> >>> Thanks so much..
>> >>> Santosh
>> >>>
>> >>
>> >> [[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-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] Tables, knitr markdown

2016-02-22 Thread Santosh
Thanks, Gergely.. I wonder if it allows to insert lines etc as sent in
previous email which might need some additional preprocessing..

Best,
Santosh

On Mon, Feb 22, 2016 at 3:27 PM, Gergely Daróczi  wrote:

> On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch
>  wrote:
> >
> > On 22/02/2016 3:46 PM, Santosh wrote:
> >>
> >> Just figured out..
> >>
> >> as.data.frame(as.matrix(),stringsAsFactors=F)
> >>
> >> could work! :)
> >
> >
> > Why do you want to produce Markdown output?  the tables package
> (lowercase t!) can produce output in either LaTeX or HTML.  Just tell knitr
> to leave the output alone, e.g. for PDF output
> >
> > ```{r results="asis"}
> > require(tables)
> > tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
> >  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> > latex(tab)
> > ```
> >
> > or for HTML output
> >
> > ```{r results="asis"}
> > require(tables)
> > tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
> > (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> > html(tab)
> > ```
>
>
> In case of you would rather generate markdown instead of HTML/LaTeX to
> be independent from the resulting output document format, you can give
> a try to the "pander" package, which can transform quite many R object
> types into markdown, eg:
>
> #> library(tables)
> #> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
> #+  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> #> pander::pander(tab)
>
> 
>  \\Sepal.Length\\Sepal.Width\\
>   Species n meansd   meansd
>     --- 
>   *setosa*505.01   0.35  3.43   0.38
>
> *versicolor*  505.94   0.52  2.77   0.31
>
> *virginica*   506.59   0.64  2.97   0.32
>
>*All* 1505.84   0.83  3.06   0.44
> 
>
> Please find more details at
> http://rapporter.github.io/pander/#generic-pander-method, or the
> knitr+pander vignette at
> https://cran.rstudio.com/web/packages/pander/vignettes/knitr.html
>
> Best,
> Gergely
>
>
> >
> >
> >
> >
> > Duncan Murdoch
> >
> >
> >>
> >>
> >> On Mon, Feb 22, 2016 at 12:17 PM, Santosh 
> wrote:
> >>
> >>> Dear Rxperts..
> >>> I am able to generate tables using Tables R package..
> >>> However, when I have been unsuccessful in using kable (from knitr
> package)
> >>> to generate the table in R markdown script..
> >>>
> >>> It's because the output generated by "tabular" in Tables package is of
> >>> class "tabular". The kable function in knitr package accepts
> data.frame.
> >>>
> >>> Is there a way to convert the tabular class objects into data.frame
> >>>   objects?
> >>>
> >>> Or is there a way that kable can accept "tabular" class object?
> >>>
> >>>
> >>> Thanks so much..
> >>> Santosh
> >>>
> >>
> >> [[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.
>

[[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] Tables, knitr markdown

2016-02-22 Thread Gergely Daróczi
On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch
 wrote:
>
> On 22/02/2016 3:46 PM, Santosh wrote:
>>
>> Just figured out..
>>
>> as.data.frame(as.matrix(),stringsAsFactors=F)
>>
>> could work! :)
>
>
> Why do you want to produce Markdown output?  the tables package (lowercase 
> t!) can produce output in either LaTeX or HTML.  Just tell knitr to leave the 
> output alone, e.g. for PDF output
>
> ```{r results="asis"}
> require(tables)
> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
>  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> latex(tab)
> ```
>
> or for HTML output
>
> ```{r results="asis"}
> require(tables)
> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
> (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> html(tab)
> ```


In case of you would rather generate markdown instead of HTML/LaTeX to
be independent from the resulting output document format, you can give
a try to the "pander" package, which can transform quite many R object
types into markdown, eg:

#> library(tables)
#> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
#+  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
#> pander::pander(tab)


 \\Sepal.Length\\Sepal.Width\\
  Species n meansd   meansd
    --- 
  *setosa*505.01   0.35  3.43   0.38

*versicolor*  505.94   0.52  2.77   0.31

*virginica*   506.59   0.64  2.97   0.32

   *All* 1505.84   0.83  3.06   0.44


Please find more details at
http://rapporter.github.io/pander/#generic-pander-method, or the
knitr+pander vignette at
https://cran.rstudio.com/web/packages/pander/vignettes/knitr.html

Best,
Gergely


>
>
>
>
> Duncan Murdoch
>
>
>>
>>
>> On Mon, Feb 22, 2016 at 12:17 PM, Santosh  wrote:
>>
>>> Dear Rxperts..
>>> I am able to generate tables using Tables R package..
>>> However, when I have been unsuccessful in using kable (from knitr package)
>>> to generate the table in R markdown script..
>>>
>>> It's because the output generated by "tabular" in Tables package is of
>>> class "tabular". The kable function in knitr package accepts data.frame.
>>>
>>> Is there a way to convert the tabular class objects into data.frame
>>>   objects?
>>>
>>> Or is there a way that kable can accept "tabular" class object?
>>>
>>>
>>> Thanks so much..
>>> Santosh
>>>
>>
>> [[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-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] Tables, knitr markdown

2016-02-22 Thread Santosh
Sorry.. I forgot to mention that I wanted it be published in MS Word,
because it goes into a Report this is prepared using MS Word.

Hence,the above effort.. yes, it's a lot easier to send it to Latex..

I was also wondering if it is possible to add "\hline" separating the
categories in a table..

Using tabular, I get this:

\begin{tabular}{l}
\hline
"Name"  & "Value1" & \multicolumn{1}{c}{"Value2"} \\
\hline
\nopagebreak A1  &   0.06 &   1.2 \\
\nopagebreak A5  &   0.62 &   8.9 \\
\nopagebreak A6  &   0.48 &   4.2 \\
\rule{0pt}{1.7\normalbaselineskip}A2  &   1.50 &   1.27 \\
\nopagebreak A7  &   0.11 &   4.3 \\
\nopagebreak A3  &   0.01 &   3.1 \\
\rule{0pt}{1.7\normalbaselineskip}A4  &   2.19 &   1.0 \\
\nopagebreak B1.  &  0.03 &   2.0 \\
\nopagebreak B2.  &  0.011 &  1.8 \\
\rule{0pt}{1.7\normalbaselineskip}B3  &  0.10 &  2.7 \\
\nopagebreak B4.  &  0.02 &   1.6 \\
\nopagebreak C1.  &  0.01 &   1.1 \\
\hline
\end{tabular}

But, I want in this way.. (with horizontal lines and customized text
inserted at the beginning of a group..

\begin{tabular}{l}
\hline
"Name"  & "Value1" & \multicolumn{1}{c}{"Value2"} \\
\hline
\multicolumn{5}{l}{\textbf{Hardened}}\\
\hline
\nopagebreak A1  &   0.06 &   1.2 \\
\nopagebreak \tA5  &   0.62 &   8.9 \\
\nopagebreak \tA6  &   0.48 &   4.2 \\
\rule{0pt}{1.7\normalbaselineskip}A2  &   1.50 &   1.27 \\
\nopagebreak \tA7  &   0.11 &   4.3 \\
\nopagebreak \tA3  &   0.01 &   3.1 \\
\rule{0pt}{1.7\normalbaselineskip}A4  &   2.19 &   1.0 \\
\hline
\multicolumn{3}{l}{\textbf{Pulverized}}\\
\hline
\nopagebreak B1.  &  0.03 &   2.0 \\
\nopagebreak B2.  &  0.011 &  1.8 \\
\rule{0pt}{1.7\normalbaselineskip}B3  &  0.10 &  2.7 \\
\nopagebreak B4.  &  0.02 &   1.6 \\
\hline
\multicolumn{3}{l}{\textbf{Molten}}\\
\hline
\nopagebreak C1.  &  0.01 &   1.1 \\
\hline
\end{tabular}

Thanks so much for your help!
Santosh

On Mon, Feb 22, 2016 at 1:55 PM, Duncan Murdoch 
wrote:

> On 22/02/2016 3:46 PM, Santosh wrote:
>
>> Just figured out..
>>
>> as.data.frame(as.matrix(),stringsAsFactors=F)
>>
>> could work! :)
>>
>
> Why do you want to produce Markdown output?  the tables package (lowercase
> t!) can produce output in either LaTeX or HTML.  Just tell knitr to leave
> the output alone, e.g. for PDF output
>
> ```{r results="asis"}
> require(tables)
> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
>  (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> latex(tab)
> ```
>
> or for HTML output
>
> ```{r results="asis"}
> require(tables)
> tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
> (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
> html(tab)
> ```
>
>
> Duncan Murdoch
>
>
>>
>> On Mon, Feb 22, 2016 at 12:17 PM, Santosh  wrote:
>>
>> Dear Rxperts..
>>> I am able to generate tables using Tables R package..
>>> However, when I have been unsuccessful in using kable (from knitr
>>> package)
>>> to generate the table in R markdown script..
>>>
>>> It's because the output generated by "tabular" in Tables package is of
>>> class "tabular". The kable function in knitr package accepts data.frame.
>>>
>>> Is there a way to convert the tabular class objects into data.frame
>>>   objects?
>>>
>>> Or is there a way that kable can accept "tabular" class object?
>>>
>>>
>>> Thanks so much..
>>> Santosh
>>>
>>>
>> [[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-es] Rmarkdown ejemplos

2016-02-22 Thread Javier Marcuzzi
Estimados

Rmarkdown for creating PDF-files: examples, es un título que está en un grupo 
de LinkedIn (https://www.linkedin.com/grp/post/77616-6103568736294289411).

En varias oportunidades se hablo en la lista sobre Rmarkdown, si les sirven los 
ejemplos pueden visitar directamente el siguiente link.

https://github.com/HanOostdijk/rmd_pdf_examples

Los ejemplos para mí son fundamentales, aprendo todos los días a partir de 
ellos.

Javier Rubén Marcuzzi


[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] curso R en Sevilla

2016-02-22 Thread Emilio L. Cano
Hola Francisco,

Si quieres darle difusión a través de la Comunidad R-Hispano puedes
hacerlo, mira aquí:

http://r-es.org/formacion/

Un saludo,
Emilio L. Cano


2016-02-22 23:15 GMT+01:00 Francisco Rodriguez Sanchez <
f.rodriguez.s...@gmail.com>:

> Hola,
>
> Por si es de interés, envío información de un curso de análisis y
> visualización de datos con R, la primera semana de Marzo en Sevilla:
>
>
> https://www.centrodeestudiosandaluces.es/index.php?mod=cea_actividades=ACT047/16=1229=474=2016=18009
>
> Saludos
>
>
> --
> Dr Francisco Rodriguez-Sanchez
> Integrative Ecology Group
> Estacion Biologica de Doñana - CSIC
> Avda. Americo Vespucio s/n
> 41092 Sevilla (Spain)
> http://bit.ly/frod_san
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



-- 

*Emilio López Cano*
Data Scientist

Mobile: +34 665 676 225
skype: emilopezcano
twitter: @emilopezcano
http://emilio.lcano.com

*Affiliations / Collaborations:*
Rey Juan Carlos University
University of Castilla-La Mancha
Comunidad R-Hispano
AEC - AENOR - SKITES - talentyon

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Tables, knitr markdown

2016-02-22 Thread Duncan Murdoch

On 22/02/2016 3:46 PM, Santosh wrote:

Just figured out..

as.data.frame(as.matrix(),stringsAsFactors=F)

could work! :)


Why do you want to produce Markdown output?  the tables package 
(lowercase t!) can produce output in either LaTeX or HTML.  Just tell 
knitr to leave the output alone, e.g. for PDF output


```{r results="asis"}
require(tables)
tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
 (Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
latex(tab)
```

or for HTML output

```{r results="asis"}
require(tables)
tab <- tabular( (Species + 1) ~ (n=1) + Format(digits=2)*
(Sepal.Length + Sepal.Width)*(mean + sd), data=iris )
html(tab)
```


Duncan Murdoch




On Mon, Feb 22, 2016 at 12:17 PM, Santosh  wrote:


Dear Rxperts..
I am able to generate tables using Tables R package..
However, when I have been unsuccessful in using kable (from knitr package)
to generate the table in R markdown script..

It's because the output generated by "tabular" in Tables package is of
class "tabular". The kable function in knitr package accepts data.frame.

Is there a way to convert the tabular class objects into data.frame
  objects?

Or is there a way that kable can accept "tabular" class object?


Thanks so much..
Santosh



[[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] Tables, knitr markdown

2016-02-22 Thread Santosh
Just figured out..

as.data.frame(as.matrix(),stringsAsFactors=F)

could work! :)


On Mon, Feb 22, 2016 at 12:17 PM, Santosh  wrote:

> Dear Rxperts..
> I am able to generate tables using Tables R package..
> However, when I have been unsuccessful in using kable (from knitr package)
> to generate the table in R markdown script..
>
> It's because the output generated by "tabular" in Tables package is of
> class "tabular". The kable function in knitr package accepts data.frame.
>
> Is there a way to convert the tabular class objects into data.frame
>  objects?
>
> Or is there a way that kable can accept "tabular" class object?
>
>
> Thanks so much..
> Santosh
>

[[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] lm-step: use train-data model to validate test-data

2016-02-22 Thread Amoy Yang via R-help
 I have model-data named as: model that is split as model.T(train) and 
model.V(test or validation). The least square model (from lm to step) is built 
withmodel.T and I like to see how model.T is robust by comparing predicted 
model.V toactual model.V. How do I get score for model.V based on model built 
on model.T? The code highlighted below does not get what I expected.Please 
advise! Thanks!
  # score the model 
  score.T <- data.frame(predict(step, model.T))  # get predicted score for 
train data
  score.V <- data.frame(predict(step, model.V))  # for test data but seems 
incorrect
  # get the actual values 
  actual.T <- data.frame(model.T$sales) 
  actual.V <- data.frame(model.V$sales)   # comparison for model.T
  comp.T=cbind(actual.T,round(score.T,digit=2))
  plot(comp.T)  # comparison for model.V (use Model.T to predict Model.V for 
true validation
  comp.V=cbind(actual.V,round(score.V,digit=2))
  plot(comp.V)
[[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] Tables, knitr markdown

2016-02-22 Thread Santosh
Dear Rxperts..
I am able to generate tables using Tables R package..
However, when I have been unsuccessful in using kable (from knitr package)
to generate the table in R markdown script..

It's because the output generated by "tabular" in Tables package is of
class "tabular". The kable function in knitr package accepts data.frame.

Is there a way to convert the tabular class objects into data.frame
 objects?

Or is there a way that kable can accept "tabular" class object?


Thanks so much..
Santosh

[[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] ReporteRs R package installation issues in R.3.2.3 (Windows)

2016-02-22 Thread Santosh
Thanks so much for your response.. Would try that!
Santosh

On Mon, Feb 22, 2016 at 12:45 AM, Uwe Ligges <
lig...@statistik.tu-dortmund.de> wrote:

> I guess you are using a 64 bit version of R for Windows but you have only
> a 32-bit installation of Java. Please install a 64-bit Java.
>
> Best,
> Uwe Ligges
>
>
>
> On 22.02.2016 09:35, Santosh wrote:
>
>> Dear Rxperts..
>>
>> I tried to install ReporteRs package..in R.3.2.3 (Windows)
>> Below are the error messages...
>>
>> install.packages("ReporteRs",dep=T)
>>>
>> trying URL '
>> http://cran.cnr.berkeley.edu/bin/windows/contrib/3.2/ReporteRs_0.8.2.zip'
>> Content type 'application/zip' length 947836 bytes (925 KB)
>> downloaded 925 KB
>>
>> package ‘ReporteRs’ successfully unpacked and MD5 sums checked
>>
>> The downloaded binary packages are in
>>
>>  C:\Users\santosh\AppData\Local\Temp\RtmpMlGfvG\downloaded_packages
>>
>> library(ReporteRs)
>>>
>> Loading required package: ReporteRsjars
>> Error : .onLoad failed in loadNamespace() for 'rJava', details:
>>call: fun(libname, pkgname)
>>error: No CurrentVersion entry in Software/JavaSoft registry! Try
>> re-installing Java and make sure R and Java have matching architectures.
>> Error: package ‘ReporteRsjars’ could not be loaded
>>
>> I tried to install ReporteRsJars..
>>
>>> install.packages("ReporteRsjars")
>>>
>> trying URL '
>>
>> http://cran.cnr.berkeley.edu/bin/windows/contrib/3.2/ReporteRsjars_0.0.2.zip
>> '
>> Content type 'application/zip' length 5502826 bytes (5.2 MB)
>> downloaded 5.2 MB
>>
>> package ‘ReporteRsjars’ successfully unpacked and MD5 sums checked
>>
>> The downloaded binary packages are in
>>  C:\Users\santoshAppData\Local\Temp\RtmpMlGfvG\downloaded_packages
>>
>>>
>>> library(ReporteRsjars)
>>>
>> Error : .onLoad failed in loadNamespace() for 'rJava', details:
>>call: fun(libname, pkgname)
>>error: No CurrentVersion entry in Software/JavaSoft registry! Try
>> re-installing Java and make sure R and Java have matching architectures.
>> Error: package or namespace load failed for ‘ReporteRsjars’
>>
>>>
>>>
>> rJava and and ReporteRsjars were having issues with loading even though
>> there were shown as successfully installed.
>>
>> Would appreciate your help/solution/ideas in this regard..
>>
>> Thanks much,
>> Santosh
>>
>> [[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] FD package

2016-02-22 Thread Jeff Newmiller
"data" is the name of a function in base R. It is not a good idea to use 
that as the name of an actual data object (to which the "$" operator is 
being applied here). It is not clear from what you have provided what 
variable names you are working with... you are not communicating yet using 
reproducible examples, so you are depending on our psychic powers to fill 
in the gaps, which is not likely to work reliably. I suspect that Stephen 
used the generic term "data" since he did not know what variable name you 
were actually using.


http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

On Mon, 22 Feb 2016, Fabio Monteiro wrote:


hist(data$FRic)

Error in data$FRic : object of type 'closure' is not subsettable

2016-02-22 14:10 GMT+00:00 stephen sefick :


Please see ?dput. What you provided is not a minimal, reproducible example
(i.e., there is no R code).

What kind of plot are you trying to plot? hist(data$FRic) will plot your
data. I guess we need more information to be helpful.


On Mon, Feb 22, 2016 at 8:03 AM, Fabio Monteiro <
fabio.monteiro1...@gmail.com> wrote:


This is the output.

I want to plot, for example FRic

$nbsp
 com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
com13 com14 com15 com16
   172118121520161218151816
 10111720
com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
com29 com30 com31 com32
91311101115121618181119
 12131312
com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
com45 com46 com47 com48
   151115 8 71210 912151313
 15131016
com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
com61 com62 com63 com64
   141214131413151311121613
  9 81115
com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
com77 com78 com79 com80
   131813151011121114 81012
 11121413
com81 com82
912

$sing.sp
 com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
com13 com14 com15 com16
   172118121520161218151816
 10111720
com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
com29 com30 com31 com32
91311101115121618181119
 12131312
com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
com45 com46 com47 com48
   141115 8 71210 912151313
 15131016
com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
com61 com62 com63 com64
   141213131413151311121613
  9 81115
com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
com77 com78 com79 com80
   131713151011121114 81012
 11121413
com81 com82
912

$FRic
com1 com2 com3 com4 com5
com6 com7
3.669752e-04 6.898164e-04 6.893918e-04 3.935451e-05 1.436140e-04
1.012949e-03 2.934536e-04
com8 com9com10com11com12
 com13com14
1.001556e-04 6.425547e-04 1.740235e-04 5.561802e-04 2.964362e-04
1.480860e-05 1.060512e-04
   com15com16com17com18com19
 com20com21
4.121157e-04 5.346433e-04 1.108007e-06 5.726895e-05 8.593435e-06
1.452446e-05 1.855957e-05
   com22com23com24com25com26
 com27com28
2.128971e-04 8.438329e-05 3.216279e-04 2.529525e-04 4.980317e-04
3.111325e-05 6.290088e-04
   com29com30com31com32com33
 com34com35
3.559802e-05 5.907167e-05 8.906878e-05 2.510168e-05 1.929088e-04
1.234508e-04 2.784301e-04
   com36com37com38com39com40
 com41com42
1.480560e-08 1.411752e-06 5.576549e-05 2.445569e-05 6.167242e-06
1.210002e-04 1.666034e-04
   com43com44com45com46com47
 com48com49
1.203484e-04 7.347513e-05 8.991003e-05 8.691148e-05 6.718789e-05
1.357136e-04 1.821851e-04
   com50com51com52com53com54
 com55com56
4.832203e-05 8.391627e-05 2.173971e-04 1.355160e-04 1.304425e-04
1.787888e-04 1.759204e-05
   com57com58com59com60com61
 com62com63
9.307474e-05 1.185857e-04 2.776166e-04 1.277143e-04 5.905299e-06
9.606009e-08 1.019480e-04
   com64com65com66com67com68
 com69com70
2.395355e-04 2.307081e-04 4.019309e-04 6.874506e-05 1.417622e-04
5.675463e-06 9.878848e-05
   com71com72com73com74com75
 

Re: [R] How to merge two tables

2016-02-22 Thread Jeff Newmiller
I can see no coherent way to merge these two tables. They do not appear to 
have consistent definitions for uniqueness of individual rows. Nor do they 
have consistent column definitions. If you think they do, you will need to 
be more clear in your question about how you want them to be merged.


As for expanding, you might try using something like

ageExpand <- age[ rep( seq_along( age[[1]] ), times=age[,"count"] ), 1:3 ]

On Tue, 23 Feb 2016, Xiyan Lon wrote:


Dear all,
I am currently studying categorical data analysis, if I have two tables:

R> cross
 sex cross death count
1  FEMALE   WEF   YES26
2MALE   WEF   YES14
3  FEMALE   OGG   YES32
4MALE   OGG   YES43
5  FEMALE   TGA   YES 8
6MALE   TGA   YES10
7  FEMALE   WEFNO 6
8MALE   WEFNO 7
9  FEMALE   OGGNO26
10   MALE   OGGNO12
11 FEMALE   TGANO16
12   MALE   TGANO26

R> age
sex age death count
1 FEMALE 17Y   YES16
2   MALE 17Y   YES 4
3 FEMALE 18Y   YES40
4   MALE 18Y   YES51
5 FEMALE 17YNO32
6   MALE 17YNO42
7 FEMALE 18YNO26
8   MALE 18YNO15

- How to merge two tables.
- How to expand both tables such as:

sex age cross death
FEMALE 17Y WEF YES
...
FEMALE 18Y TGA NO


Warm regards,
Xiyan Lon

This email has been sent from a virus-free computer protected by Avast.
www.avast.com 
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

[[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.



---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k

__
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] Grep Help

2016-02-22 Thread Boris Steipe
I see numerous backticks in your code, not quotes. "`" and "'" are not the 
same. Backticks are not string delimiters.
As for valid names: look at the help page for make.names().


HTH,
Boris



On Feb 22, 2016, at 1:32 PM, Burhan ul haq  wrote:

> Hi,
> 
> # 1) I have read in a CSV file
> 
> df = read.csv(file="GiftCards - v1.csv",stringsAsFactors=FALSE)
> head(df)
> str(df)
> 
> # 2) converted to a tbl_df
> df2 = tbl_df(df)
> 
> # 3) fixed the names to remove leading "X" character
> n = names(df2)
> n2 = gsub(pattern="^\\w","\\1",n)
> names(df2) = n2
> 
> # 4) somehow the col names are character strings, requiring me to use
> quotes:
> df2$`2006` instead of df2$2006 # ---> PROBLEM 1
> 
> 
> # 5) I need to remove the leading $ sign followed by spaces to extract
> values. The problem is # it could be a two or three digit number. I am able
> to retrieve two digits correctly, but miss # out on the leading third digit.
> df2$`2006`= gsub("^(.+)([0-9]{2,3}\\.[0-9]{2})","\\2",df2$`2006`) # -->
> Problem 2
> 
> # 6) dump for the data frame
> 
> df2 <-
> structure(list(`2006` = structure(c(3L, 2L, 1L), .Label = c("$
> 24.81",
> "$ 39.16", "$   146.20"), class = "factor"), `2007` = structure(c(3L,
> 2L, 1L), .Label = c("$   26.25", "$ 41.95", "$   156.24"
> ), class = "factor"), `2008` = structure(c(3L, 2L, 1L), .Label = c("$
> 24.92",
> "$ 40.54", "$   147.33"), class = "factor"), `2009` = structure(c(3L,
> 2L, 1L), .Label = c("$   23.63", "$ 39.80", "$   139.91"
> ), class = "factor"), `2010` = structure(c(3L, 2L, 1L), .Label = c("$
> 24.78",
> "$ 41.48", "$   145.61"), class = "factor"), `2011` = structure(c(3L,
> 2L, 1L), .Label = c("$   27.80", "$ 43.23", "$   155.43"
> ), class = "factor"), `2012` = structure(c(3L, 2L, 1L), .Label = c("$
> 28.79",
> "$ 43.75", "$   156.86"), class = "factor"), `2013` = structure(c(3L,
> 2L, 1L), .Label = c("$   29.80", "$ 45.16", "$   163.16"
> ), class = "factor")), .Names = c("2006", "2007", "2008", "2009",
> "2010", "2011", "2012", "2013"), class = c("tbl_df", "tbl", "data.frame"
> ), row.names = c(NA, -3L))
> 
> 
> 
> Thanks for the help
> 
> 
> Br /
> 
>   [[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] How to merge two tables

2016-02-22 Thread Xiyan Lon
Dear all,
I am currently studying categorical data analysis, if I have two tables:

R> cross
  sex cross death count
1  FEMALE   WEF   YES26
2MALE   WEF   YES14
3  FEMALE   OGG   YES32
4MALE   OGG   YES43
5  FEMALE   TGA   YES 8
6MALE   TGA   YES10
7  FEMALE   WEFNO 6
8MALE   WEFNO 7
9  FEMALE   OGGNO26
10   MALE   OGGNO12
11 FEMALE   TGANO16
12   MALE   TGANO26

R> age
 sex age death count
1 FEMALE 17Y   YES16
2   MALE 17Y   YES 4
3 FEMALE 18Y   YES40
4   MALE 18Y   YES51
5 FEMALE 17YNO32
6   MALE 17YNO42
7 FEMALE 18YNO26
8   MALE 18YNO15

- How to merge two tables.
- How to expand both tables such as:

sex age cross death
FEMALE 17Y WEF YES
...
FEMALE 18Y TGA NO


Warm regards,
Xiyan Lon

This email has been sent from a virus-free computer protected by Avast.
www.avast.com 
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

[[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] Grep Help

2016-02-22 Thread Burhan ul haq
Hi,

# 1) I have read in a CSV file

df = read.csv(file="GiftCards - v1.csv",stringsAsFactors=FALSE)
head(df)
str(df)

# 2) converted to a tbl_df
df2 = tbl_df(df)

# 3) fixed the names to remove leading "X" character
n = names(df2)
n2 = gsub(pattern="^\\w","\\1",n)
names(df2) = n2

# 4) somehow the col names are character strings, requiring me to use
quotes:
df2$`2006` instead of df2$2006 # ---> PROBLEM 1


# 5) I need to remove the leading $ sign followed by spaces to extract
values. The problem is # it could be a two or three digit number. I am able
to retrieve two digits correctly, but miss # out on the leading third digit.
df2$`2006`= gsub("^(.+)([0-9]{2,3}\\.[0-9]{2})","\\2",df2$`2006`) # -->
Problem 2

# 6) dump for the data frame

df2 <-
structure(list(`2006` = structure(c(3L, 2L, 1L), .Label = c("$
24.81",
"$ 39.16", "$   146.20"), class = "factor"), `2007` = structure(c(3L,
2L, 1L), .Label = c("$   26.25", "$ 41.95", "$   156.24"
), class = "factor"), `2008` = structure(c(3L, 2L, 1L), .Label = c("$
24.92",
"$ 40.54", "$   147.33"), class = "factor"), `2009` = structure(c(3L,
2L, 1L), .Label = c("$   23.63", "$ 39.80", "$   139.91"
), class = "factor"), `2010` = structure(c(3L, 2L, 1L), .Label = c("$
24.78",
"$ 41.48", "$   145.61"), class = "factor"), `2011` = structure(c(3L,
2L, 1L), .Label = c("$   27.80", "$ 43.23", "$   155.43"
), class = "factor"), `2012` = structure(c(3L, 2L, 1L), .Label = c("$
28.79",
"$ 43.75", "$   156.86"), class = "factor"), `2013` = structure(c(3L,
2L, 1L), .Label = c("$   29.80", "$ 45.16", "$   163.16"
), class = "factor")), .Names = c("2006", "2007", "2008", "2009",
"2010", "2011", "2012", "2013"), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -3L))



Thanks for the help


Br /

[[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] FD package

2016-02-22 Thread Fabio Monteiro
> hist(data$FRic)
Error in data$FRic : object of type 'closure' is not subsettable

2016-02-22 14:10 GMT+00:00 stephen sefick :

> Please see ?dput. What you provided is not a minimal, reproducible example
> (i.e., there is no R code).
>
> What kind of plot are you trying to plot? hist(data$FRic) will plot your
> data. I guess we need more information to be helpful.
>
>
> On Mon, Feb 22, 2016 at 8:03 AM, Fabio Monteiro <
> fabio.monteiro1...@gmail.com> wrote:
>
>> This is the output.
>>
>> I want to plot, for example FRic
>>
>> $nbsp
>>  com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
>> com13 com14 com15 com16
>>172118121520161218151816
>>  10111720
>> com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
>> com29 com30 com31 com32
>> 91311101115121618181119
>>  12131312
>> com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
>> com45 com46 com47 com48
>>151115 8 71210 912151313
>>  15131016
>> com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
>> com61 com62 com63 com64
>>141214131413151311121613
>>   9 81115
>> com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
>> com77 com78 com79 com80
>>131813151011121114 81012
>>  11121413
>> com81 com82
>> 912
>>
>> $sing.sp
>>  com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
>> com13 com14 com15 com16
>>172118121520161218151816
>>  10111720
>> com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
>> com29 com30 com31 com32
>> 91311101115121618181119
>>  12131312
>> com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
>> com45 com46 com47 com48
>>141115 8 71210 912151313
>>  15131016
>> com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
>> com61 com62 com63 com64
>>141213131413151311121613
>>   9 81115
>> com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
>> com77 com78 com79 com80
>>131713151011121114 81012
>>  11121413
>> com81 com82
>> 912
>>
>> $FRic
>> com1 com2 com3 com4 com5
>> com6 com7
>> 3.669752e-04 6.898164e-04 6.893918e-04 3.935451e-05 1.436140e-04
>> 1.012949e-03 2.934536e-04
>> com8 com9com10com11com12
>>  com13com14
>> 1.001556e-04 6.425547e-04 1.740235e-04 5.561802e-04 2.964362e-04
>> 1.480860e-05 1.060512e-04
>>com15com16com17com18com19
>>  com20com21
>> 4.121157e-04 5.346433e-04 1.108007e-06 5.726895e-05 8.593435e-06
>> 1.452446e-05 1.855957e-05
>>com22com23com24com25com26
>>  com27com28
>> 2.128971e-04 8.438329e-05 3.216279e-04 2.529525e-04 4.980317e-04
>> 3.111325e-05 6.290088e-04
>>com29com30com31com32com33
>>  com34com35
>> 3.559802e-05 5.907167e-05 8.906878e-05 2.510168e-05 1.929088e-04
>> 1.234508e-04 2.784301e-04
>>com36com37com38com39com40
>>  com41com42
>> 1.480560e-08 1.411752e-06 5.576549e-05 2.445569e-05 6.167242e-06
>> 1.210002e-04 1.666034e-04
>>com43com44com45com46com47
>>  com48com49
>> 1.203484e-04 7.347513e-05 8.991003e-05 8.691148e-05 6.718789e-05
>> 1.357136e-04 1.821851e-04
>>com50com51com52com53com54
>>  com55com56
>> 4.832203e-05 8.391627e-05 2.173971e-04 1.355160e-04 1.304425e-04
>> 1.787888e-04 1.759204e-05
>>com57com58com59com60com61
>>  com62com63
>> 9.307474e-05 1.185857e-04 2.776166e-04 1.277143e-04 5.905299e-06
>> 9.606009e-08 1.019480e-04
>>com64com65com66com67com68
>>  com69com70
>> 2.395355e-04 2.307081e-04 4.019309e-04 6.874506e-05 1.417622e-04
>> 5.675463e-06 9.878848e-05
>>com71com72com73com74com75
>>  com76com77
>> 6.907251e-05 8.938528e-05 2.493585e-04 1.214151e-09 2.419942e-05
>> 1.183863e-04 7.457464e-05
>>com78com79com80com81com82
>> 6.284563e-05 1.741100e-04 2.128749e-04 2.920847e-06 9.368270e-05
>>
>> $qual.FRic
>> [1] 0.7035642
>>
>> $FEve
>>  com1  com2  com3  com4  com5  com6  com7
>>  com8

Re: [R] Reading a datetime vector

2016-02-22 Thread D Wolf via R-help
Hello Everyone, 
The column begins populated with integers as so:1/1/2013 0:00 in the 
spreadsheet equals 41257 in R's dataframe1/1/2013 0:15 in the spreadsheet 
equals 41257.01041664 in R's dataframe...41257 must be in minutes since 
1440min/day * .01041664 day = 15 minutes. 41257 minutes is about 29 days: 
41257 min / 1440 min/day = 28.65 days. So I don't know why the dataframe is 
showing 41257 for 1/12013 0:00. 
Oddly, R sees the vector as NULL despite the fact it has integers in each 
record in the column:data_type = str(df2_TZ$DateTimeStamp) produces a NULL 
(empty) variable. 

I tried:
df2_TZ = read.xlsx2("DF_exp.xlsx", sheetName = "Sheet1")Sys.setenv(TZ = 
"GMT")testdtm <- as.POSIXct(df2_TZ$DateTimeStamp, format = "%m/%d/%Y %H:%M")# 
Inspect the resulttestdtmstr(testdtm)
testdtm is a vector filled with NA values, which figures since DateTimeStamp is 
NULL. 
I noticed in the table on page 32 of the R Help Desk pdf you linked to that 
dp-as.POSIXct(format(dp, tz="GMT")) is the only option listed for time zone 
difference. So I tried:df2_TZ = read.xlsx2("DF_exp.xlsx", sheetName = 
"Sheet1")df2_TZ_seq <- as.POSIXct(format(dt2_TZ, tz="GMT"))
and got: Error in format(dt2_TZ, tz = "GMT") : object 'dt2_TZ' not found
Is the vector neither character nor factor, since it's NULL? Where do I go from 
here? 
 Thank You,Doug

Hi Doug,What you have done is to ask whether the character string "DF_exp.xlsx" 
is a character string. I think Yogi Berra, were he still around, could have 
told you that. What will give you some useful information is:
str(DF_exp.xlsx)
which asks for information about the object, not its name.
Jim

On Friday, February 19, 2016 12:41 PM, Jeff Newmiller 
 wrote:
 

 This is a mailing list. I don't know how you are interacting with it... using 
a website rather than an email program can lead to some confusion since there 
can be many ways to accomplish the task of interacting with the mailing list. 
My email program has a "reply-all" button when I am looking at an email. It 
also has an option to write the email in plain text, which often prevents the 
message from getting corrupted (recipient not seeing what you sent to the list).

Using the str function on a literal string (the name of a file) will indeed 
tell you that you gave it a character string. Specifying a column in your data 
might tell you something more interesting... e.g.

str( df2_TZ$DateTimeStamp )

If that says you have character data then Jim Lemon's suggestion would be a 
good next thing to look at. If it is factor data then you should use the 
as.character function on the data column and then follow Jim's suggestion. If 
it is numeric then you probably need to convert it using an appropriate origin 
(e.g. as described at [1] or [2]).

I have had best luck setting the default timezone string when converting to 
POSIXt types... e.g.

# specify timezone assumed by input data
Sys.setenv( TZ="GMT" )
testdtm <- as.POSIXct( "1/1/2016 00:00", format = "%m/%d/%Y %H:%M" )
# inspect the result
testdtm
str( testdtm )
# view data from a different timezone
Sys.setenv( TZ="Etc/GMT+8" )
# no change to the underlying data, but it prints out differently now because 
the tz attribute is "" which implies using the default TZ
testdtm

[1] http://blog.mollietaylor.com/2013/08/date-formats-in-r.html
[2] https://www.r-project.org/doc/Rnews/Rnews_2004-1.pdf

-- 
Sent from my phone. Please excuse my brevity.

On February 19, 2016 7:48:31 AM PST, D Wolf  wrote:
Hello Jeff,
I ran str() on the vector and it returned character.> str("DF_exp.xlsx") chr 
"DF_exp.xlsx"
This is my first thread on this forum, and I'm not sure how to reply to the 
thread instead of just sending the reply to your email account; I don't see a 
'reply' link in the thread.I've read this page and I don't think it advises on 
how to reply in the thread: R: Posting Guide: How to ask good questions that 
prompt useful answers

|   |
|   |  |   |   |   |   |   |
| R: Posting Guide: How to ask good questions that prompt ...Posting Guide: How 
to ask good questions that prompt useful answers This guide is intended to help 
you get the most out of the R mailing lists, and to avoid embarra... |
|  |
| View on www.r-project.org | Preview by Yahoo |
|  |
|   |


Thank You,Doug Wolfinger
 

On Friday, February 19, 2016 12:51 AM, Jeff Newmiller 
 wrote:
 

 You are being rather scattershot in your explanation, so I suspect you are not 
being systematic in your troubleshooting. Use the str function to examine the 
data column after you pull it in from excel. It may be numeric, factor, or 
character, and the approach depends on which that function returns. 
-- 
Sent from my phone. Please excuse my brevity.

On February 18, 2016 1:12:40 PM PST, D Wolf via R-help  
wrote:
Hello,I am trying to read a data frame column named DateTimeStamp. The time is 
in GMT in this format: 1/4/2013 

Re: [R] Reading a datetime vector

2016-02-22 Thread Jeff Newmiller
It is not minutes... read the Excel documentation for representing dates... it 
is days since December 30, 1899 on Windows.  Read the links I provided in my 
last email. 

Also read ?str ... that function does not return anything... it only prints out 
information so don't expect to get anything useful by assigning the output of 
that function to a variable. 

Also read the examples section of the help file ?read.xlsx2 for relevant help. 
-- 
Sent from my phone. Please excuse my brevity.

On February 22, 2016 8:55:34 AM PST, D Wolf  wrote:
>Hello Everyone, 
>The column begins populated with integers as so:1/1/2013 0:00 in the
>spreadsheet equals 41257 in R's dataframe1/1/2013 0:15 in the
>spreadsheet equals 41257.01041664 in R's dataframe...41257 must be
>in minutes since 1440min/day * .01041664 day = 15 minutes. 41257
>minutes is about 29 days: 41257 min / 1440 min/day = 28.65 days. So I
>don't know why the dataframe is showing 41257 for 1/12013 0:00. 
>Oddly, R sees the vector as NULL despite the fact it has integers in
>each record in the column:data_type = str(df2_TZ$DateTimeStamp)
>produces a NULL (empty) variable. 
>
>I tried:
>df2_TZ = read.xlsx2("DF_exp.xlsx", sheetName = "Sheet1")Sys.setenv(TZ =
>"GMT")testdtm <- as.POSIXct(df2_TZ$DateTimeStamp, format = "%m/%d/%Y
>%H:%M")# Inspect the resulttestdtmstr(testdtm)
>testdtm is a vector filled with NA values, which figures since
>DateTimeStamp is NULL. 
>I noticed in the table on page 32 of the R Help Desk pdf you linked to
>that dp-as.POSIXct(format(dp, tz="GMT")) is the only option listed for
>time zone difference. So I tried:df2_TZ = read.xlsx2("DF_exp.xlsx",
>sheetName = "Sheet1")df2_TZ_seq <- as.POSIXct(format(dt2_TZ, tz="GMT"))
>and got: Error in format(dt2_TZ, tz = "GMT") : object 'dt2_TZ' not
>found
>Is the vector neither character nor factor, since it's NULL? Where do I
>go from here? 
> Thank You,Doug
>
>Hi Doug,What you have done is to ask whether the character string
>"DF_exp.xlsx" is a character string. I think Yogi Berra, were he still
>around, could have told you that. What will give you some useful
>information is:
>str(DF_exp.xlsx)
>which asks for information about the object, not its name.
>Jim
>
>On Friday, February 19, 2016 12:41 PM, Jeff Newmiller
> wrote:
> 
>
>This is a mailing list. I don't know how you are interacting with it...
>using a website rather than an email program can lead to some confusion
>since there can be many ways to accomplish the task of interacting with
>the mailing list. My email program has a "reply-all" button when I am
>looking at an email. It also has an option to write the email in plain
>text, which often prevents the message from getting corrupted
>(recipient not seeing what you sent to the list).
>
>Using the str function on a literal string (the name of a file) will
>indeed tell you that you gave it a character string. Specifying a
>column in your data might tell you something more interesting... e.g.
>
>str( df2_TZ$DateTimeStamp )
>
>If that says you have character data then Jim Lemon's suggestion would
>be a good next thing to look at. If it is factor data then you should
>use the as.character function on the data column and then follow Jim's
>suggestion. If it is numeric then you probably need to convert it using
>an appropriate origin (e.g. as described at [1] or [2]).
>
>I have had best luck setting the default timezone string when
>converting to POSIXt types... e.g.
>
># specify timezone assumed by input data
>Sys.setenv( TZ="GMT" )
>testdtm <- as.POSIXct( "1/1/2016 00:00", format = "%m/%d/%Y %H:%M" )
># inspect the result
>testdtm
>str( testdtm )
># view data from a different timezone
>Sys.setenv( TZ="Etc/GMT+8" )
># no change to the underlying data, but it prints out differently now
>because the tz attribute is "" which implies using the default TZ
>testdtm
>
>[1] http://blog.mollietaylor.com/2013/08/date-formats-in-r.html
>[2] https://www.r-project.org/doc/Rnews/Rnews_2004-1.pdf
>
>-- 
>Sent from my phone. Please excuse my brevity.
>
>On February 19, 2016 7:48:31 AM PST, D Wolf 
>wrote:
>Hello Jeff,
>I ran str() on the vector and it returned character.>
>str("DF_exp.xlsx") chr "DF_exp.xlsx"
>This is my first thread on this forum, and I'm not sure how to reply to
>the thread instead of just sending the reply to your email account; I
>don't see a 'reply' link in the thread.I've read this page and I don't
>think it advises on how to reply in the thread: R: Posting Guide: How
>to ask good questions that prompt useful answers
>
>|   |
>|   |  |   |   |   |   |   |
>| R: Posting Guide: How to ask good questions that prompt ...Posting
>Guide: How to ask good questions that prompt useful answers This guide
>is intended to help you get the most out of the R mailing lists, and to
>avoid embarra... |
>|  |
>| View on www.r-project.org | Preview by Yahoo |
>|  |
>|   |
>
>
>Thank You,Doug Wolfinger
> 
>
>On Friday, February 

Re: [R] Trying to load a FORTRAN dll but unable

2016-02-22 Thread Duncan Murdoch

On 22/02/2016 11:35 AM, MAURICE Jean - externe wrote:

Hi Murdoch,

Thanks for your quick answer.

First : I have a 32 bits R running on a 64 bits Windows. So I think I can load 
32bits DLL ?


Yes.


I haven't understood what I must give to is.loaded as parameter : the name of 
the DLL, the full path to it, the name of a routine in it, the value given by 
dyn.load (in fact this gives an error) ?


The name of a routine, e.g.

is.loaded("supsmu")

(which gives FALSE in current R).




About help : the only example, for is.loaded, I found in fullrefman.pdf was 
about dyn.load but is ununderstandable (?) because we have not the dyn.load 
command in the example. And if I write ?is.loaded in R I get nothing !!


Sounds as though you are using a very old or broken version of R. What 
does sessionInfo() give?  You should be using R 3.2.3.  If you're using 
an older one, you're on your own.


Duncan Murdoch

__
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] [R-pkgs] New package 'netdiffuseR: Network Analysis for Diffusion of Innovations'

2016-02-22 Thread George Vega Yon
Dear useRs,

We are happy to announce that the R package 'netdiffuseR: Network
Analysis for Diffusion of Innovations' is now on CRAN
(https://cran.r-project.org/web/packages/netdiffuseR/). From the
package's description:

"Empirical statistical analysis, visualization and simulation of
network models of the diffusion of innovations. The package implements
algorithms for calculating network diffusion statistics such as
transmission rate, hazard rates, exposure models, network threshold
levels, infectiousness (contagion), and susceptibility. The package is
inspired by work published in Valente, et al., (2015)
; Valente (1995)
, Myers (2000) , Iyengar and
others (2011) , Burt (1987)
; among others."

Some other relevant features:
 - Allows working with relative large graphs via sparse matrices
(easily handles tenths of thousands vertices), and
 - Includes three classical network diffusion of innovations datasets:
Brazilian Farmers, Korean Family Planning and Medical Innovation

The package should be available to be installed via R's
install.packages function in the following hours as CRAN builds
binaries for Windows/OSX and mirrors have them available to be
installed.

For those of you who are interested on taking a deep look on this new
tool, we will be offering a workshop at the 2016 SUNBELT Conference
(http://insna.org/sunbelt2016/) , so we encourage you to sign in!

Best,

George G. Vega Yon
+1 (626) 381 8171
http://www.its.caltech.edu/~gvegayon/

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

__
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] Trying to load a FORTRAN dll but unable

2016-02-22 Thread MAURICE Jean - externe
Hi Murdoch,

Thanks for your quick answer.

First : I have a 32 bits R running on a 64 bits Windows. So I think I can load 
32bits DLL ?

I haven't understood what I must give to is.loaded as parameter : the name of 
the DLL, the full path to it, the name of a routine in it, the value given by 
dyn.load (in fact this gives an error) ?

About help : the only example, for is.loaded, I found in fullrefman.pdf was 
about dyn.load but is ununderstandable (?) because we have not the dyn.load 
command in the example. And if I write ?is.loaded in R I get nothing !!

Best regards
Jean



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.

[R] colors in facet ggplot and geom_bar

2016-02-22 Thread efisio solazzo

Dear,
I wonder if there is a way to 'play' with colors in facet ggplot and 
geom_bar.


With reference to the attached figure, I'd like to
- color the green portion based on a numerical variable (say 1 to 10) on 
all of the four panels and
- color-code the y labels based on the values of the 'bias' (red portion 
of bars) only on the fourth panel.


the code to produce the plot is:

ggplot(Data, aes(x=mod_names, y=value, 
fill=err_type))+geom_bar(stat='identity', position='stack')  +
  facet_wrap(~spec_comp, nrow=1, 
scales="free")+
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, 
hjust=1.))+

  theme(axis.title.x = element_blank())+ ylab(units) +
  geom_text ( aes(label=sign.value, y=pos))  +

where err_type = c('bias', mMSe', 'var')

thanks for any hint.

--
Efisio SOLAZZO, Ph.D.
European Commission, Joint Research Centre,
Institute for Environment and Sustainability,
TP123, Via E. Fermi, 2749 I-21027 Ispra (VA), Italy
Tel: +390332789944 Fax: +390332785837

__
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] How a clustering algorithm in R can end up with negative silhouette values?

2016-02-22 Thread Martin Maechler
> Martin Maechler 
> on Mon, 22 Feb 2016 16:48:39 +0100 writes:

> Sarah Goslee 
> on Fri, 19 Feb 2016 15:22:22 -0500 writes:

>> Ah, my guess about the confusion was wrong, then. You're
>> misunderstanding silhouette() instead.

>>> From ?silhouette:

>> Observations with a large s(i) (almost 1) are very
>> well clustered, a small s(i) (around 0) means that the
>> observation lies between two clusters, and observations
>> with a negative s(i) are probably placed in the wrong
>> cluster.


>> In more detail, they're looking at different things.
>> clara() assigns each point to a cluster based on the
>> distance to the nearest medoid.

>> silhouette() does something different: instead of
>> comparing the distances to the closest medoid and the next
>> closest medoid, which is what you seem to be assuming,
>> silhouette() looks at the mean distance to ALL other
>> points assigned to that cluster, vs the mean distance to
>> all points in other clusters. The distance to the medoid
>> is irrelevant, except as it is one of the points in that
>> cluster.

>> So a negative silhouette value is entirely possible, and
>> means that the cluster produced doesn't represent the
>> dataset very well.

> Indeed ... and this extends to pam(), even; as you say above,
> " silhouette() does something different " :

> If your look at the plots of

> example(silhouette)

> where the silhouettes of   pam(ruspini, k = k')  ,  k' = 2,..,6
> are displayed, or if you directly look at

> plot( silhouette(ruspini, k = 6) )

oops... that should have been

plot( silhouette(pam(ruspini, k = 6)) )

> you will notice that pam() itself can easily lead to negative
> silhouette values.

> Martin Maechler  [  == maintainer("cluster")  ]



>> On Fri, Feb 19, 2016 at 3:04 PM, ABABAEI, Behnam
>>  wrote:
>>> Sarah, sorry for taking up your time.
>>> 
>>> I totally agree with you about how it works. But please
>>> let's take a look at this part of the description:
>>> 
>>> "Once k representative objects have been selected from
>>> the sub-dataset, each observation of the entire dataset
>>> is assigned to the nearest medoid. The mean (equivalent
>>> to the sum) of the dissimilarities of the observations to
>>> their closest medoid is used as a measure of the quality
>>> of the clustering. The sub-dataset for which the mean (or
>>> sum) is minimal, is retained. A further analysis is
>>> carried out on the final partition."
>>> 
>>> It says each observation is finally assigned to the
>>> closest medoid. The whole clustering process may be
>>> imperfect in terms of isolation of clusters, but each
>>> observation is already assigned to the closest one and
>>> according to the silhouette formula, the silhouette value
>>> cannot be negative, as a must be always less than b.
>>> 
>>> Regards, Behnam.
>>> 
>>>  From: Sarah
>>> Goslee  Sent: 19 February 2016
>>> 20:58 To: ABABAEI, Behnam Cc: r-help@r-project.org
>>> Subject: Re: [R] How a clustering algorithm in R can end
>>> up with negative silhouette values?
>>> 
>>> You need to think more carefully about the details of the
>>> clara() method.
>>> 
>>> The algorithm draws repeated samples of sampsize from the
>>> larger dataset, as specified by the arguments to the
>>> function.  It clusters each sample in turn, and saves the
>>> best one.  It uses the medoids from the best one to
>>> assign all of the points to a cluster.
>>> 
>>> But because the clustering is based on a subsample, it
>>> may not be representative of the dataset as a whole, and
>>> may not provide a good clustering overall. Just because
>>> it clusters the subsample well, doesn't mean it clusters
>>> the entirety. The details section of the help describes
>>> this, and the book references goes into more detail.
>>> 
>>> Sarah
>>> 
>>> 
>>> 
>>> On Fri, Feb 19, 2016 at 2:55 PM, ABABAEI, Behnam
>>>  wrote:
 Hi Sarah,
 
 Thank you for the response. But it is said in its
 description that after each run (sample), each
 observation in the whole dataset is assigned to the
 closest cluster. So how is it possible for one
 observation to be wrongly allocated, even with clara?
 
 Behnam
 
 Behnam
 
 
 
 
 On Fri, Feb 19, 2016 at 11:48 AM -0800, "Sarah Goslee"
  wrote:
 
 That means that points have been assigned to the wrong
 

Re: [R] colors in facet ggplot and geom_bar

2016-02-22 Thread Jeff Newmiller
By failing to provide a reproducible example and framing the desired answer as 
'any hint' you are effectively limiting yourself to 'any hint' rather than a 
working example. 

The 'any hint' is that err_type should be a factor with levels in your desired 
order, and you can then use any of the scale_fill_* functions including 
scale_colour_manual to specify the colors in the same order as the levels in 
the factor. 
-- 
Sent from my phone. Please excuse my brevity.

On February 22, 2016 7:24:17 AM PST, efisio solazzo 
 wrote:
>Dear,
>I wonder if there is a way to 'play' with colors in facet ggplot and 
>geom_bar.
>
>With reference to the attached figure, I'd like to
>- color the green portion based on a numerical variable (say 1 to 10)
>on 
>all of the four panels and
>- color-code the y labels based on the values of the 'bias' (red
>portion 
>of bars) only on the fourth panel.
>
>the code to produce the plot is:
>
>ggplot(Data, aes(x=mod_names, y=value, 
>fill=err_type))+geom_bar(stat='identity', position='stack')  +
>   facet_wrap(~spec_comp, nrow=1, 
>scales="free")+
>   theme(axis.text.x = element_text(angle = 90, vjust = 0.5, 
>hjust=1.))+
>   theme(axis.title.x = element_blank())+ ylab(units) +
>   geom_text ( aes(label=sign.value, y=pos))  +
>
>where err_type = c('bias', mMSe', 'var')
>
>thanks for any hint.
>
>-- 
>Efisio SOLAZZO, Ph.D.
>European Commission, Joint Research Centre,
>Institute for Environment and Sustainability,
>TP123, Via E. Fermi, 2749 I-21027 Ispra (VA), Italy
>Tel: +390332789944 Fax: +390332785837
>
>
>
>
>
>__
>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] FD package

2016-02-22 Thread Fabio Monteiro
This is the output.

I want to plot, for example FRic

$nbsp
 com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
com13 com14 com15 com16
   172118121520161218151816
 10111720
com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
com29 com30 com31 com32
91311101115121618181119
 12131312
com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
com45 com46 com47 com48
   151115 8 71210 912151313
 15131016
com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
com61 com62 com63 com64
   141214131413151311121613
9 81115
com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
com77 com78 com79 com80
   131813151011121114 81012
 11121413
com81 com82
912

$sing.sp
 com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
com13 com14 com15 com16
   172118121520161218151816
 10111720
com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
com29 com30 com31 com32
91311101115121618181119
 12131312
com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
com45 com46 com47 com48
   141115 8 71210 912151313
 15131016
com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
com61 com62 com63 com64
   141213131413151311121613
9 81115
com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
com77 com78 com79 com80
   131713151011121114 81012
 11121413
com81 com82
912

$FRic
com1 com2 com3 com4 com5
com6 com7
3.669752e-04 6.898164e-04 6.893918e-04 3.935451e-05 1.436140e-04
1.012949e-03 2.934536e-04
com8 com9com10com11com12
 com13com14
1.001556e-04 6.425547e-04 1.740235e-04 5.561802e-04 2.964362e-04
1.480860e-05 1.060512e-04
   com15com16com17com18com19
 com20com21
4.121157e-04 5.346433e-04 1.108007e-06 5.726895e-05 8.593435e-06
1.452446e-05 1.855957e-05
   com22com23com24com25com26
 com27com28
2.128971e-04 8.438329e-05 3.216279e-04 2.529525e-04 4.980317e-04
3.111325e-05 6.290088e-04
   com29com30com31com32com33
 com34com35
3.559802e-05 5.907167e-05 8.906878e-05 2.510168e-05 1.929088e-04
1.234508e-04 2.784301e-04
   com36com37com38com39com40
 com41com42
1.480560e-08 1.411752e-06 5.576549e-05 2.445569e-05 6.167242e-06
1.210002e-04 1.666034e-04
   com43com44com45com46com47
 com48com49
1.203484e-04 7.347513e-05 8.991003e-05 8.691148e-05 6.718789e-05
1.357136e-04 1.821851e-04
   com50com51com52com53com54
 com55com56
4.832203e-05 8.391627e-05 2.173971e-04 1.355160e-04 1.304425e-04
1.787888e-04 1.759204e-05
   com57com58com59com60com61
 com62com63
9.307474e-05 1.185857e-04 2.776166e-04 1.277143e-04 5.905299e-06
9.606009e-08 1.019480e-04
   com64com65com66com67com68
 com69com70
2.395355e-04 2.307081e-04 4.019309e-04 6.874506e-05 1.417622e-04
5.675463e-06 9.878848e-05
   com71com72com73com74com75
 com76com77
6.907251e-05 8.938528e-05 2.493585e-04 1.214151e-09 2.419942e-05
1.183863e-04 7.457464e-05
   com78com79com80com81com82
6.284563e-05 1.741100e-04 2.128749e-04 2.920847e-06 9.368270e-05

$qual.FRic
[1] 0.7035642

$FEve
 com1  com2  com3  com4  com5  com6  com7
 com8  com9
0.2388515 0.3996566 0.3350494 0.2943431 0.3576785 0.3846561 0.4319967
0.5857688 0.4271764
com10 com11 com12 com13 com14 com15 com16
com17 com18
0.3288544 0.4625139 0.4810921 0.3041395 0.5820621 0.6313595 0.5406627
0.2707035 0.4530424
com19 com20 com21 com22 com23 com24 com25
com26 com27
0.3015171 0.5790744 0.7253301 0.5441404 0.4481694 0.6187607 0.5445650
0.4955940 0.5116752
com28 com29 com30 com31 com32 com33 com34
com35 com36
0.5221560 0.5670513 0.4293040 0.4812907 0.4915317 0.3878949 0.4287726
0.2893205 0.5835605
com37 com38 com39 com40 com41 com42 com43
com44 com45
0.7896749 0.5482274 0.4015703 0.5990018 0.5431955 0.6251919 0.6023954
0.4962892 0.3749658

Re: [R] Multivariate multiple linear regression question

2016-02-22 Thread Mishra, Virendra R
Thank you Michael for your suggestions. I will try them out and try to 
understand their interpretations.

Regards

Virendra

Sent from Outlook Mobile



On Mon, Feb 22, 2016 at 5:39 AM -0800, "Michael Friendly" 
> wrote:

Hi Vivendra

A few suggestions:

* You will get more interpretable tests by using Type II (partial) tests
of terms in your model via
library(car)
Manova(MRI_model)
as opposed to the Type I (sequential) tests available from manova()

* You will be able to understand the results better by making heplots via
library(helplots)
heplot(MRI_model)
but you will have to read the associated vignettes to learn how to
interpret them.

* You can test for equality of covariance matrices in the various
groups using heplots::boxM(), new in the development version on
R-Forge
install.packages("heplots", repos="http://R-Forge.R-project.org;)
library(helplots)
res <- boxM(MRI_model, group=group)
res
plot(res)

* You can visually assess the correlations in the groups using
car::scatterplot(..., ellipse=TRUE, groups=)

hope this is helpful,
-Michael


On 2/20/2016 12:53 PM, Virendra Mishra wrote:
> Hi R-users,
>
> I have a fairly simple question to ask but I havent yet got an answer to
> the question. I will describe my experiment, analysis and what have I done
> and what is the question in the following paragraphs and I would appreciate
> if anyone could point me to use right statistical tools to answer my
> question.
>
> Experiment:
> I have 2 groups and both groups undergo 2 set of evaluations, one with MRI
> scanner and the other in the lab to test for their behavior. Both these
> evaluations are known to have statistically significant relationship with
> age and gender.
>
> Statistical question of interest:
> Whether there is:
> 1) statistically significant difference between the 2 groups on each
> evaluation ?
> 2) Whether there is any relationship between and within the 2 groups
> between each evaluation
>
> Model:
>
> I model the problem as following:
> MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group
> [Age is continuous and gender , Group are factors/categorical]
>
> Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group
> [Age is continuous and gender , Group are factors/categorical]
>
> In order to obtain the solution in R:
> MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group,
> data=data)
>
> Result of R:
> manova(MRI_model) suggests that yes indeed all the slopes are significantly
> different than 0 suggesting a relationship between my measures.
>
> Question:
> 1) In order to test whether the difference in the MRI_measure is
> statistically significant different between the 2 groups, I use
> MRI_model$fitted.values for each dependent measure and do a statistical
> test (either t-test or Wilcox) and claim that the difference is
> significant.
> In the paper I write, multivariate multiple linear regression was performed
> for the groups while controlling for age and gender. The regressed out
> MRI_measure was statistically compared to see if the difference is
> different.
>
> I am assuming that the predicted/fitted.values in model are the regressed
> out variables. Can I show this and use this result? Is this right
>
> If no, what is the correct way to statistically compare whether my 2 groups
> differ in their MRI measure and lab measure when controlled for age and
> gender. Any R library, literature, possibly a script will be greatly
> appreciated.
>
> 2) I also want to see if there is any relationship between MRI_measure and
> Lab_measure within the group after they are controlled for age and gender.
> What is the correct way to do this in R?
>
> Further, I also want to see if there is any significantly different
> association between the 2 groups for my set of dependent variables. I am
> thinking this can be done: I first find the correlation between 2 dependent
> variable in each group and test if this correlation is statistically
> different between the 2 groups? Is this logic right? And if it is, how do I
> compare the correlation? If not, what is the right way to do this? Any R
> library, literature, possibly a script will be greatly appreciated.
>
> I do appreciate any reply.
>
> Thanks
>
> Regards
>
> Virendra
>
>[[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, 

Re: [R] How a clustering algorithm in R can end up with negative silhouette values?

2016-02-22 Thread Martin Maechler
> Sarah Goslee 
> on Fri, 19 Feb 2016 15:22:22 -0500 writes:

> Ah, my guess about the confusion was wrong, then. You're
> misunderstanding silhouette() instead.

>> From ?silhouette:

>  Observations with a large s(i) (almost 1) are very
> well clustered, a small s(i) (around 0) means that the
> observation lies between two clusters, and observations
> with a negative s(i) are probably placed in the wrong
> cluster.


> In more detail, they're looking at different things.
> clara() assigns each point to a cluster based on the
> distance to the nearest medoid.

> silhouette() does something different: instead of
> comparing the distances to the closest medoid and the next
> closest medoid, which is what you seem to be assuming,
> silhouette() looks at the mean distance to ALL other
> points assigned to that cluster, vs the mean distance to
> all points in other clusters. The distance to the medoid
> is irrelevant, except as it is one of the points in that
> cluster.

> So a negative silhouette value is entirely possible, and
> means that the cluster produced doesn't represent the
> dataset very well.

Indeed ... and this extends to pam(), even; as you say above,
 " silhouette() does something different " :

If your look at the plots of

example(silhouette)

where the silhouettes of   pam(ruspini, k = k')  ,  k' = 2,..,6
are displayed, or if you directly look at

   plot( silhouette(ruspini, k = 6) )

you will notice that pam() itself can easily lead to negative
silhouette values.

Martin Maechler  [  == maintainer("cluster")  ]



> On Fri, Feb 19, 2016 at 3:04 PM, ABABAEI, Behnam
>  wrote:
>> Sarah, sorry for taking up your time.
>> 
>> I totally agree with you about how it works. But please
>> let's take a look at this part of the description:
>> 
>> "Once k representative objects have been selected from
>> the sub-dataset, each observation of the entire dataset
>> is assigned to the nearest medoid. The mean (equivalent
>> to the sum) of the dissimilarities of the observations to
>> their closest medoid is used as a measure of the quality
>> of the clustering. The sub-dataset for which the mean (or
>> sum) is minimal, is retained. A further analysis is
>> carried out on the final partition."
>> 
>> It says each observation is finally assigned to the
>> closest medoid. The whole clustering process may be
>> imperfect in terms of isolation of clusters, but each
>> observation is already assigned to the closest one and
>> according to the silhouette formula, the silhouette value
>> cannot be negative, as a must be always less than b.
>> 
>> Regards, Behnam.
>> 
>>  From: Sarah
>> Goslee  Sent: 19 February 2016
>> 20:58 To: ABABAEI, Behnam Cc: r-help@r-project.org
>> Subject: Re: [R] How a clustering algorithm in R can end
>> up with negative silhouette values?
>> 
>> You need to think more carefully about the details of the
>> clara() method.
>> 
>> The algorithm draws repeated samples of sampsize from the
>> larger dataset, as specified by the arguments to the
>> function.  It clusters each sample in turn, and saves the
>> best one.  It uses the medoids from the best one to
>> assign all of the points to a cluster.
>> 
>> But because the clustering is based on a subsample, it
>> may not be representative of the dataset as a whole, and
>> may not provide a good clustering overall. Just because
>> it clusters the subsample well, doesn't mean it clusters
>> the entirety. The details section of the help describes
>> this, and the book references goes into more detail.
>> 
>> Sarah
>> 
>> 
>> 
>> On Fri, Feb 19, 2016 at 2:55 PM, ABABAEI, Behnam
>>  wrote:
>>> Hi Sarah,
>>> 
>>> Thank you for the response. But it is said in its
>>> description that after each run (sample), each
>>> observation in the whole dataset is assigned to the
>>> closest cluster. So how is it possible for one
>>> observation to be wrongly allocated, even with clara?
>>> 
>>> Behnam
>>> 
>>> Behnam
>>> 
>>> 
>>> 
>>> 
>>> On Fri, Feb 19, 2016 at 11:48 AM -0800, "Sarah Goslee"
>>>  wrote:
>>> 
>>> That means that points have been assigned to the wrong
>>> groups. This may readily happen with a clustering method
>>> like cluster::clara() that uses a subset of the data to
>>> cluster a dataset too large to analyze as a
>>> unit. Negative silhouette numbers strongly suggest that
>>> your clustering parameters should be changed.
>>> 
>>> Sarah
>>> 
   

Re: [R] Trying to load a FORTRAN dll but unable

2016-02-22 Thread Duncan Murdoch

On 22/02/2016 10:24 AM, MAURICE Jean - externe wrote:

Hi,
With this piece of code, I get the message 824 :

 deelel <- paste(AccesDLL, "/regr.dll",sep="")
 if ( ! is.loaded(deelel))


The is.loaded function checks for symbols, not libraries.  See 
?is.loaded for examples.




 {
dyn.load(deelel)
if ( ! is.loaded(deelel))
{
   cat("824 : ", deelel, "non charg�e\n")
}
 }


Am I doing something wrong in this code ?
If not, what can prevent a DLL to be loaded ? And first is it a problem if the 
DLL is has been built on a 32bits Windows system and is used on a 64bits 
windows system ?


It doesn't necessarily matter where it was built, but it definitely does 
matter what the target architecture is.  If you are running 32 bit R, 
you'll see "Platform: i386-w64-mingw32/i386 (32-bit)" in the startup 
banner, and you need a 32 bit DLL.  If you are running 64 bit R, you'll 
see "Platform: x86_64-w64-mingw32/x64 (64-bit)", and you need a 64 bit 
DLL.  32 bit Windows can only run 32 bit R, but 64 bit Windows can run 
either architecture.


Duncan Murdoch

__
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] Trying to load a FORTRAN dll but unable

2016-02-22 Thread MAURICE Jean - externe
Hi,
With this piece of code, I get the message 824 :

deelel <- paste(AccesDLL, "/regr.dll",sep="")
if ( ! is.loaded(deelel))
{
   dyn.load(deelel)
   if ( ! is.loaded(deelel))
   {
  cat("824 : ", deelel, "non charg�e\n")
   }
}


Am I doing something wrong in this code ?
If not, what can prevent a DLL to be loaded ? And first is it a problem if the 
DLL is has been built on a 32bits Windows system and is used on a 64bits 
windows system ?

Thanks in advance
Jean



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.

[[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] Multivariate multiple linear regression question

2016-02-22 Thread Michael Friendly

Hi Vivendra

A few suggestions:

* You will get more interpretable tests by using Type II (partial) tests 
of terms in your model via

library(car)
Manova(MRI_model)
as opposed to the Type I (sequential) tests available from manova()

* You will be able to understand the results better by making heplots via
library(helplots)
heplot(MRI_model)
but you will have to read the associated vignettes to learn how to
interpret them.

* You can test for equality of covariance matrices in the various
groups using heplots::boxM(), new in the development version on
R-Forge
install.packages("heplots", repos="http://R-Forge.R-project.org;)
library(helplots)
res <- boxM(MRI_model, group=group)
res
plot(res)

* You can visually assess the correlations in the groups using
car::scatterplot(..., ellipse=TRUE, groups=)

hope this is helpful,
-Michael


On 2/20/2016 12:53 PM, Virendra Mishra wrote:

Hi R-users,

I have a fairly simple question to ask but I havent yet got an answer to
the question. I will describe my experiment, analysis and what have I done
and what is the question in the following paragraphs and I would appreciate
if anyone could point me to use right statistical tools to answer my
question.

Experiment:
I have 2 groups and both groups undergo 2 set of evaluations, one with MRI
scanner and the other in the lab to test for their behavior. Both these
evaluations are known to have statistically significant relationship with
age and gender.

Statistical question of interest:
Whether there is:
1) statistically significant difference between the 2 groups on each
evaluation ?
2) Whether there is any relationship between and within the 2 groups
between each evaluation

Model:

I model the problem as following:
MRI_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group
[Age is continuous and gender , Group are factors/categorical]

Lab_measure = Intercept + Slope1 * Age + Slope 2 * Gender + Slope3 * Group
[Age is continuous and gender , Group are factors/categorical]

In order to obtain the solution in R:
MRI_model<-lm(cbind(MRI_measure, Lab_measure) ~ age+gender+group,
data=data)

Result of R:
manova(MRI_model) suggests that yes indeed all the slopes are significantly
different than 0 suggesting a relationship between my measures.

Question:
1) In order to test whether the difference in the MRI_measure is
statistically significant different between the 2 groups, I use
MRI_model$fitted.values for each dependent measure and do a statistical
test (either t-test or Wilcox) and claim that the difference is
significant.
In the paper I write, multivariate multiple linear regression was performed
for the groups while controlling for age and gender. The regressed out
MRI_measure was statistically compared to see if the difference is
different.

I am assuming that the predicted/fitted.values in model are the regressed
out variables. Can I show this and use this result? Is this right

If no, what is the correct way to statistically compare whether my 2 groups
differ in their MRI measure and lab measure when controlled for age and
gender. Any R library, literature, possibly a script will be greatly
appreciated.

2) I also want to see if there is any relationship between MRI_measure and
Lab_measure within the group after they are controlled for age and gender.
What is the correct way to do this in R?

Further, I also want to see if there is any significantly different
association between the 2 groups for my set of dependent variables. I am
thinking this can be done: I first find the correlation between 2 dependent
variable in each group and test if this correlation is statistically
different between the 2 groups? Is this logic right? And if it is, how do I
compare the correlation? If not, what is the right way to do this? Any R
library, literature, possibly a script will be greatly appreciated.

I do appreciate any reply.

Thanks

Regards

Virendra

[[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] FD package

2016-02-22 Thread stephen sefick
Please see ?dput. What you provided is not a minimal, reproducible example
(i.e., there is no R code).

What kind of plot are you trying to plot? hist(data$FRic) will plot your
data. I guess we need more information to be helpful.


On Mon, Feb 22, 2016 at 8:03 AM, Fabio Monteiro <
fabio.monteiro1...@gmail.com> wrote:

> This is the output.
>
> I want to plot, for example FRic
>
> $nbsp
>  com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
> com13 com14 com15 com16
>172118121520161218151816
>  10111720
> com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
> com29 com30 com31 com32
> 91311101115121618181119
>  12131312
> com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
> com45 com46 com47 com48
>151115 8 71210 912151313
>  15131016
> com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
> com61 com62 com63 com64
>141214131413151311121613
>   9 81115
> com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
> com77 com78 com79 com80
>131813151011121114 81012
>  11121413
> com81 com82
> 912
>
> $sing.sp
>  com1  com2  com3  com4  com5  com6  com7  com8  com9 com10 com11 com12
> com13 com14 com15 com16
>172118121520161218151816
>  10111720
> com17 com18 com19 com20 com21 com22 com23 com24 com25 com26 com27 com28
> com29 com30 com31 com32
> 91311101115121618181119
>  12131312
> com33 com34 com35 com36 com37 com38 com39 com40 com41 com42 com43 com44
> com45 com46 com47 com48
>141115 8 71210 912151313
>  15131016
> com49 com50 com51 com52 com53 com54 com55 com56 com57 com58 com59 com60
> com61 com62 com63 com64
>141213131413151311121613
>   9 81115
> com65 com66 com67 com68 com69 com70 com71 com72 com73 com74 com75 com76
> com77 com78 com79 com80
>131713151011121114 81012
>  11121413
> com81 com82
> 912
>
> $FRic
> com1 com2 com3 com4 com5
> com6 com7
> 3.669752e-04 6.898164e-04 6.893918e-04 3.935451e-05 1.436140e-04
> 1.012949e-03 2.934536e-04
> com8 com9com10com11com12
>  com13com14
> 1.001556e-04 6.425547e-04 1.740235e-04 5.561802e-04 2.964362e-04
> 1.480860e-05 1.060512e-04
>com15com16com17com18com19
>  com20com21
> 4.121157e-04 5.346433e-04 1.108007e-06 5.726895e-05 8.593435e-06
> 1.452446e-05 1.855957e-05
>com22com23com24com25com26
>  com27com28
> 2.128971e-04 8.438329e-05 3.216279e-04 2.529525e-04 4.980317e-04
> 3.111325e-05 6.290088e-04
>com29com30com31com32com33
>  com34com35
> 3.559802e-05 5.907167e-05 8.906878e-05 2.510168e-05 1.929088e-04
> 1.234508e-04 2.784301e-04
>com36com37com38com39com40
>  com41com42
> 1.480560e-08 1.411752e-06 5.576549e-05 2.445569e-05 6.167242e-06
> 1.210002e-04 1.666034e-04
>com43com44com45com46com47
>  com48com49
> 1.203484e-04 7.347513e-05 8.991003e-05 8.691148e-05 6.718789e-05
> 1.357136e-04 1.821851e-04
>com50com51com52com53com54
>  com55com56
> 4.832203e-05 8.391627e-05 2.173971e-04 1.355160e-04 1.304425e-04
> 1.787888e-04 1.759204e-05
>com57com58com59com60com61
>  com62com63
> 9.307474e-05 1.185857e-04 2.776166e-04 1.277143e-04 5.905299e-06
> 9.606009e-08 1.019480e-04
>com64com65com66com67com68
>  com69com70
> 2.395355e-04 2.307081e-04 4.019309e-04 6.874506e-05 1.417622e-04
> 5.675463e-06 9.878848e-05
>com71com72com73com74com75
>  com76com77
> 6.907251e-05 8.938528e-05 2.493585e-04 1.214151e-09 2.419942e-05
> 1.183863e-04 7.457464e-05
>com78com79com80com81com82
> 6.284563e-05 1.741100e-04 2.128749e-04 2.920847e-06 9.368270e-05
>
> $qual.FRic
> [1] 0.7035642
>
> $FEve
>  com1  com2  com3  com4  com5  com6  com7
>  com8  com9
> 0.2388515 0.3996566 0.3350494 0.2943431 0.3576785 0.3846561 0.4319967
> 0.5857688 0.4271764
> com10 com11 com12 com13 com14 com15 com16
> com17 com18
> 0.3288544 0.4625139 0.4810921 0.3041395 0.5820621 0.6313595 0.5406627
> 

Re: [R] FD package

2016-02-22 Thread stephen sefick
If memory serves me, dbFD returns a lot of output. What do you want to
plot? Also, please provide reproducible examples, so that we can help you
solve your R related queries.
kindest regards,

Stephen

On Mon, Feb 22, 2016 at 7:00 AM, Fabio Monteiro <
fabio.monteiro1...@gmail.com> wrote:

> Hi
>
> thank you for your quick answer
>
> I finally managed to insert everything correctly and dbFD is caltulated.
>
> I'm now trying to plot the results.
>
> My objects are matrices.
>
> x is a functional trait and species matrice. a is the species and samples
>
> Thank you
>
> 2016-02-22 12:19 GMT+00:00 PIKAL Petr :
>
> > Hi
> >
> > comments inline
> >
> > > -Original Message-
> > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Fabio
> > > Monteiro
> > > Sent: Monday, February 22, 2016 11:51 AM
> > > To: r-help@r-project.org
> > > Subject: [R] FD package
> > >
> > > Hi.
> > >
> > > First i would like to say that i'm really new in R. I recently started
> > > working with R and i'm using the FD package.
> > >
> > > I'm having some errors that doesn't make any sense.
> > >
> > > I have 2 matrix, one is the species with functional traits and the
> > > second one is the species and abundances.
> >
> > Your objects are matrices or data frames? From docs dbFD expects various
> > inputs byt they have to be properly formatted.
> >
> > >
> > > When I try to run the dbFD to calculate the functional diversity, the
> > > error is the number of species is different in x and a.
> > >
> > > I checked a lot of times and the number of species is the same and
> > > there are no mistakes in their names like spaces or caps.
> >
> > How did you checked?
> >
> > dim(trait) and  dim(abund)
> >
> > shall give you the same number of rows in traits as columns in abund.
> >
> > If trait is vector, you need to use length instead of dim.
> >
> > >
> > > Can you help me?
> >
> > Without better description of your objects and code you used you hardly
> > get any answer. You can start by using examples from help page, which
> shall
> > work and see how your data differ from those examples.
> >
> > Cheers
> > Petr
> >
> >
> > >
> > > Fábio Monteiro
> > >
> > >   [[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.
> >
> > 
> > Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
> > určeny pouze jeho adresátům.
> > Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
> > neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho
> kopie
> > vymažte ze svého systému.
> > Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento
> email
> > jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> > Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi
> > či zpožděním přenosu e-mailu.
> >
> > V případě, že je tento e-mail součástí obchodního jednání:
> > - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
> > smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
> > - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně
> přijmout;
> > Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany
> > příjemce s dodatkem či odchylkou.
> > - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve
> > výslovným dosažením shody na všech jejích náležitostech.
> > - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za
> > společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně
> zmocněn
> > nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi
> tohoto
> > emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich
> > existence je adresátovi či osobě jím zastoupené známá.
> >
> > This e-mail and any documents attached to it may be confidential and are
> > intended only for its intended recipients.
> > If you received this e-mail by mistake, please immediately inform its
> > sender. Delete the contents of this e-mail with all attachments and its
> > copies from your system.
> > If you are not the intended recipient of this e-mail, you are not
> > authorized to use, disseminate, copy or disclose this e-mail in any
> manner.
> > The sender of this e-mail shall not be liable for any possible damage
> > caused by modifications of the e-mail or by delay with transfer of the
> > email.
> >
> > In case that this e-mail forms part of business dealings:
> > - the sender reserves the right to end negotiations about entering into a
> > contract in any time, for any reason, and without stating any reasoning.
> > - if the e-mail contains an offer, the recipient is entitled to
> > immediately 

Re: [R] FD package

2016-02-22 Thread Fabio Monteiro
Hi

thank you for your quick answer

I finally managed to insert everything correctly and dbFD is caltulated.

I'm now trying to plot the results.

My objects are matrices.

x is a functional trait and species matrice. a is the species and samples

Thank you

2016-02-22 12:19 GMT+00:00 PIKAL Petr :

> Hi
>
> comments inline
>
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Fabio
> > Monteiro
> > Sent: Monday, February 22, 2016 11:51 AM
> > To: r-help@r-project.org
> > Subject: [R] FD package
> >
> > Hi.
> >
> > First i would like to say that i'm really new in R. I recently started
> > working with R and i'm using the FD package.
> >
> > I'm having some errors that doesn't make any sense.
> >
> > I have 2 matrix, one is the species with functional traits and the
> > second one is the species and abundances.
>
> Your objects are matrices or data frames? From docs dbFD expects various
> inputs byt they have to be properly formatted.
>
> >
> > When I try to run the dbFD to calculate the functional diversity, the
> > error is the number of species is different in x and a.
> >
> > I checked a lot of times and the number of species is the same and
> > there are no mistakes in their names like spaces or caps.
>
> How did you checked?
>
> dim(trait) and  dim(abund)
>
> shall give you the same number of rows in traits as columns in abund.
>
> If trait is vector, you need to use length instead of dim.
>
> >
> > Can you help me?
>
> Without better description of your objects and code you used you hardly
> get any answer. You can start by using examples from help page, which shall
> work and see how your data differ from those examples.
>
> Cheers
> Petr
>
>
> >
> > Fábio Monteiro
> >
> >   [[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.
>
> 
> Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
> určeny pouze jeho adresátům.
> Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
> neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie
> vymažte ze svého systému.
> Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email
> jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi
> či zpožděním přenosu e-mailu.
>
> V případě, že je tento e-mail součástí obchodního jednání:
> - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
> smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
> - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout;
> Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany
> příjemce s dodatkem či odchylkou.
> - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve
> výslovným dosažením shody na všech jejích náležitostech.
> - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za
> společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn
> nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto
> emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich
> existence je adresátovi či osobě jím zastoupené známá.
>
> This e-mail and any documents attached to it may be confidential and are
> intended only for its intended recipients.
> If you received this e-mail by mistake, please immediately inform its
> sender. Delete the contents of this e-mail with all attachments and its
> copies from your system.
> If you are not the intended recipient of this e-mail, you are not
> authorized to use, disseminate, copy or disclose this e-mail in any manner.
> The sender of this e-mail shall not be liable for any possible damage
> caused by modifications of the e-mail or by delay with transfer of the
> email.
>
> In case that this e-mail forms part of business dealings:
> - the sender reserves the right to end negotiations about entering into a
> contract in any time, for any reason, and without stating any reasoning.
> - if the e-mail contains an offer, the recipient is entitled to
> immediately accept such offer; The sender of this e-mail (offer) excludes
> any acceptance of the offer on the part of the recipient containing any
> amendment or variation.
> - the sender insists on that the respective contract is concluded only
> upon an express mutual agreement on all its aspects.
> - the sender of this e-mail informs that he/she is not authorized to enter
> into any contracts on behalf of the company except for cases in which
> he/she is expressly authorized to do so in writing, and such authorization
> or power of attorney 

Re: [R] Help required for Rcmdr

2016-02-22 Thread Fox, John
Dear sekhar,

You don't need a C or C++ compiler to use the Rcmdr package. Nor do you need a 
compiler to install the package on Windows or Mac OS X, for which binary 
packages are provided by CRAN. Apparently, from your previous question, you're 
using a Windows system, and so you don't need a C or C++ compiler, unless for 
some reason you want to install the package from source (because there is a 
single small C program in the sources for the package).

Why do you ask?

I hope this helps,
 John

-
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
web: socserv.mcmaster.ca/jfox



From: R-help [r-help-boun...@r-project.org] on behalf of Sekhar Venkatesan 
[venkatesansek...@gmail.com]
Sent: February 21, 2016 7:49 AM
To: R-help@r-project.org
Subject: Re: [R] Help required for Rcmdr

Dear Sirs,
just wanted to check whether C+ or C++ software is required to be in the
installed in the laptop in order to use Rcmdr
regards
sekhar

On Wed, Feb 10, 2016 at 10:17 PM, Fox, John  wrote:

> Dear Sekhar,
>
> > -Original Message-
> > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
> > Sent: February 10, 2016 11:37 AM
> > To: Fox, John 
> > Subject: RE: [R] Help required for Rcmdr
> >
> > Tks and sorry for inadvertently sending to u alone
>
> And you apparently just did that again, so again I'm cc'ing to r-help.
>
> > In any case I hv tried all
> > over again but to no avail Regards Sekhar
>
> I assume that  by "tried all over again" you mean you tried again with an
> HTTP rather than HTTPS CRAN mirror and that didn't work.
>
> I'm afraid that I'm out of ideas.
>
> Maybe someone else will have a suggestion.
>
> John
>
> >
> > On Feb 10, 2016 9:59 PM, "Fox, John"  >  > wrote:
> >
> >
> >   Dear Sekhar,
> >
> >   I'm sorry that you're experiencing these problems. Although you
> > haven't said so directly, I assume that you aren't able to use
> install.packages()
> > to install *any* CRAN packages, not just the Rcmdr package.
> >
> >   Downloading and unpacking the Rcmdr zip file doesn't install the
> > package. You can install the zip-file binary package from the R Windows
> GUI
> > via the "Packages > Install package(s) from local zip files" menu, but
> that too
> > won't really help because it won't install the many CRAN packages on
> which
> > the Rcmdr depends.
> >
> >   As I said earlier, my guess is that you're experiencing a problem
> with
> > a firewall, proxy server, or HTTPS. If the latter (which was Vito's
> problem),
> > you can easily solve the problem by using an HTTP CRAN server in
> preference
> > to the default HTTPS:
> >
> >   Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R
> > Console > prompt and select a CRAN mirror -- I suggest the first
> (0-Cloud)
> > mirror. Then issue the command install.packages("Rcmdr"), as before.
> >
> >   If that doesn't work, I'm afraid I don't have other suggestions.
> >
> >   You appear to have sent this message only to me, not to r-help.
> That
> > not a good idea for several reasons, not least of which is that people
> who
> > have other suggestions won't see your message. I'm cc'ing this response
> to r-
> > help.
> >
> >   Best,
> >John
> >
> >   > -Original Message-
> >   > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com
> >  ]
> >   > Sent: February 10, 2016 12:03 AM
> >   > To: Fox, John  >
> >   > Subject: Re: [R] Help required for Rcmdr
> >   >
> >   > Dear Sirs,
> >   > Thanks to everyone for trying to help me. i have tried several
> CRAN
> > mirrors
> >   > but to no help. I am getting the Zip file for Rcmdr and can also
> unzip
> > the
> >   > same. However, after that i am unable to open the Rcmdr console.
> >   > that is the problem.
> >   > regards
> >   > sekhar
> >   >
> >   > On Tue, Feb 9, 2016 at 10:00 PM, Fox, John  > 
> >   >  > > wrote:
> >   >
> >   >
> >   >   Hi Rich,
> >   >
> >   >   > -Original Message-
> >   >   > From: Richard M. Heiberger [mailto:r...@temple.edu
> > 
> >   >  > ]
> >   >   > Sent: February 9, 2016 4:57 PM
> >   >   > To: Vito M. R. Muggeo  > 
> >   >  > >
> >   >   > Cc: Fox, John  >
> >  > >;
> >   > Sekhar Venkatesan
> >   >   >  > 

[R] Shiny-Wordcloud

2016-02-22 Thread Venky
Hi R users,

I need Shiny *server and UI* code for creating Uni gram,Bi gram,and Trig
ram.
 for Word cloud from my desktop data.

I gone through this link: http://shiny.rstudio.com/gallery/word-cloud.html

It contains the source data from some where, but i need to use these word
cloud for my *DESKTOP* data

in this example (http://shiny.rstudio.com/gallery/word-cloud.html)  *"A mid
Summer night dreams",The merchant of Venice "* is drop down

In that drop-down i need to set my own Desktop file (csv) variable to show
the word cloud.

*For example*

column  1 column 2   column
3

what are you?   am finei am from Chennai
Who are you?   Thanking you   my name is venky
bye take carei will do thatplease give me


I want to create column 1 word cloud instead of *A mid Summer night
dreams",*
and column 2 word cloud  instead of* The merchant of Venice from the * (
http://shiny.rstudio.com/gallery/word-cloud.html)

I need to create word cloud for separate,separate columns

Please help me to figure out this one




Thanks and Regards
Venkatesan

[[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] FD package

2016-02-22 Thread PIKAL Petr
Hi

comments inline

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Fabio
> Monteiro
> Sent: Monday, February 22, 2016 11:51 AM
> To: r-help@r-project.org
> Subject: [R] FD package
>
> Hi.
>
> First i would like to say that i'm really new in R. I recently started
> working with R and i'm using the FD package.
>
> I'm having some errors that doesn't make any sense.
>
> I have 2 matrix, one is the species with functional traits and the
> second one is the species and abundances.

Your objects are matrices or data frames? From docs dbFD expects various inputs 
byt they have to be properly formatted.

>
> When I try to run the dbFD to calculate the functional diversity, the
> error is the number of species is different in x and a.
>
> I checked a lot of times and the number of species is the same and
> there are no mistakes in their names like spaces or caps.

How did you checked?

dim(trait) and  dim(abund)

shall give you the same number of rows in traits as columns in abund.

If trait is vector, you need to use length instead of dim.

>
> Can you help me?

Without better description of your objects and code you used you hardly get any 
answer. You can start by using examples from help page, which shall work and 
see how your data differ from those examples.

Cheers
Petr


>
> Fábio Monteiro
>
>   [[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.


Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to the recipient of 
the person represented by the recipient.
__
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-es] Residual standard error Regresión lineal

2016-02-22 Thread Jesús Para Fernández
Buenas, 

En le regresi�n lineal m�ltiple, una de las salidas que nos da R es el residual 
standad error. Mi pregunta es, �se puede interpretar este rse como el error del 
modelo?

Es decir, si encuentro un modelo bueno, con un R2 adj (para modelos multi) de 
0.90 y el rse es 0.20, a las predicciones que haga con mi modelo le puedo 
aplicar un +-.20 ??


Gracias
Jes�s
  
[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] How to create an executable file from R GUI?

2016-02-22 Thread simon0098--- via R-help
Thanks all,
I solved this problem using a batch file. Note that my problem was that my GUI 
disappeared quickly that I solve it using function "gtkMain()" after calling my 
GUI  function. So, R GUI works with batch file :)
The only problem that I had is that one of the buttons in my GUI is used to 
open a PDF file but as I click it, a window of some texts appear! I didn't 
think this problem would happen ! Let me know If you have any idea about it.


[[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] How to create an executable file from R GUI?

2016-02-22 Thread Adrian Dușa
It doesn't look like HTML because it is not HTML at all, it is actually SVG.
I found that creating exact locations for checkboxes, radios and text,
using raw HTML, is a pain, therefore I created my own library of functions
which combines SVG and Javascript.
The graphs are also SVG, although I am looking to embed normal R graphics
via shiny.

On Mon, Feb 22, 2016 at 1:22 PM, Dmitri Popavenko <
dmitri.popave...@gmail.com> wrote:

> That is a very nice interface, indeed!
> What kind of HTML you used for this interface, it is looking different
> from the normal.
>
> On Sun, Feb 21, 2016 at 11:37 AM, Adrian Dușa 
> wrote:
>
>> Oh, thanks Peter, good example for Mac, but indeed not working on Windows.
>> For a completely cross-platform solution (that is, including Windows which
>> is what Zahra wants), I believe shiny is the right tool.
>>
>> So Zahra, if you want to use shiny, you need to look at their own
>> tutorials, step by step, and try to understand how it works.
>> They have predefined tools to make "apps", which can be deployed either
>> locally or on a web server. But you will be dependent on the available
>> shiny toolkit.
>> Otherwise, if you want to make a completely customized interface, you need
>> to use a combination of R, HTML and Javascript.
>>
>> Take a look at the GUI from the QCAGUI package (download the sources, it's
>> in the "inst" directory): it can read the local filesystem, import /
>> export
>> data, it does various data transformations and various QCA related
>> analyses
>> and graphs.
>> Everything is highly customized, with drop-down menus and pop-up dialogs,
>> including an output one which mimics the R console.
>> To look at the interface, type:
>>
>> library(QCAGUI)
>> runGUI()
>>
>> I hope it helps,
>> Adrian
>
>
>


-- 
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr.90
050663 Bucharest sector 5
Romania

[[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] FD package

2016-02-22 Thread Fabio Monteiro
Hi.

First i would like to say that i'm really new in R. I recently started
working with R and i'm using the FD package.

I'm having some errors that doesn't make any sense.

I have 2 matrix, one is the species with functional traits and the second
one is the species and abundances.

When I try to run the dbFD to calculate the functional diversity, the error
is the number of species is different in x and a.

I checked a lot of times and the number of species is the same and there
are no mistakes in their names like spaces or caps.

Can you help me?

Fábio Monteiro

[[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] How to create an executable file from R GUI?

2016-02-22 Thread Dmitri Popavenko
That is a very nice interface, indeed!
What kind of HTML you used for this interface, it is looking different from
the normal.

On Sun, Feb 21, 2016 at 11:37 AM, Adrian Dușa  wrote:

> Oh, thanks Peter, good example for Mac, but indeed not working on Windows.
> For a completely cross-platform solution (that is, including Windows which
> is what Zahra wants), I believe shiny is the right tool.
>
> So Zahra, if you want to use shiny, you need to look at their own
> tutorials, step by step, and try to understand how it works.
> They have predefined tools to make "apps", which can be deployed either
> locally or on a web server. But you will be dependent on the available
> shiny toolkit.
> Otherwise, if you want to make a completely customized interface, you need
> to use a combination of R, HTML and Javascript.
>
> Take a look at the GUI from the QCAGUI package (download the sources, it's
> in the "inst" directory): it can read the local filesystem, import / export
> data, it does various data transformations and various QCA related analyses
> and graphs.
> Everything is highly customized, with drop-down menus and pop-up dialogs,
> including an output one which mimics the R console.
> To look at the interface, type:
>
> library(QCAGUI)
> runGUI()
>
> I hope it helps,
> Adrian

[[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] GIS Analyses for Economics and Marketing

2016-02-22 Thread Domagoj Culinovic
I am Phdoctorate Candidate at Faculty of economics.
Also i am using GIS last 26 years, but lat 3 year i am focused on QGIS.
My earea of interests are GIS in Economics and marketing, and now i am
combine R and QGIS to have results.
Can someone help me with some tutorials, training materials or course
examples in area GIS for Marketing or Economics based on QGIS (with Grass
or any other plugins), and some examples of financial analyses based on
historical data in using GIS(for exaple to analyse comunity budget spends
in last 15 years based on GIS data).

[[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] Problems with the deSolve package

2016-02-22 Thread Alexandre Suire
Hello Abdel, 
 
I'm trying to model the spread of two viruses between different states, which 
are i1 and i2, and i12 if you got both viruses, but you can go back to the 
previous state with given probabilities (alpha, beta). The gamma probabilities 
are just additional infection (without contact) and delta an interaction factor 
between virus 1 and 2. 

I tried lowering the time steps, and, as you said, i1 and i2 are going 
negative, but it stops after a few steps. In effect, that's not what I'm
 looking for. I just want to model the dynamic of this system, and do some king 
of sensitivity analysis. I tried different set of parameters, but it still 
gives me the same error message. Maybe this has to do with my equations ? But I 
really doubt it. 

Thank you for your time
Alex

From: abdel.hallo...@gmail.com
Date: Sat, 20 Feb 2016 11:01:00 -0600
Subject: Re: [R] Problems with the deSolve package
To: alexandresu...@hotmail.fr
CC: r-help@r-project.org

I think your parameters are off. If you look at the simul data frame, it gives 
you a bunch of NaNs after the first initialization. If you put lower the 
timesteps s.t.

>
times<-seq(0,200, by=0.01)

it begins to run but soon your values diverge, i1 & i2 going negative while i12 
goes way high. Not sure what you are modeling but I assume those values aren't 
to be like that. Try again with different parameters and see.

On Fri, Feb 19, 2016 at 2:42 AM, Alexandre Suire  
wrote:
Hello R-users,



I'm trying to build a SIR-like model under R,

using the "deSolve" package. I'm trying to do simulations of its dynamic

 over time, with three differential equations. I'm also looking to

calculate the equilibrium state.



So far, my code looks like this



library(deSolve)

#This is my system, with three differential equations

system<-function(times, init, parameters){

with(as.list(c(init, parameters)),{

di1_dt=(alpha1*(N-i1-i2-i12)*(i1+i12))+(beta2*i12+gamma1*(N-i1-i2-i12))-(beta1*i1)-(delta*alpha2*i1*(i2+i12))

di2_dt=(alpha2*(N-i1-i2-i12)*(i2+i12))+(beta1*i12+gamma2*(N-i1-i2-i12))-(beta2*i2)-(delta*alpha1*i2*(i1+i12))

di12_dt=(delta*alpha2*i1*(i12+i2))+(delta*alpha1*i2*(i12*i1))+(delta*gamma1*i1)+(delta*gamma2*i2)-((beta1+beta2)*i12)

return(list(c(di1_dt,di2_dt,di12_dt)))

})

}



# Initials values and parameters

init<-c(i1=10, i2=10, i12=0)

parameters<-c(alpha1=0.7, alpha2=0.5, beta1=0.5, beta2=0.3, gamma1=0.5, 
gamma2=0.5, delta=0.5, N=100)

times<-seq(0,200, by=1)

simul <- as.data.frame(ode(y = init, times = times, func = system, parms = 
parameters, method="ode45"))

simul$time <- NULL

head(simul,200)



#Plotting the results

matplot(times,

 simul, type = "l", xlab = "Time", ylab = "i1 i2 i12", main =

"Simulation", lwd = 2, lty = 2, bty = "l", col=c("darkblue",

"darkred","mediumseagreen"))

legend("bottomright", c("i1", "i2","i12"), lty=2,lwd=2, col = c("darkblue", 
"darkred", "mediumseagreen"))



At

 first, I just tried studying with only the first two equations, and it

seems to work completely fine, but when I wanted to add the 3rd

equation, I sometimes get this message, even when I juggle the

parameters, when i launch the line:

#simul <- as.data.frame(ode(y = init, times = times, func = system, parms = 
parameters))

Warning messages:

1: In lsode(y, times, func, parms, mf = 10, ...) :

  an excessive amount of work (> maxsteps ) was done, but integration was not 
successful - increase maxsteps

2: In lsode(y, times, func, parms, mf = 10, ...) :

  Returning early. Results are accurate, as far as they go



Have I overlooked something ? I tried to use methods="ode45" and 
methods="adams", without any sucess.

Thank you for your time

Alex



[[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-es] estimada comunidad, escribi a r-help haciendo una pregunta y recibi este mail ... de que se trata esto ? algun problema de seguridad ? saludos, eric.

2016-02-22 Thread miguel.angel.rodriguez.muinos
Hola Eric.

Desafortunadamente, hace alg�n tiempo se inscribieron en la lista un par de 
direcciones (con dominio .xyz) y, seguidamente, comenzamos a recibir SPAM. Esas 
direcciones se han sido dadas de baja de la lista y ya no pueden enviar correos 
a r-help-es@r-project.org
Lo que s� pueden/pod�an hacer es enviar correos a miembros concretos (a los que 
aparecen visibles en alg�n correo de la lista). F�jate que este correo te lo 
escriben directamente a ti, no a la lista (ya que esos emails han sido baneados)

En caso de que volv�is a notar esa "actividad" por favor, comentadlo e 
intentaremos atajar, de nuevo, el tema.
Eso s�, en caso de que os env�en los mensajes directamente tendr�is que 
marcarlos vosotros como SPAM en vuestros respectivos sistemas.

Un saludo,
Miguel Rodr�guez
(un) Administrador de R-Help-es



El 19/02/2016 a las 19:17, eric escribi�:



 Forwarded Message 
Subject: RE: [R-es] problema en el manejo con fechas
Date: Thu, 18 Feb 2016 05:28:09 -0500 (EST)
From: 
lena_con...@consultingtours.xyz
Reply-To: 
lena_con...@consultingtours.xyz
To: ericconchamu...@gmail.com










Nota: A informaci�n contida nesta mensaxe e os seus posibles documentos 
adxuntos � privada e confidencial e est� dirixida �nicamente � seu 
destinatario/a. Se vostede non � o/a destinatario/a orixinal desta mensaxe, por 
favor elim�nea. A distribuci�n ou copia desta mensaxe non est� autorizada.

Nota: La informaci�n contenida en este mensaje y sus posibles documentos 
adjuntos es privada y confidencial y est� dirigida �nicamente a su 
destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, 
por favor elim�nelo. La distribuci�n o copia de este mensaje no est� autorizada.

See more languages: http://www.sergas.es/aviso-confidencialidad

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es

Re: [R] Why CLARA clustering method does not give the same classes as when I do clustering manually?

2016-02-22 Thread Martin Maechler
> David L Carlson 
> on Sun, 21 Feb 2016 16:55:56 + writes:

> I do not think this is quite true. When the medoids are
> not specified, pam/clara looks for a good initial set
> (build phase) and then finds a local minimum of the
> objective function (swap phase). Both pam/clara and kmeans
> can find local minima that are not the global minimum. 

Indeed, thank you for the explanation so far.

> If the build phase involves any random element, two runs
> could produce different results. 

One of the important features of pam (over kmeans) is indeed
that the build phase is entirely deterministic and typically
much better than random starts.
But there is an option to pam() to skip tbe build phase and
start from user specified medoids, so you can also do random
starts as kmeans, by using
  pam(..., medoids = sample(n, k))

And now you should not throw  clara  and  pam together:
Clara does randomly choose a subset from the LARge data
Application ("LARA") and then runs the build phase (and more) with only
that subset; hence clara necessarily has an element of
randomness to it.
Though --- for historical reasons -- the default chosen by CLARA's
original authors had been to always chose the same random seed
by default (and a cheap non-R RNG).  For that reasons, for a
long time now, clara()  has got an argument 'rngR' which you
"should" set to TRUE in order to get the variability of random starts.

.. more feature requests are welcome!

Martin Maechler,
ETH Zurich  == maintainer("cluster")


> If not, then the original
> order of the data determines the final result, but the
> final result is not necessarily the best one possible
> (assuming the order of the data is irrelevant to the
> analysis so we are not looking at observations taken along
> a line in time or space). That is why kmeans includes an
> argument to run the algorithm multiple times and pick the
> best result.

> -
> David L Carlson Department of Anthropology Texas A
> University College Station, TX 77840-4352

> -Original Message- From: R-help
> [mailto:r-help-boun...@r-project.org] On Behalf Of Sarah
> Goslee Sent: Friday, February 19, 2016 1:47 PM To:
> ABABAEI, Behnam Cc: r-help@r-project.org Subject: Re: [R]
> Why CLARA clustering method does not give the same classes
> as when I do clustering manually?

> clara() is a version of pam() adapted to use large
> datasets.

> pam() uses the entire dataset, and should give results
> identical to your manual procedure, or nearly so. clara()
> works on subsets of the data, so it may give a slightly
> different result each time you run it.

> The default parameters for clara() are very small, so you
> can get substantially different results from run to run on
> a large dataset if you don't change them.

> Sarah

> On Fri, Feb 19, 2016 at 6:30 AM, ABABAEI, Behnam
>  wrote:
>> Hi,
>> 
>> 
>> I am using CLARA (in 'cluster' package). This method is
>> supposed to assign each observation to the closest
>> 'medoid'. But when I calculate the distance of medoids
>> and observations manually and assign them manually, the
>> results are slightly different (1-2 percent of occurrence
>> probability). Does anyone know how clara calculates
>> dissimilarities and why I get different clustering
>> results?
>> 
>> 
>> Behnam.

> __
> 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-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] ReporteRs R package installation issues in R.3.2.3 (Windows)

2016-02-22 Thread Uwe Ligges
I guess you are using a 64 bit version of R for Windows but you have 
only a 32-bit installation of Java. Please install a 64-bit Java.


Best,
Uwe Ligges


On 22.02.2016 09:35, Santosh wrote:

Dear Rxperts..

I tried to install ReporteRs package..in R.3.2.3 (Windows)
Below are the error messages...


install.packages("ReporteRs",dep=T)

trying URL '
http://cran.cnr.berkeley.edu/bin/windows/contrib/3.2/ReporteRs_0.8.2.zip'
Content type 'application/zip' length 947836 bytes (925 KB)
downloaded 925 KB

package ‘ReporteRs’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
 C:\Users\santosh\AppData\Local\Temp\RtmpMlGfvG\downloaded_packages


library(ReporteRs)

Loading required package: ReporteRsjars
Error : .onLoad failed in loadNamespace() for 'rJava', details:
   call: fun(libname, pkgname)
   error: No CurrentVersion entry in Software/JavaSoft registry! Try
re-installing Java and make sure R and Java have matching architectures.
Error: package ‘ReporteRsjars’ could not be loaded

I tried to install ReporteRsJars..

install.packages("ReporteRsjars")

trying URL '
http://cran.cnr.berkeley.edu/bin/windows/contrib/3.2/ReporteRsjars_0.0.2.zip
'
Content type 'application/zip' length 5502826 bytes (5.2 MB)
downloaded 5.2 MB

package ‘ReporteRsjars’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
 C:\Users\santoshAppData\Local\Temp\RtmpMlGfvG\downloaded_packages


library(ReporteRsjars)

Error : .onLoad failed in loadNamespace() for 'rJava', details:
   call: fun(libname, pkgname)
   error: No CurrentVersion entry in Software/JavaSoft registry! Try
re-installing Java and make sure R and Java have matching architectures.
Error: package or namespace load failed for ‘ReporteRsjars’




rJava and and ReporteRsjars were having issues with loading even though
there were shown as successfully installed.

Would appreciate your help/solution/ideas in this regard..

Thanks much,
Santosh

[[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] ReporteRs R package installation issues in R.3.2.3 (Windows)

2016-02-22 Thread Santosh
Dear Rxperts..

I tried to install ReporteRs package..in R.3.2.3 (Windows)
Below are the error messages...

> install.packages("ReporteRs",dep=T)
trying URL '
http://cran.cnr.berkeley.edu/bin/windows/contrib/3.2/ReporteRs_0.8.2.zip'
Content type 'application/zip' length 947836 bytes (925 KB)
downloaded 925 KB

package ‘ReporteRs’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\santosh\AppData\Local\Temp\RtmpMlGfvG\downloaded_packages

> library(ReporteRs)
Loading required package: ReporteRsjars
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry! Try
re-installing Java and make sure R and Java have matching architectures.
Error: package ‘ReporteRsjars’ could not be loaded

I tried to install ReporteRsJars..
> install.packages("ReporteRsjars")
trying URL '
http://cran.cnr.berkeley.edu/bin/windows/contrib/3.2/ReporteRsjars_0.0.2.zip
'
Content type 'application/zip' length 5502826 bytes (5.2 MB)
downloaded 5.2 MB

package ‘ReporteRsjars’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\santoshAppData\Local\Temp\RtmpMlGfvG\downloaded_packages
>
> library(ReporteRsjars)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: No CurrentVersion entry in Software/JavaSoft registry! Try
re-installing Java and make sure R and Java have matching architectures.
Error: package or namespace load failed for ‘ReporteRsjars’
>

rJava and and ReporteRsjars were having issues with loading even though
there were shown as successfully installed.

Would appreciate your help/solution/ideas in this regard..

Thanks much,
Santosh

[[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] Genoa course: Introduction to Zero Inflated Models

2016-02-22 Thread Highland Statistics Ltd

We would like to announce the following statistics course:

Course: Introduction to Zero Inflated Models
Where:  Italian National Antarctic Museum, Genoa, Italy
When:   9-13 May 2016

Course website: http://www.highstat.com/statscourse.htm
Course flyer: http://highstat.com/Courses/Flyers/Flyer2016_5Genoa.pdf



Kind regards,

Alain Zuur

--
Dr. Alain F. Zuur

First author of:
1. Beginner's Guide to GAMM with R (2014).
2. Beginner's Guide to GLM and GLMM with R (2013).
3. Beginner's Guide to GAM with R (2012).
4. Zero Inflated Models and GLMM with R (2012).
5. A Beginner's Guide to R (2009).
6. Mixed effects models and extensions in ecology with R (2009).
7. Analysing Ecological Data (2007).

Highland Statistics Ltd.
9 St Clair Wynd
UK - AB41 6DZ Newburgh
Tel:   0044 1358 788177
Email: highs...@highstat.com
URL: www.highstat.com

__
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] R portable is unable to open base package

2016-02-22 Thread simon0098--- via R-help
I'm using shiny package to make a desktop application for my GUI. When I run my 
batch file, I receive the following error in the log file:
Fatal error : unable to open the base package

I checked my library path and it was correctly set to R portable library path. 
Also I tried to install base package using install.packages("base") but R gave 
a warning: package 'base' is not available (for version R 3.2.3) 

How should I solve this problem?


[[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.