[R] (almost) rolling or fill function?

2020-06-08 Thread Andras Farkas via R-help
Thanks Bert, here it is in plain.



Hello,

please see if you have a thought on how to achieve the following:

we have:

df<-data.frame(a=Sys.Date()+1:10,
               b=Sys.Date()+c(NA,NA,NA,rep(3,4),NA,NA,3),
               c=Sys.Date()+c(NA,NA,NA,rep(9,4),NA,NA,9))



the idea I have difficulty wrapping my head around is to do the following: I 
need the system to look at df$a by row (lets call it the index row) and look at 
df$b and df$c 1 row before the given row in df$a  (lets call it index row -1) 
and evaluate if the index row value in df$a falls into the range (>= and <=) of 
the index row -1 values in df$b and df$c. If it does, then copy over the index 
row -1 values in df$b and df$c into the index row in df$b and df$c, if not 
place an NA in both cells of the index row in df$b and df$c. 

 examples:

1. the date value in df$a[8] is between df$b[7] and df$c[7] so we can copy the 
values in df$b[7] and df$c[7] into df$b[8] and df$c[8]
2.  the date value in df$a[9] is between df$b[8] and df$c[8] (as we copied it 
in in step 1)  so we can copy the values in df$b[8] and df$c[8] into df$b[9] 
and df$c[9]
3.  the date value in df$a[10] is NOT between df$b[9] and df$c[9] (as we copied 
it in in step 2)  so we can place NA in df$b[10] and df$c[10] 


also would like to do this going up, too, similar to fill(...,"downup"). On the 
end we would want to have this:

dfwanted<-data.frame(a=Sys.Date()+1:10,
               b=Sys.Date()+c(NA,NA,rep(3,7),NA),
               c=Sys.Date()+c(NA,NA,rep(9,7),NA))



much appreciate any help you could provide.

thanks,


Andras 


Andras 

__
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] to read data for GCalignR package

2020-06-08 Thread John Kane
I am not sure what they are doing but have a look at
https://rdrr.io/cran/GCalignR/man/read_peak_list.html




On Mon, 8 Jun 2020 at 17:38, Hui Liu  wrote:

> Dear R-help colleagues,
>
> I am looking for a way to read my txt file into R such that it can pass
> the check_input() function and be processed by in GCalignR.
>
> The vignette mentioned to save data in txt format, with first row listing
> items, 2nd row listing RT and Area, third rows and afterwards concatenate
> multiple RT and area from items listed in first row.
>
> I did this but did not find an effective way to import this data. Tried
> read.delim, scan, read individual and combine into a list. Saved to
> system.file and read as the example data. None worked.
>
> Any suggestions?
>
> Thank you very much.
>
> Hui
>
> Wave Life Sciences Email Confidentiality Notice: This message, including
> any attachments, is for use by the intended recipient(s) and may be
> proprietary, confidential and/or privileged. If you are not the intended
> recipient(s), please destroy all copies of this message and any
> attachments. Any use, forwarding, copying, or printing of this message or
> portion thereof by anyone other than the intended recipient(s) is
> prohibited. This email neither constitutes an agreement to conduct
> transactions by electronic means nor creates any legally binding contract
> or enforceable obligation in the absence of a fully signed written contract.
> __
> 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.
>


-- 
John Kane
Kingston ON Canada

[[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] [R-pkgs] 3.0-0 milestone for actuar

2020-06-08 Thread Vincent Goulet
Dear useRs and developeRs,

We are proud to announce that version 3.0-0 of actuar is now available on CRAN.

This newest release further extends support of the package for heavy tail and 
extreme value size distributions. It also introduces a package API, so that 
developers may easily integrate our C code into their own package.

From the NEWS file:

• Support functions ‘[dpqrm,lev]fpareto’ for the Feller-Pareto
  distribution and related Pareto distributions with a
  location parameter. The Feller-Pareto defines a large family
  of distributions encompassing the transformed beta family
  and many variants of the Pareto distribution. Using the
  nomenclature of Arnold (2015), the following distributions
  are now supported by ‘actuar’: Feller-Pareto, Pareto IV,
  Pareto III, and Pareto II. The Pareto I was already
  supported under the name Single Parameter Pareto.

• The package now exposes through an API its 200+ C routines
  for probability functions and the beta integral. This is
  documented in a new section of the “distributions” package
  vignette. See file ‘include/actuarAPI.h’ in the package
  installation directory for the complete list of exported
  routines.

The complete NEWS is available on CRAN as usual:

https://cran.r-project.org/web/packages/actuar/news.html

Cheers,

Vincent Goulet
Professor
École d'actuariat, Université Laval

___
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] Need help using GRASS within R - problem with CRS using the 'v.generalize' command

2020-06-08 Thread Loïc Valéry
Dear all,

First of all, this is my first message on the list. Therefore, please be 
indulgent if my message is not perfectly formatted as it should be. 

I am currently encountering a difficulty with GRASS 7.8 within R when using the 
'v.generalize' command to smooth the contour of polygons after a segmentation 
step.

I tried two different ways to "call" GRASS: 

  1 - using the RQGIS3 package
  2 - using the rgrass7 package

The first method returns an error message (i.e. "proj_create_from_database: 
Cannot find proj.db") and therefore does not produce any result.
The second method results in a layer of smoothed polygons but the projection 
reference (i.e. CRS) is lost whereas the input layer has one.

Since in both cases the problem seems to be the same (i.e. GRASS fails to 
access the projection information), I thought it was interesting to deal with 
these two cases simultaneously. So, below you will find two small examples - 
each dealing with one of the two procedures - in order to clarify the problem.

1 - Example using the RQGIS3 package :

> setwd("D:/test")
> library(sp)
> library(rgdal)
rgdal: version: 1.4-8, (SVN revision 845)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 2.2.3, released 2017/11/20
Path to GDAL shared files: C:/Users/toto/Documents/R/win-library/3.6/rgdal/gdal
GDAL binary built with GEOS: TRUE 
Loaded PROJ.4 runtime: Rel. 4.9.3, 15 August 2016, [PJ_VERSION: 493]
Path to PROJ.4 shared files: 
C:/Users/toto/Documents/R/win-library/3.6/rgdal/proj
Linking to sp version: 1.4-1 
> library(rgeos)
rgeos version: 0.5-3, (SVN revision 634)
GEOS runtime version: 3.8.0-CAPI-1.13.1 
Linking to sp version: 1.4-1 
Polygon checking: TRUE 
> library(raster)
> library(sf)
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
> library(reticulate, lib.loc="C:/Users/toto/documents/RQGIS3")
> library(RQGIS3, lib.loc="C:/Users/toto/Documents/RQGIS3")

> # set the environment to run QGIS from within R
> set_env(root="C:/Program Files/QGIS 3.12")

$root
[1] "C:/Program Files/QGIS 3.12"

$qgis_prefix_path
[1] "C:/Program Files/QGIS 3.12/apps/qgis"

$python_plugins
[1] "C:/Program Files/QGIS 3.12/apps/qgis/python/plugins"

$platform
[1] "Windows"

 

> # Opening of the application
> open_app()
proj_create_from_database: Cannot find proj.db
proj_create_from_database: Cannot find proj.db

However, this does not completely prevent the package from working because I 
can find the function I want, call it and enter the input parameters. Here is 
an excerpt :

> # Search for the desired function within QGIS 3.12
> find_algorithms(search_term="generalize", name_only=TRUE)
[1] "grass7:v.generalize"

> # Information on how to use the selected function (here, the function 
> 'generalize' from GRASS 7 within QGIS 3.12)
> get_usage(alg="grass7:v.generalize")
v.generalize (grass7:v.generalize)
Vector based generalization.
 
Input parameters


input: Input layer
 Parameter type:  QgsProcessingParameterFeatureSource
 Accepted data types:
 - str: layer ID
 - str: layer name
 - str: layer source
 - QgsProcessingFeatureSourceDefinition
 - QgsProperty
 - QgsVectorLayer
 
type: Input feature type
 Parameter type:  QgsProcessingParameterEnum
 Available values:
 - 0: line
 - 1: boundary
 - 2: area
 Accepted data types:
 - int
 - str: as string representation of int
e.g. 1
 - QgsProperty

 
> # Indicates the mandatory parameters
> params <- get_args_man(alg = "grass7:v.generalize")
Choosing default values for following parameters:
type: 0
method: 0
GRASS_OUTPUT_TYPE_PARAMETER: 0
See get_options('grass7:v.generalize') for all available options.

> # Input of mandatory parameters
> params$input<-"D:/test/seg_poly.shp"
> params$type<-"0"
> params$method<-"7"
> params$threshold<-1
> params$output<-"D:/test/smooth_seg_poly.shp"
> params$error<- "D:/test/smooth_seg_poly_error.shp"
> params$GRASS_OUTPUT_TYPE_PARAMETER<-"0"

But when I execute the function, R returns an error message that is related to 
the previous error message (i.e. when I executed the 'open_app()' command). 
Please find below the second error message :

> # Execution of the selected function
> out <- run_qgis(alg = "grass7:v.generalize",
+ params = params,
+ load_output = TRUE)

ERROR 1: PROJ: proj_identify: Cannot find proj.db
proj_create_from_wkt: Cannot find proj.db
proj_identify: Cannot find proj.db
Error in py_call_impl(callable, dots$args, dots$keywords) : 

  QgsProcessingException: There were errors executing the algorithm.

Detailed traceback: 
  File "C:/Program Files/QGIS 
3.12/apps/qgis/python/plugins\processing\tools\general.py", line 106, in run
return Processing.runAlgorithm(algOrName, 

[R] to read data for GCalignR package

2020-06-08 Thread Hui Liu
Dear R-help colleagues,

I am looking for a way to read my txt file into R such that it can pass the 
check_input() function and be processed by in GCalignR.

The vignette mentioned to save data in txt format, with first row listing 
items, 2nd row listing RT and Area, third rows and afterwards concatenate 
multiple RT and area from items listed in first row.

I did this but did not find an effective way to import this data. Tried 
read.delim, scan, read individual and combine into a list. Saved to system.file 
and read as the example data. None worked.

Any suggestions?

Thank you very much.

Hui

Wave Life Sciences Email Confidentiality Notice: This message, including any 
attachments, is for use by the intended recipient(s) and may be proprietary, 
confidential and/or privileged. If you are not the intended recipient(s), 
please destroy all copies of this message and any attachments. Any use, 
forwarding, copying, or printing of this message or portion thereof by anyone 
other than the intended recipient(s) is prohibited. This email neither 
constitutes an agreement to conduct transactions by electronic means nor 
creates any legally binding contract or enforceable obligation in the absence 
of a fully signed written contract.
C1  C2  C5  C6  C7  C8  

RT  Area

1.087   23496   1.092   24761   1.064   24072   1.054   25994   1.057   24694   
1.055   25909
1.175   14141.176   15751.254   58751.256   56551.254   5733
1.253   5839
1.404   52325   1.403   53215   1.442   52240   1.439   52832   1.439   54252   
1.439   52290
1.861   16121.856   17381.919   14141.915   14631.916   1182
1.921   2015
2.218   15769   2.209   16149   2.2 23198   2.175   24563   2.1827456   
2.186   28536
2.338   85972.332   76922.557   12362.553   14952.554   1483
2.552   1351
2.443   21412.444   17502.639   321 2.596   487 2.603   735 
2.643   459
2.499   497 2.8327082.675   418 2.684   13102.687   1403
2.696   1488
2.837   27024.783   38402.726   16722.772   524 2.779   309 
2.783   749
4.803   37957.2 713 2.78339 4.7528984.752884
4.752   2593
7.214   626 7.367   766 4.795   28617.27683 7.263   672 
7.28443
7.386   915 8.039   476 7.289   607 7.438   838 7.437   972 
7.427   908
8.042   515 8.124   60427.467   901 8.086   375 8.089   407 
8.101   601
8.134   94818.22838 8.118   376 8.162   75038.156   10975   
8.149   8229
8.231   10418.254   13578.195   10861   8.281   32468.274   3324
8.267   3170
8.261   10578.359   10558.312   29088.352   790 8.346   965 
8.343   784
8.376   980 8.397   13868.392   878 8.396   16748.393   1707
8.381   1518
8.414   10138.571   734 8.423   15558.442   648 8.452   707 
8.412   758
8.571   320 8.634   89708.484   915 8.584   11418.578   985 
8.567   1196
8.643   12213   8.834   10658.616   565 8.6810756   8.674   13686   
8.668   11901
8.838   983 8.962   24938.7112936   8.853   14288.835   1514
8.841353
8.977   12449.055   743 8.882   11618.979   40548.968   4347
8.966   4563
9.06435 9.146   949 9   27029.07868 9.064   703 
9.055   967
9.152   13619.209   10069.103   466 9.213   18789.209   2152
9.197   1966
9.209   596 9.349   12129.236   192510.152  118310.137  1075
10.128  1015
9.355   10759.393   237 10.165  111810.548  100610.554  709 
10.536  839
9.41354 9.502   615 10.572  971 10.826  135410.819  1054
10.819  1054
9.512   372 9.573   886 10.853  138810.995  165010.994  1833
10.981  1533
9.578   577 10.051  118011.024  203711.619  19484   11.609  17742   
11.601  18170
10.059  107710.473  109211.642  19604   11.878  108911.866  1101
11.846  1508
10.484  129810.644  150811.899  729 11.957  649911.94   6530
11.933  6785
10 .657 233410.879  233011.973  552012.096  42189   12.084  41771   
12.075  44095
10.888  324411.485  19996   12.114  39444   12.286  179312.25   1752
12.249  1927
11.498  20784   11.582  558 12.294  168812.341  584112.321  6898
12.311  6569
11.594  445 11.735  106812.35   604512.366  645012.349  14981   
12.342  14857
11.773  817 12.003  35631   12.379  14897   12.376  699712.428  14819   
12.415  14277
12.016  33867   12.136  136312.457  13612   12.453  12494   12.536  6   
12.524  33801
12.147  148612.176  182612.565  33854   12 .561 31314   12.659  26947   
12.641  

Re: [R] phyl.RMA error

2020-06-08 Thread Bert Gunter
Do you have NA's or Infs in your beta1 due to the use of log(Skull) and
log(Tusk) in your modeling or did you misspell something?.

If it's not something "obvious" like that, you should probably post on the
r-sig-ecology list instead, where you are more likely to find both the
interest and expertise in this specialized topic. This list is for general
R language questions primarily.

Cheers,
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 Mon, Jun 8, 2020 at 12:28 PM Ted Stankowich <
theodore.stankow...@csulb.edu> wrote:

> Hello,
>
> We're trying to run phylogenetically corrected reduced major axes
> regression analyses and have encountered an error we can't debug. We're
> using the function phyl.RMA in the package 'phytools'. Here is the code we
> are using and the error it returns.
>
>
>
> >Model <- phyl.RMA(log(Skull), log(Tusk), tree, h0=1.0)
>
> Error in if (sign(beta1) != sign(h0)) { :
>
>   missing value where TRUE/FALSE needed
>
> We can't seem to figure out which argument is missing, and we've tried
> including all of the T/F based arguments we think are possible. Our species
> dataset and nexus file are printed below.  Any advice would be greatly
> appreciated.
>
> We have the following dataset:
> Binomial Skull  Tusk
> 
> 1 Tragulus_javanicus93.7  14.6
> 2 Tragulus_kanchil  99.7  13.9
> 3 Tragulus_napu 98.1  11.1
> 4 Tragulus_nigricans99.8  13.2
> 5 Moschiola_meminna101.   14.6
> 6 Moschus_berezovskii  134.   55.0
> 7 Moschus_moschiferus  152.   52.9
> 8 Muntiacus_muntjak193.   26.4
> 9 Muntiacus_reevesi159.   23.4
> 10 Muntiacus_truongsonensis 184.   27.7
> 11 Muntiacus_vaginalis  203.   28.6
> 12 Hydropotes_inermis   162.   48.5
> 13 Hyemoschus_aquaticus 122.   20.1
> 14 Elaphodus_cephalophus186.   17.3
>
> And the following nexus tree:
>
> #NEXUS
> [R-package APE, Mon Jun 08 12:20:01 2020]
>
> BEGIN TAXA;
>   DIMENSIONS NTAX = 12;
>   TAXLABELS
>  Tragulus_napu
>  Tragulus_kanchil
>  Tragulus_javanicus
>  Hyemoschus_aquaticus
>  Moschiola_meminna
>  Muntiacus_reevesi
>  Muntiacus_muntjak
>  Muntiacus_truongsonensis
>  Elaphodus_cephalophus
>  Hydropotes_inermis
>  Moschus_moschiferus
>  Moschus_berezovskii
>   ;
> END;
> BEGIN TREES;
>   TRANSLATE
>  1Tragulus_napu,
>  2Tragulus_kanchil,
>  3Tragulus_javanicus,
>  4Hyemoschus_aquaticus,
>  5Moschiola_meminna,
>  6Muntiacus_reevesi,
>  7Muntiacus_muntjak,
>  8Muntiacus_truongsonensis,
>  9Elaphodus_cephalophus,
>  10  Hydropotes_inermis,
>  11  Moschus_moschiferus,
>  12  Moschus_berezovskii
>   ;
>   TREE * UNTITLED = []
> 1:5.540957781,(2:2.978817423,3:2.978817423):2.562139698):10.78911152,4:16.33006601):6.360692368,5:22.69076035):5.725388419,(6:1.611149584,7:1.611149848):1.556474893,8:3.167624477):4.130280196,9:7.297904013):1.497063399,10:8.794967413):7.19682079,(11:2.539095678,12:2.539096008):13.45269085):12.42436025);
>
>
>
> Dr. Ted Stankowich
> Associate Professor
> Department of Biological Sciences
> California State University Long Beach
> Long Beach, CA 90840
> theodore.stankow...@csulb.edu
> 562-985-4826
> http://www.csulb.edu/mammal-lab/
> @CSULBMammalLab
>
>
>
>
> [[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] (almost) rolling function or fill?

2020-06-08 Thread Bert Gunter
This is a plain text list. Your html post was completely mangled. Re-post
in plain text, please.

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 Mon, Jun 8, 2020 at 1:08 PM Andras Farkas via R-help <
r-help@r-project.org> wrote:

> Hello,
> please see if you have a thought on how to achieve the following:
> we have:
>  df<-data.frame(a=Sys.Date()+1:10,
>  b=Sys.Date()+c(NA,NA,NA,rep(3,4),NA,NA,3),
>  c=Sys.Date()+c(NA,NA,NA,rep(9,4),NA,NA,9))
>
>
> the idea I have difficulty wrapping my head around is to do the following:
> I need the system to look at df$a by row (lets call it the index row) and
> look at df$b and df$c 1 row before the given row in df$a  (lets call it
> index row -1) and evaluate if the index row value in df$a falls into the
> range (>= and <=) of the index row -1 values in df$b and df$c. If it does,
> then copy over the index row -1 values in df$b and df$c into the index row
> in df$b and df$c, if not place an NA in both cells of the index row in df$b
> and df$c.
>  examples:
> 1. the date value in df$a[8] is between df$b[7] and df$c[7] so we can copy
> the values in df$b[7] and df$c[7] into df$b[8] and df$c[8]2.  the date
> value in df$a[9] is between df$b[8] and df$c[8] (as we copied it in in step
> 1)  so we can copy the values in df$b[8] and df$c[8] into df$b[9] and
> df$c[9]3.  the date value in df$a[10] is NOT between df$b[9] and df$c[9]
> (as we copied it in in step 2)  so we can place NA in df$b[10] and df$c[10]
>
> also would like to do this going up, too, similar to fill(...,"downup").
> On the end we would want to have this:
>  dfwanted<-data.frame(a=Sys.Date()+1:10,
>  b=Sys.Date()+c(NA,NA,rep(3,7),NA),
>  c=Sys.Date()+c(NA,NA,rep(9,7),NA))
>
>
> much appreciate any help you could provide.
> thanks,
>
> Andras
> [[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] (almost) rolling function or fill?

2020-06-08 Thread Andras Farkas via R-help
Hello,
please see if you have a thought on how to achieve the following:
we have:
 df<-data.frame(a=Sys.Date()+1:10,               
b=Sys.Date()+c(NA,NA,NA,rep(3,4),NA,NA,3),               
c=Sys.Date()+c(NA,NA,NA,rep(9,4),NA,NA,9))


the idea I have difficulty wrapping my head around is to do the following: I 
need the system to look at df$a by row (lets call it the index row) and look at 
df$b and df$c 1 row before the given row in df$a  (lets call it index row -1) 
and evaluate if the index row value in df$a falls into the range (>= and <=) of 
the index row -1 values in df$b and df$c. If it does, then copy over the index 
row -1 values in df$b and df$c into the index row in df$b and df$c, if not 
place an NA in both cells of the index row in df$b and df$c. 
 examples:
1. the date value in df$a[8] is between df$b[7] and df$c[7] so we can copy the 
values in df$b[7] and df$c[7] into df$b[8] and df$c[8]2.  the date value in 
df$a[9] is between df$b[8] and df$c[8] (as we copied it in in step 1)  so we 
can copy the values in df$b[8] and df$c[8] into df$b[9] and df$c[9]3.  the date 
value in df$a[10] is NOT between df$b[9] and df$c[9] (as we copied it in in 
step 2)  so we can place NA in df$b[10] and df$c[10] 

also would like to do this going up, too, similar to fill(...,"downup"). On the 
end we would want to have this:
 dfwanted<-data.frame(a=Sys.Date()+1:10,               
b=Sys.Date()+c(NA,NA,rep(3,7),NA),               
c=Sys.Date()+c(NA,NA,rep(9,7),NA))


much appreciate any help you could provide.
thanks,

Andras 
[[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] phyl.RMA error

2020-06-08 Thread Ted Stankowich
Hello,

We're trying to run phylogenetically corrected reduced major axes regression 
analyses and have encountered an error we can't debug. We're using the function 
phyl.RMA in the package 'phytools'. Here is the code we are using and the error 
it returns.



>Model <- phyl.RMA(log(Skull), log(Tusk), tree, h0=1.0)

Error in if (sign(beta1) != sign(h0)) { :

  missing value where TRUE/FALSE needed

We can't seem to figure out which argument is missing, and we've tried 
including all of the T/F based arguments we think are possible. Our species 
dataset and nexus file are printed below.  Any advice would be greatly 
appreciated.

We have the following dataset:
Binomial Skull  Tusk

1 Tragulus_javanicus93.7  14.6
2 Tragulus_kanchil  99.7  13.9
3 Tragulus_napu 98.1  11.1
4 Tragulus_nigricans99.8  13.2
5 Moschiola_meminna101.   14.6
6 Moschus_berezovskii  134.   55.0
7 Moschus_moschiferus  152.   52.9
8 Muntiacus_muntjak193.   26.4
9 Muntiacus_reevesi159.   23.4
10 Muntiacus_truongsonensis 184.   27.7
11 Muntiacus_vaginalis  203.   28.6
12 Hydropotes_inermis   162.   48.5
13 Hyemoschus_aquaticus 122.   20.1
14 Elaphodus_cephalophus186.   17.3

And the following nexus tree:

#NEXUS
[R-package APE, Mon Jun 08 12:20:01 2020]

BEGIN TAXA;
  DIMENSIONS NTAX = 12;
  TAXLABELS
 Tragulus_napu
 Tragulus_kanchil
 Tragulus_javanicus
 Hyemoschus_aquaticus
 Moschiola_meminna
 Muntiacus_reevesi
 Muntiacus_muntjak
 Muntiacus_truongsonensis
 Elaphodus_cephalophus
 Hydropotes_inermis
 Moschus_moschiferus
 Moschus_berezovskii
  ;
END;
BEGIN TREES;
  TRANSLATE
 1Tragulus_napu,
 2Tragulus_kanchil,
 3Tragulus_javanicus,
 4Hyemoschus_aquaticus,
 5Moschiola_meminna,
 6Muntiacus_reevesi,
 7Muntiacus_muntjak,
 8Muntiacus_truongsonensis,
 9Elaphodus_cephalophus,
 10  Hydropotes_inermis,
 11  Moschus_moschiferus,
 12  Moschus_berezovskii
  ;
  TREE * UNTITLED = [] 
1:5.540957781,(2:2.978817423,3:2.978817423):2.562139698):10.78911152,4:16.33006601):6.360692368,5:22.69076035):5.725388419,(6:1.611149584,7:1.611149848):1.556474893,8:3.167624477):4.130280196,9:7.297904013):1.497063399,10:8.794967413):7.19682079,(11:2.539095678,12:2.539096008):13.45269085):12.42436025);



Dr. Ted Stankowich
Associate Professor
Department of Biological Sciences
California State University Long Beach
Long Beach, CA 90840
theodore.stankow...@csulb.edu
562-985-4826
http://www.csulb.edu/mammal-lab/
@CSULBMammalLab




[[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] ggplot to visualize data

2020-06-08 Thread Rui Barradas

Hello,

Inline.


Às 17:18 de 08/06/20, Neha gupta escreveu:

I am still waiting for someone to respond.

If someone want to help other, they do not need a special platform for it.

Thank you, yet again for not helping.



1. You have waited 41 minutes.
2. You have not posted data and code.
3. Read the posting guide, please. It's not the first time you post 
questions, and this one does *not* give enough information for anyone to 
answer.

4. I wonder how you can have two models, NN and SVM, and run

boxplot(NN, SVM)

without error. Given the problem description, the code line above simply 
doesn't make sense.


So it's not our fault if you are not getting answers.

Do read the posting guide, please.


Rui Barradas



Regards

On Mon, Jun 8, 2020 at 5:41 PM Bert Gunter  wrote:


Largely off topic here. RStudio has Help forums on ggplot and other of its
R software products. Post there.
Or on stats.stackexchange.com perhaps for questions about how to
visualize statistical data.
See the posting guide linked below for what is ON topic here.

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 Mon, Jun 8, 2020 at 8:38 AM Neha gupta 
wrote:


I have a model NN, which has 10 piece of data in 10 folds of test (ts)
data
such as 0.1, 0.5, 0.3 etc.
And another model SVM, which also have this type of information. I usually
visualize it like:





I have two questions?

(1) I want to ask how can I visualize them via ggplot?

(2) If I have to process it again on another dataset, then how can I
combine these two boxplots in order to make a better prediction.

Regards

 [[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-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] ggplot to visualize data

2020-06-08 Thread Martin Møller Skarbiniks Pedersen
On Mon, 8 Jun 2020 at 18:25, Neha gupta  wrote:

> I am still waiting for someone to respond.
>
>
Please read this guide about asking questions and try again on the correct
mailing-list.
https://www.r-project.org/posting-guide.html

Regards
Martin

[[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] ggplot to visualize data

2020-06-08 Thread Neha gupta
I am still waiting for someone to respond.

If someone want to help other, they do not need a special platform for it.

Thank you, yet again for not helping.

Regards

On Mon, Jun 8, 2020 at 5:41 PM Bert Gunter  wrote:

> Largely off topic here. RStudio has Help forums on ggplot and other of its
> R software products. Post there.
> Or on stats.stackexchange.com perhaps for questions about how to
> visualize statistical data.
> See the posting guide linked below for what is ON topic here.
>
> 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 Mon, Jun 8, 2020 at 8:38 AM Neha gupta 
> wrote:
>
>> I have a model NN, which has 10 piece of data in 10 folds of test (ts)
>> data
>> such as 0.1, 0.5, 0.3 etc.
>> And another model SVM, which also have this type of information. I usually
>> visualize it like:
>>
>> boxplot (NN, SVM)
>>
>> I have two questions?
>>
>> (1) I want to ask how can I visualize them via ggplot?
>>
>> (2) If I have to process it again on another dataset, then how can I
>> combine these two boxplots in order to make a better prediction.
>>
>> Regards
>>
>> [[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] Ejecución de Rselenium desde Shinyapp

2020-06-08 Thread Emilio L. Cano
Hola Diego,

Por darte alguna pista hacia dónde buscar: ¿no será un problema relacionado con 
permisos de escritura en el servidor? Si ejecutas la aplicación Shiny en local 
olvida este mensaje, pero si la ejecutas en un servidor, a mí me ha pasado (en 
otro contexto diferente).

Un saludo,

Emilio L. Cano
http://emilio.lcano.com



> El 8 jun 2020, a las 16:46, Diego Maldonado via R-help-es 
>  escribió:
> 
> Saludos estimado grupo les saluda Diego desde Ecuador, por solicitar si 
> alguien me puede guiar, estoy tratando de ejecutar un proceso que desarrollé 
> en Rselenium para raspar una pagina web y funciona perfectamente con 
> contenedores docker, sin embargo, ahora intento ejecutar una aplicación en 
> Shiny para que automáticamente se ejecute el respado con Rselenium, sin 
> embargo, no  he logrado encontrar una guía para hacerlo cuando no es de 
> manera local, si alguien conoce como hacerlo o tiene algun link donde se 
> trate de este tema mucho les agradecería
> 
> Diego
> 
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es

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


Re: [R] ggplot to visualize data

2020-06-08 Thread Bert Gunter
Largely off topic here. RStudio has Help forums on ggplot and other of its
R software products. Post there.
Or on stats.stackexchange.com perhaps for questions about how to visualize
statistical data.
See the posting guide linked below for what is ON topic here.

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 Mon, Jun 8, 2020 at 8:38 AM Neha gupta  wrote:

> I have a model NN, which has 10 piece of data in 10 folds of test (ts) data
> such as 0.1, 0.5, 0.3 etc.
> And another model SVM, which also have this type of information. I usually
> visualize it like:
>
> boxplot (NN, SVM)
>
> I have two questions?
>
> (1) I want to ask how can I visualize them via ggplot?
>
> (2) If I have to process it again on another dataset, then how can I
> combine these two boxplots in order to make a better prediction.
>
> Regards
>
> [[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] ggplot to visualize data

2020-06-08 Thread Neha gupta
I have a model NN, which has 10 piece of data in 10 folds of test (ts) data
such as 0.1, 0.5, 0.3 etc.
And another model SVM, which also have this type of information. I usually
visualize it like:

boxplot (NN, SVM)

I have two questions?

(1) I want to ask how can I visualize them via ggplot?

(2) If I have to process it again on another dataset, then how can I
combine these two boxplots in order to make a better prediction.

Regards

[[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] Dynamic Programming in R

2020-06-08 Thread Bert Gunter
Search before posting here!

"dynamic programming R" brought up several relevant hits.


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 Mon, Jun 8, 2020 at 5:54 AM Nikos Matsavelas 
wrote:

> Is there any package that implements Dynamic Programming like
> maximises/minizises the sum or product in a three way matrix in R?Like the
> problem that i have solved by hand (attached pdf file)
> __
> 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] Ejecución de Rselenium desde Shinyapp

2020-06-08 Thread Diego Maldonado via R-help-es
Saludos estimado grupo les saluda Diego desde Ecuador, por solicitar si alguien 
me puede guiar, estoy tratando de ejecutar un proceso que desarrollé en 
Rselenium para raspar una pagina web y funciona perfectamente con contenedores 
docker, sin embargo, ahora intento ejecutar una aplicación en Shiny para que 
automáticamente se ejecute el respado con Rselenium, sin embargo, no  he 
logrado encontrar una guía para hacerlo cuando no es de manera local, si 
alguien conoce como hacerlo o tiene algun link donde se trate de este tema 
mucho les agradecería

Diego

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


Re: [R] R 4.0.1 crashes with R Commander

2020-06-08 Thread Duncan Murdoch

On 07/06/2020 1:53 p.m., Paulo Figueiredo wrote:

Hi again,

as an update, I tried to open R Commander under R 32 bits and it worked,
but not with R Studio choosing the 32 bit R.

Thus, trying to load R Commander under R Studio (32 and 64 bits) or R 64
bits crashes the programmes. It only loads under 32 bit R 4.0.1.


There's a report of a bug in 4.0.1 that causes this.  So far it's only 
known to affect Windows, but it may also affect other systems. The only 
thing you can do at the moment is install a nightly build of R-patched 
with revision number of at least r78653.  You can get it from here:


https://cloud.r-project.org/bin/windows/base/rpatched.html

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.


Re: [R] R 4.0.1 crashes with R commander

2020-06-08 Thread Peter Dalgaard
This was fixed by r78653, so should be in R-patched already

https://cran.r-project.org/bin/windows/base/rpatched.html

-pd

> On 7 Jun 2020, at 19:15 , Paulo Figueiredo  wrote:
> 
> Hi,
> 
> I just updated R from 4.0 to 4.0.1 and when trying to load R commander (both 
> in R and RStudio) the programme crashes. Any suggestion?
> 
> Thanks
> 
> 
> -- 
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> __
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.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.


Re: [R] R 4.0.1 crashes with R Commander

2020-06-08 Thread Fox, John
Dear Paulo,

This is due to a known bug in R 4.0.1 for Windows that is general to Tcl/Tk. 
The bug should be fixed in the current patched version of R 4.0.1 for Windows, 
so you could use that or just go back to R 4.0.0. 

Best,
 John

  -
  John Fox, Professor Emeritus
  McMaster University
  Hamilton, Ontario, Canada
  Web: http::/socserv.mcmaster.ca/jfox

> On Jun 7, 2020, at 1:53 PM, Paulo Figueiredo  wrote:
> 
> Hi again,
> 
> as an update, I tried to open R Commander under R 32 bits and it worked, but 
> not with R Studio choosing the 32 bit R.
> 
> Thus, trying to load R Commander under R Studio (32 and 64 bits) or R 64 bits 
> crashes the programmes. It only loads under 32 bit R 4.0.1.
> 
> Appreciate any help.
> 
> Cheers
> 
> 
> -- 
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
> 
> __
> 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] R 4.0.1 crashes with R Commander

2020-06-08 Thread Paulo Figueiredo

Hi again,

as an update, I tried to open R Commander under R 32 bits and it worked, 
but not with R Studio choosing the 32 bit R.


Thus, trying to load R Commander under R Studio (32 and 64 bits) or R 64 
bits crashes the programmes. It only loads under 32 bit R 4.0.1.


Appreciate any help.

Cheers


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

__
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] Dynamic Programming in R

2020-06-08 Thread Nikos Matsavelas
Is there any package that implements Dynamic Programming like 
maximises/minizises the sum or product in a three way matrix in R?Like the 
problem that i have solved by hand (attached pdf file)
__
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] R: pivmet 0.3.0

2020-06-08 Thread EGIDI LEONARDO
Dear R users,

pivmet 0.3.0 for pivotal relabelling in Bayesian Mixture Models and Kmeans 
clustering with pivotal seeding is on CRAN .
The new updated version includes the following new features:


  *   multivariate mixtures
  *   bayesplot plots now available and linked to the package
  *   Stan divergences and diagnostics
  *   updated vignette

CRAN: 
https://CRAN.R-project.org/package=pivmet
Github: https://github.com/LeoEgidi/pivmet

Cheers,

Leonardo Egidi
University of Trieste





Da: EGIDI LEONARDO
Inviato: venerd� 5 giugno 2020 17:40
A: r-packa...@r-project.org 
Oggetto: pivmet 0.3.0

Dear R users,

pivmet 0.3.0 for pivotal relabelling in Bayesian Mixture Models and Kmeans 
clustering with pivotal seeding is on CRAN .
The new updated version includes the following new features:


  *   multivariate mixtures
  *   bayesplot plots now available and linked to the package
  *   Stan divergences and diagnostics
  *   updated vignette

CRAN: https://cran.r-project.org/web/packages/pivmet/index.html
Github: https://github.com/LeoEgidi/pivmet

Cheers,

Leonardo Egidi
University of Trieste


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


[R] R 4.0.1 crashes with R commander

2020-06-08 Thread Paulo Figueiredo

Hi,

I just updated R from 4.0 to 4.0.1 and when trying to load R commander 
(both in R and RStudio) the programme crashes. Any suggestion?


Thanks


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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