Re: [R] Converting CSV file to UTF-8 encoding

2020-05-05 Thread Mehdi Dadkhah
Thank you!
With best regards,

On Tue, May 5, 2020 at 3:47 PM Richard O'Keefe  wrote:

> What do you mean "ANSI"?
> Do you mean ASCII?  In that case there is nothing to be done.
> Do you mean some member of the ISO 8859 family of 8-bit character sets?
> Do you mean some Microsoft-specific code page, such as CP-1252?
> (Microsoft CP-437 and CP-1252 "ANSI" but if they have any connection
> whatever with ANSI I would appreciate being informed of it.)
> If you really do mean the ANSI Extended Latin (ANSEL) character
> set, you are out of luck.
>
> If it is supported in your environment, the easiest way is that use the
> iconv() function.  That's what it is for.  See ?iconv.
>
> But there is something easier, and that is not to.
> Just let R know what the external encoding is, and just read the file.
> If you check the documentation of read.csv, ?read.csv
> you will find the fileEncoding="..." argument.
>
> fileEncoding: character string: if non-empty declares the encoding used
>   on a file (not a connection) so the character data can be
>   re-encoded.  See the 'Encoding' section of the help for
>   'file', the 'R Data Import/Export Manual' and 'Note'.
>
> At a guess, you  want fileEncoding="WINDOWS-1252".
>
> On Tue, 5 May 2020 at 22:42, Mehdi Dadkhah 
> wrote:
> >
> > Hi,
> > I hope you are doing well!
> > I have a CSV file which its encoding is ANSI. How can i change its
> encoding
> > to UTF-8 in R?
> > Many thanks!
> > With best regards,
> >
> > --
> > *Mehdi Dadkhah*
> >
> > [[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.
>


-- 
*Mehdi Dadkhah*
PhD candidate & Research assistant
Department of Management, Faculty of Economics and Administrative Sciences,
Ferdowsi University of Mashhad, Mashhad, Iran
*Email Addresses:*
mehdidadkha...@gmail.com
mehdidadk...@mail.um.ac.ir

[[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] Converting CSV file to UTF-8 encoding

2020-05-05 Thread Mehdi Dadkhah
Thank you!
it works for me.
With best regards,

On Tue, May 5, 2020 at 3:27 PM Rasmus Liland  wrote:

> On 2020-05-05 15:12 +0430, Mehdi Dadkhah wrote:
> > I have a CSV file which its encoding is
> > ANSI. How can i change its encoding to
> > UTF-8 in R?
>
> Hi!
>
> I do not know about ANSI, but to read latin1
> encoded csv files into readr, do this:
>
> Determine that your file is latin1-encoded:
>
> rasmus@twentyfive ~ % file -i SAA.csv
> SAA.csv: application/csv; charset=iso-8859-1
>
> read it in using readr::read_csv
>
> locale <- readr::locale(encoding = "latin1")
> SAA <- suppressMessages(
>   readr::read_csv(file="SAA.csv",
>   locale=locale))
>
> Best,
> Rasmus
>


-- 
*Mehdi Dadkhah*

[[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] Question about combining foodwebs and phylogenetic trees

2020-05-05 Thread Bert Gunter
I think it unlikely that you'll get such specific help here.
Try posting on:
R-SIG-phylo: R SIG on phylogenetic and comparative methods and analyses
instead.

(I also assume you are aware of:
https://CRAN.R-project.org/view=Phylogenetics  ,
but I have no idea whether it is helpful).


Bert Gunter

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

On Tue, May 5, 2020 at 2:12 PM Charles Lehnen  wrote:
>
> I have trying to combine foodweb outputs like the bipartite package's
> plotweb() function of bipartiteD3’s bipartite_D3 function with phylogenetic
> trees, similar to a tanglegram. Because of the very large size and a high
> amount of variability in my dataset, standard tanglegrams turn out very
> convoluted, but the plotweb() outputs are still lovely.
>
> I was able to export tips to manually order the tips of the plotweb()
> output to match the order of the phylogenetic tree tips which allowed me to
> align tips manually in Inkscape, but this proved extremely time consuming
> whenever I made an addition to my dataset.
>
> require('ape')
>
> tree1<-read.tree(text="((A,(B,(C,D))),E);")
> tree1<-ladderize(tree1, right = FALSE)
>
> tree2<-read.tree(text="(F,(G,((H,I),(J,K;")
>
> is_tip <- tree1$edge[,2] <= length(tree1$tip.label)
> ordered_tips <- tree1$edge[is_tip, 2]
> tree1tips<-tree1$tip.label[ordered_tips]
>
> is_tip <- tree2$edge[,2] <= length(tree2$tip.label)
> ordered_tips <- tree2$edge[is_tip, 2]
> tree2tips<-tree2$tip.label[ordered_tips]
>
>
> I tried to edit the plotweb() script to accept phylo class variables as an
> additional argument, but that was evidently beyond my abilities at this
> time.
>
> I also tried combing the outputs using the grid package, we were able to
> visually combine outputs next to one another and match the order of the
> tips. However, I have not been able to figure out how to actually line up
> the tips of the trees to the outputs of plotweb(). This becomes very
> evident with my actual, very large dataset
>
> require('ape')
> require('bipartite')
> require('ggplotify')
> require('cowplot')
> require('grid')
>
> tree1<-read.tree(text="((A,(B,(C,D))),E);")
> tree1<-ladderize(tree1, right = FALSE)
>
> tree2<-read.tree(text="(F,(G,((H,I),(J,K;")
>
> bipartite<-cbind(c(0,2,3,2,0,0),c(2,0,2,4,8,0),c(4,3,0,0,5,0),c(0,2,0,0,0,1),c(0,7,2,2,0,0))
> colnames(bipartite)<-c("D","C","B","A","E")
> rownames(bipartite)<-c("K","J","I","H","G","F")
> bipartite<-as.data.frame(bipartite)
>
> p12 = as.grob(~cophyloplot(tree1, tree2))
> bipartite = as.data.frame(t(bipartite))
> p3 = as.grob(~plotweb(bipartite,
> method = "normal",
> empty = "false",
> text.rot = "90"
> ))
> grid.newpage()
> grid.draw(p12)
> vp = viewport(x = 0.53, y = 0.6, width = 0.6, height = 0.8, angle = -90)
> pushViewport(vp)
> grid.draw(p3)
>
>
> If anyone could direct me on how to proceed, I would greatly appreciate it!
> I have been coming back to this problem for many months now and have not
> been to solve 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.

__
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] Question about combining foodwebs and phylogenetic trees

2020-05-05 Thread Charles Lehnen
I have trying to combine foodweb outputs like the bipartite package's
plotweb() function of bipartiteD3’s bipartite_D3 function with phylogenetic
trees, similar to a tanglegram. Because of the very large size and a high
amount of variability in my dataset, standard tanglegrams turn out very
convoluted, but the plotweb() outputs are still lovely.

I was able to export tips to manually order the tips of the plotweb()
output to match the order of the phylogenetic tree tips which allowed me to
align tips manually in Inkscape, but this proved extremely time consuming
whenever I made an addition to my dataset.

require('ape')

tree1<-read.tree(text="((A,(B,(C,D))),E);")
tree1<-ladderize(tree1, right = FALSE)

tree2<-read.tree(text="(F,(G,((H,I),(J,K;")

is_tip <- tree1$edge[,2] <= length(tree1$tip.label)
ordered_tips <- tree1$edge[is_tip, 2]
tree1tips<-tree1$tip.label[ordered_tips]

is_tip <- tree2$edge[,2] <= length(tree2$tip.label)
ordered_tips <- tree2$edge[is_tip, 2]
tree2tips<-tree2$tip.label[ordered_tips]


I tried to edit the plotweb() script to accept phylo class variables as an
additional argument, but that was evidently beyond my abilities at this
time.

I also tried combing the outputs using the grid package, we were able to
visually combine outputs next to one another and match the order of the
tips. However, I have not been able to figure out how to actually line up
the tips of the trees to the outputs of plotweb(). This becomes very
evident with my actual, very large dataset

require('ape')
require('bipartite')
require('ggplotify')
require('cowplot')
require('grid')

tree1<-read.tree(text="((A,(B,(C,D))),E);")
tree1<-ladderize(tree1, right = FALSE)

tree2<-read.tree(text="(F,(G,((H,I),(J,K;")

bipartite<-cbind(c(0,2,3,2,0,0),c(2,0,2,4,8,0),c(4,3,0,0,5,0),c(0,2,0,0,0,1),c(0,7,2,2,0,0))
colnames(bipartite)<-c("D","C","B","A","E")
rownames(bipartite)<-c("K","J","I","H","G","F")
bipartite<-as.data.frame(bipartite)

p12 = as.grob(~cophyloplot(tree1, tree2))
bipartite = as.data.frame(t(bipartite))
p3 = as.grob(~plotweb(bipartite,
method = "normal",
empty = "false",
text.rot = "90"
))
grid.newpage()
grid.draw(p12)
vp = viewport(x = 0.53, y = 0.6, width = 0.6, height = 0.8, angle = -90)
pushViewport(vp)
grid.draw(p3)


If anyone could direct me on how to proceed, I would greatly appreciate it!
I have been coming back to this problem for many months now and have not
been to solve 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 use pakcage R0

2020-05-05 Thread cpolwart




R0 = estimate.R(germany_vect, mGT, begin=germany_vect[1],

end=germany_vect[length(germany_vect)], methods="EG", pop.size=pop_de,
nsim=100)

Error in begin.nb:end.nb : argument of length 0


germany_vect[1]

  1
184

germany_vect[length(germany_vect)]

 57
488

```
What might be the problem here?


begin = germany_vect[1]
So begin = 184

but do you not want begin = 1

and same for end?

__
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] multivariance: Measuring Multivariate Dependence Using Distance Multivariance

2020-05-05 Thread Björn Böttcher

Dear R-users and developers,

based on a recent series of of papers [1-6] the package 'multivariance' 
(available on CRAN; latest version 2.3.0, 2020-04-23) was developed.

It provides in particular:

+ *fast global tests of independence* for an arbitrary number of 
variables of arbitrary dimensions


+ a detection and visualization algorithm for *higher order dependence 
structures*


+ estimators for multivariate dependence measures which *characterize 
independence*, i.e. the population version is 0 if and only if the 
variables are independent (in contrast to the standard correlation 'cor')


As a side remark, some food for thought: Note that in [3] it is referred 
to over 350 datasets from more than 150 R-packages, which all feature 
some statistical significant higher order dependencies. Some are 
probably artefacts, but in any case it is likely that these have been 
unnoticed and undiscussed so far. Moreover, since it was purely a brute 
force study, this might provide starting points for plenty of research 
by the corresponding field specialists.


Comments and questions on 'multivariance' and the underlying theory are 
welcome.


Best wishes

Björn Böttcher


References:

[1] B. Böttcher, M. Keller-Ressel, R.L. Schilling, Detecting 
independence of random vectors: generalized distance covariance and 
Gaussian covariance.

Modern Stochastics: Theory and Applications, Vol. 5, No. 3 (2018) 353-383.
https://www.vmsta.org/journal/VMSTA/article/127/info

[2] B. Böttcher, M. Keller-Ressel, R.L. Schilling, Distance 
multivariance: New dependence measures for random vectors.

The Annals of Statistics, Vol. 47, No. 5 (2019) 2757-2789.
https://projecteuclid.org/euclid.aos/1564797863

[3] B. Böttcher, Dependence and Dependence Structures: Estimation and 
Visualization using the Unifying Concept of Distance Multivariance.

Open Statistics, Vol. 1, No. 1 (2020) 1-46.
https://doi.org/10.1515/stat-2020-0001

[4] G. Berschneider, B. Böttcher, On complex Gaussian random fields, 
Gaussian quadratic forms and sample distance multivariance. Preprint.

https://arxiv.org/abs/1808.07280

[5] B. Böttcher, Copula versions of distance multivariance and dHSIC via 
the distributional transform -- a general approach to construct 
invariant dependence measures.

Statistics, (2020) 1-18.
https://doi.org/10.1080/02331888.2020.1748029

[6] B. Böttcher, Notes on the interpretation of dependence measures -- 
Pearson's correlation, distance correlation, distance multicorrelations 
and their copula versions. Preprint.

https://arxiv.org/abs/2004.07649


--
Dr. Björn Böttcher
TU Dresden
Institut für Math. Stochastik
D-01062 Dresden, Germany
Phone: +49 (0) 351 463 32423
Fax:   +49 (0) 351 463 37251
Web:   http://www.math.tu-dresden.de/~boettch/

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


[R] [R-pkgs] squashinformr: Politely web scrape data from SquashInfo in R

2020-05-05 Thread Hayden MacDonald
Hi all,

I hope this message finds you well. I have developed a new R package,
squashinformr, that allows users to web scrape data on the Professional
Squash Association World Tour and other squash tournaments. Currently,
squashinformr provides functions for accessing data on players, rankings,
and tournaments. Additionally, squashinformr ethically scrapes data from
SquashInfo  by adhering to `polite` principles
. Version 0.1.2 is now available on CRAN!

Here is a blog post introducing the package and some of its uses:
https://needleinthehay.ca/introducing-squashinformr/

and here is the package's GitHub repository:
https://github.com/HaydenMacDonald/squashinformr

Best wishes,

Hayden MacDonald

[[alternative HTML version deleted]]

___
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] COVID-19 datasets...

2020-05-05 Thread James Spottiswoode
Sure. COVID-19 Data Repository by the Center for Systems Science and 
Engineering (CSSE) at Johns Hopkins University is available here:

https://github.com/CSSEGISandData/COVID-19

All in csv fiormat.


> On May 4, 2020, at 11:31 AM, Bernard McGarvey  
> wrote:
> 
> Just curious does anyone know of a website that has data available in a 
> format that R can download and analyze?
>  
> Thanks
> 
> 
> Bernard McGarvey
> 
> 
> Director, Fort Myers Beach Lions Foundation, Inc.
> 
> 
> Retired (Lilly Engineering Fellow).
> 
> __
> 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.
> 

James Spottiswoode
Applied Mathematics & Statistics
(310) 270 6220
jamesspottiswoode Skype
ja...@jsasoc.com




[[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] Converting CSV file to UTF-8 encoding

2020-05-05 Thread Richard O'Keefe
What do you mean "ANSI"?
Do you mean ASCII?  In that case there is nothing to be done.
Do you mean some member of the ISO 8859 family of 8-bit character sets?
Do you mean some Microsoft-specific code page, such as CP-1252?
(Microsoft CP-437 and CP-1252 "ANSI" but if they have any connection
whatever with ANSI I would appreciate being informed of it.)
If you really do mean the ANSI Extended Latin (ANSEL) character
set, you are out of luck.

If it is supported in your environment, the easiest way is that use the
iconv() function.  That's what it is for.  See ?iconv.

But there is something easier, and that is not to.
Just let R know what the external encoding is, and just read the file.
If you check the documentation of read.csv, ?read.csv
you will find the fileEncoding="..." argument.

fileEncoding: character string: if non-empty declares the encoding used
  on a file (not a connection) so the character data can be
  re-encoded.  See the 'Encoding' section of the help for
  'file', the 'R Data Import/Export Manual' and 'Note'.

At a guess, you  want fileEncoding="WINDOWS-1252".

On Tue, 5 May 2020 at 22:42, Mehdi Dadkhah  wrote:
>
> Hi,
> I hope you are doing well!
> I have a CSV file which its encoding is ANSI. How can i change its encoding
> to UTF-8 in R?
> Many thanks!
> With best regards,
>
> --
> *Mehdi Dadkhah*
>
> [[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 use pakcage R0

2020-05-05 Thread Luigi Marongiu
Dear all,
I have been trying to use the package R0
https://www.rdocumentation.org/packages/R0/versions/1.2-6/topics/estimate.R but
the manual is not so rich of words.
The example given is based on the named vector Germany.1918
```
> library("R0")
> data(Germany.1918)
> Germany.1918
1918-09-29 1918-09-30 1918-10-01 1918-10-02 1918-10-03 1918-10-04
1918-10-05
10  4  4 19  6 13
28
1918-10-06 1918-10-07 1918-10-08 1918-10-09 1918-10-10 1918-10-11
1918-10-12
23 35 27 42 51 43
78
1918-10-13 1918-10-14 1918-10-15 1918-10-16 1918-10-17 1918-10-18
1918-10-19
86 80109126126159
 190
[...]
```

Then it creates a gamma function and applied the estimate.R function:
```
mGT<-generation.time("gamma", c(3, 1.5))
estR0<-estimate.R(Germany.1918, mGT, begin=1, end=27, methods=c("EG", "ML",
"TD", "AR", "SB"),
  pop.size=10, nsim=100)
```

I tried with a similar approach for the current epidemics in China:
```
> china_vect
23/01/20 24/01/20 25/01/20 26/01/20 27/01/20 28/01/20 29/01/20 30/01/20
31/01/20
 259  457  688  769 1771 1459 1737 1981
2099
> mGT = generation.time("gamma", c(3, 1.5))   # create distribution
> estR0 = estimate.R(china_vect, mGT, begin=1, end=length(china_vect),
  methods="EG",
  pop.size=pop_ch, nsim=100)
Error in integrity.checks(epid, t, GT, begin, end, date.first.obs,
time.step,  :
  If both 'begin'= 1  and 'end'= 103  are provided, they must be of the
same class (dates, character strings or integers).
```
So I gave the value 103 directly (why it did not accept length, is the
first question?) and it worked:
> estR0 = estimate.R(china_vect, mGT, begin=1, end=103,
+   methods="EG",
+   pop.size=pop_ch, nsim=100)
Waiting for profiling to be done...
> estR0
Reproduction number estimate using  Exponential Growth  method.
R :  0.3359444[ 0.3209695 , 0.3510899 ]
```
I tried another endpoint, 27 as in the example:
```
> estR0 = estimate.R(china_vect, mGT, begin=1, end=27,
+   methods="EG",
+   pop.size=pop_ch, nsim=100)
Waiting for profiling to be done...
Error: no valid set of coefficients has been found: please supply starting
values
In addition: There were 11 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted rates numerically 0 occurred
3: glm.fit: fitted rates numerically 0 occurred
4: glm.fit: fitted rates numerically 0 occurred
5: glm.fit: fitted rates numerically 0 occurred
6: glm.fit: fitted rates numerically 0 occurred
7: glm.fit: fitted rates numerically 0 occurred
8: glm.fit: fitted rates numerically 0 occurred
9: glm.fit: fitted rates numerically 0 occurred
10: glm.fit: fitted rates numerically 0 occurred
11: glm.fit: fitted rates numerically 0 occurred
```
Why these errors?
Is there a better tutorial on how to apply this function?
Thank you

[[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] Converting CSV file to UTF-8 encoding

2020-05-05 Thread Rasmus Liland
On 2020-05-05 15:12 +0430, Mehdi Dadkhah wrote:
> I have a CSV file which its encoding is 
> ANSI. How can i change its encoding to 
> UTF-8 in R?

Hi!

I do not know about ANSI, but to read latin1 
encoded csv files into readr, do this:

Determine that your file is latin1-encoded:

rasmus@twentyfive ~ % file -i SAA.csv
SAA.csv: application/csv; charset=iso-8859-1

read it in using readr::read_csv

locale <- readr::locale(encoding = "latin1")
SAA <- suppressMessages(
  readr::read_csv(file="SAA.csv",
  locale=locale))

Best,
Rasmus

__
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] Converting CSV file to UTF-8 encoding

2020-05-05 Thread Mehdi Dadkhah
Hi,
I hope you are doing well!
I have a CSV file which its encoding is ANSI. How can i change its encoding
to UTF-8 in R?
Many thanks!
With best regards,

-- 
*Mehdi Dadkhah*

[[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] PCRE configure problem with R-4.0.0

2020-05-05 Thread Ista Zahn


> |> > Linux Mint 17.2 is based on Ubuntu 14.04, which has been released in
> |> > April 2014, while PCRE2 has been released in 2015.
> |>
> |> Moreover, support for 17.2 ended over a year ago (according to
> |> https://en.wikipedia.org/wiki/Linux_Mint_version_history). I suggest
> |> upgrading to a supported version.
>
> Thanks for making that clear -- though I don't relish the hassle of
> upgrading an OS.  I was quite happy with the features of Mint 17.x.
>

Sure, but there is no free lunch and as your system gets older and
older you'll find that more and more modern software doesn't work with
it. Additionally there are increasing security risks because the
vendor is no longer releasing security patches.

That said, if you really really wanna, you can use
https://docs.conda.io/en/latest/, https://spack.io/, or similar to
install recent software releases on old systems.

Best,
Ista

> [...]
>
>
> --
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.
>___Patrick Connolly
>  {~._.~}   Great minds discuss ideas
>  _( Y )_ Average minds discuss events
> (:_~*~_:)  Small minds discuss people
>  (_)-(_)  . Eleanor Roosevelt
>
> ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

__
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] PCRE configure problem with R-4.0.0

2020-05-05 Thread Patrick Connolly
On Mon, 04-May-2020 at 11:03AM -0400, Ista Zahn wrote:

|> On Mon, May 4, 2020 at 3:51 AM Ivan Krylov  wrote:
|> >
|> > First of all, you mentioned Linux Mint, so you might get better advice
|> > on R-SIG-Debian mailing list.
|> >
|> > On Mon, 4 May 2020 16:15:42 +1200
|> > Patrick Connolly  wrote:
|> >
|> > >There are quite a lot of packages in the repository for Linux Mint
|> > >17.2 with 'pcre' in the name and these are installed:
|> >
|> > >Apparantly the '3' doesn't indicate an updated '2' version
|> >
|> > The funny thing about libpcre3 is that it is the old PCRE1 version,
|> > third ABI-incompatible upgrade of it [*], and libpcre2 (available in
|> > current releases of Linux Mint, Ubuntu and Debian) is supposed to be
|> > the newer PCRE2.
|> >
|> > Linux Mint 17.2 is based on Ubuntu 14.04, which has been released in
|> > April 2014, while PCRE2 has been released in 2015.
|> 
|> Moreover, support for 17.2 ended over a year ago (according to
|> https://en.wikipedia.org/wiki/Linux_Mint_version_history). I suggest
|> upgrading to a supported version.

Thanks for making that clear -- though I don't relish the hassle of
upgrading an OS.  I was quite happy with the features of Mint 17.x.

[...]


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

__
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] if else statement

2020-05-05 Thread PIKAL Petr
Hi

another possible version 

b$pheno <- ((b$FLASER==2) | (b$PLASER==2))+1

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of Rui Barradas
> Sent: Monday, May 4, 2020 8:32 PM
> To: sokovic.anamar...@gmail.com; r-help 
> Subject: Re: [R] if else statement
> 
> Hello,
> 
> Here is a way, using logical indices.
> 
> b$pheno <- NA
> b$pheno[b$FLASER == 1 & b$PLASER == 1] <- 1 b$pheno[b$FLASER == 2 |
> b$PLASER == 2] <- 2
> 
> 
> Hope this helps,
> 
> Rui Barradas
> 
> Às 18:15 de 04/05/20, Ana Marija escreveu:
> > Hello,
> >
> > I have a data frame like this:
> >
> >> head(b)
> > FID   IID FLASER PLASER
> > 1: fam1000 G1000  1  1
> > 2: fam1001 G1001  1  1
> > 3: fam1003 G1003  1  2
> > 4: fam1005 G1005  1  1
> > 5: fam1009 G1009  NA  2
> > 6: fam1052 G1052  1  1
> > ...
> >> unique(b$PLASER)
> > [1]  1  2 NA
> >> unique(b$FLASER)
> > [1]  1  2 NA
> >
> > how can I do if else statement so that I am creating a PHENO =2 if
> > b$FLASER=2 or b$PLASER=2
> > PHENO=1 if b$FLASER=1 and b$PLASER=1
> > otherwise PHENO=NA
> >
> > I tried this but I am not sure if this is correct:
> > b$pheno=ifelse(b$PLASER==1 & b$FLASER==1,1,ifelse(b$PLASER==2 |
> > b$FLASER==2,2,NA))
> >
> > Thanks
> > Ana
> >
> > [[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.