Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread Viechtbauer, Wolfgang (SP)
Dear Kobby,

Please post the output of sessionInfo() and class(result.md).

Best,
Wolfgang

>-Original Message-
>From: K Amoatwi [mailto:amoatwi...@gmail.com]
>Sent: Monday, 22 June, 2020 22:30
>To: Viechtbauer, Wolfgang (SP)
>Cc: r-help@r-project.org
>Subject: Re: [R] Error message in meta-analysis package Metafor-weights =""
>
>Hi Wolfgang and All,
>I am still practising my meta-analysis with the "Metafor" package, I tried
>to run the code for "Forest plot" and got error message as shown below:
>forest(result.md)
>> forest(result.md)
>Error in UseMethod("forest") :
>  no applicable method for 'forest' applied to an object of class
>"c('rma.uni', 'rma')"
>
>Thank you in advance for your support
>
>regards
>Kobby
>
>On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP)
> wrote:
>Dear Amoatwi,
>
>This way of using the escalc() function has been deprecated. It might be
>added back once there is actually any benefit from having this
>functionality, but for years it just meant that I had to maintain two
>different ways of doing the exact same thing without any additional
>benefits.
>
>Best,
>Wolfgang
>
>--
>Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
>Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
>Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
>
>>-Original Message-
>>From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of K Amoatwi
>>Sent: Tuesday, 16 June, 2020 4:50
>>To: r-help@r-project.org
>>Subject: [R] Error message in meta-analysis package Metafor-weights =""
>>
>>Dear All,
>>I am using the example from one of the tutorial about "Metafor" package and
>>"escalc" function, to learn how this package can be applied to do
>>meta-analysi; the code and the data is directly from the tutorials but
>>"weights=freq" option in the escalc function is given me error message
>>This is the code below:
>>
>>library(metafor) # Load package
>>#DATASET 1: BCG Vaccine Trials
>>data(dat.bcg) # BCG meta-analytic dataset
>>
>>##Formula based Specification
>>##That is, what if I have multiple rows per study, corresponding to
>>difference treatment groups?
>>
>>library(reshape2) # Load package for data reshaping
>>
>>bcg.long <- melt(dat.bcg[, c("trial", "tpos", "tneg", "cpos", "cneg")], id
>>= "trial")
>>bcg.long$pos <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "cpos", 1,
>>0)
>>bcg.long$group <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "tneg",
>>1, 0)
>>
>>##sample of the data, the first 6 rows
>>head(bcg.long)
>>  trial variable value pos group
>>1     1     tpos     4     1     1
>>2     2     tpos     6     1     1
>>3     3     tpos     3     1     1
>>4     4     tpos    62    1     1
>>5     5     tpos    33    1     1
>>6     6     tpos   180   1     1
>>
>>##Now applying the " escalc " function
>>
>>escalc(factor(pos)~factor(group)| factor(trial),weights = value,data =
>>bcg.long, measure = "OR")
>>
>>##Then I got this error message
>>Error in escalc(factor(pos) ~ factor(group) | factor(trial), weights =
>>value,  :
>>  object 'value' not found
>>
>>I used the same data with different example from another author and got a
>>similar error message
>>Second code with the same data but different coding
>>Sample data
>>
>>with the first 6 rows of the rearranged data shown below. (T=treatment,
>>C=Control group, Out=outcome whether positive or negative, and then
>>frequency)
>>    study grp out freq
>>1        1    T    +      4
>>2        1    T    -    119
>>3        1    C   +      11
>>4        1    C   -     128
>>5        2    T   +        6
>>6        2    T   -      300
>>
>>>escalc(out ~ grp | study, weights = freq, data = dat.fm, measure = "OR")
>>
>>Error in escalc(out ~ grp | study, weights = freq, data = dat.fm, measure =
>>"OR") :
>>  object 'freq' not found
>>
>>I am not sure what I am doing wrong since both authors were able to get
>>their results while I am getting error messages.
>>
>>Any help will be very much appreciated
>>
>>Amoatwi
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread K Amoatwi
Dear Wolfgang,
I have posted the requested information you asked for.

>  sessionInfo()
R version 4.0.1 (2020-06-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] meta_4.12-0reshape2_1.4.4 metafor_2.4-0  Matrix_1.2-18

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6   lattice_0.20-41MASS_7.3-51.6  grid_4.0.1

 [5] plyr_1.8.6 nlme_3.1-148   magrittr_1.5   stringi_1.4.6

 [9] minqa_1.2.4nloptr_1.2.2.1 boot_1.3-25splines_4.0.1

[13] statmod_1.4.34 lme4_1.1-23tools_4.0.1stringr_1.4.0

[17] CompQuadForm_1.4.3 compiler_4.0.1
>

> class(result.md)
[1] "rma.uni" "rma"
>

Thank you
Kobby

On Tue, Jun 23, 2020 at 3:24 AM Viechtbauer, Wolfgang (SP) <
wolfgang.viechtba...@maastrichtuniversity.nl> wrote:

> Dear Kobby,
>
> Please post the output of sessionInfo() and class(result.md).
>
> Best,
> Wolfgang
>
> >-Original Message-
> >From: K Amoatwi [mailto:amoatwi...@gmail.com]
> >Sent: Monday, 22 June, 2020 22:30
> >To: Viechtbauer, Wolfgang (SP)
> >Cc: r-help@r-project.org
> >Subject: Re: [R] Error message in meta-analysis package Metafor-weights
> =""
> >
> >Hi Wolfgang and All,
> >I am still practising my meta-analysis with the "Metafor" package, I tried
> >to run the code for "Forest plot" and got error message as shown below:
> >forest(result.md)
> >> forest(result.md)
> >Error in UseMethod("forest") :
> >  no applicable method for 'forest' applied to an object of class
> >"c('rma.uni', 'rma')"
> >
> >Thank you in advance for your support
> >
> >regards
> >Kobby
> >
> >On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP)
> > wrote:
> >Dear Amoatwi,
> >
> >This way of using the escalc() function has been deprecated. It might be
> >added back once there is actually any benefit from having this
> >functionality, but for years it just meant that I had to maintain two
> >different ways of doing the exact same thing without any additional
> >benefits.
> >
> >Best,
> >Wolfgang
> >
> >--
> >Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> >Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> >Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
> >
> >>-Original Message-
> >>From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of K
> Amoatwi
> >>Sent: Tuesday, 16 June, 2020 4:50
> >>To: r-help@r-project.org
> >>Subject: [R] Error message in meta-analysis package Metafor-weights =""
> >>
> >>Dear All,
> >>I am using the example from one of the tutorial about "Metafor" package
> and
> >>"escalc" function, to learn how this package can be applied to do
> >>meta-analysi; the code and the data is directly from the tutorials but
> >>"weights=freq" option in the escalc function is given me error message
> >>This is the code below:
> >>
> >>library(metafor) # Load package
> >>#DATASET 1: BCG Vaccine Trials
> >>data(dat.bcg) # BCG meta-analytic dataset
> >>
> >>##Formula based Specification
> >>##That is, what if I have multiple rows per study, corresponding to
> >>difference treatment groups?
> >>
> >>library(reshape2) # Load package for data reshaping
> >>
> >>bcg.long <- melt(dat.bcg[, c("trial", "tpos", "tneg", "cpos", "cneg")],
> id
> >>= "trial")
> >>bcg.long$pos <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "cpos",
> 1,
> >>0)
> >>bcg.long$group <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "tneg",
> >>1, 0)
> >>
> >>##sample of the data, the first 6 rows
> >>head(bcg.long)
> >>  trial variable value pos group
> >>1 1 tpos 4 1 1
> >>2 2 tpos 6 1 1
> >>3 3 tpos 3 1 1
> >>4 4 tpos621 1
> >>5 5 tpos331 1
> >>6 6 tpos   180   1 1
> >>
> >>##Now applying the " escalc " function
> >>
> >>escalc(factor(pos)~factor(group)| factor(trial),weights = value,data =
> >>bcg.long, measure = "OR")
> >>
> >>##Then I got this error message
> >>Error in escalc(factor(pos) ~ factor(group) | factor(trial), weights =
> >>value,  :
> >>  object 'value' not found
> >>
> >>I used the same data with different example from another author and got a
> >>similar error message
> >>Second code with the same data but different coding
> >>Sample data
> >>
> >>with the first 6 rows of the rearranged data shown below. (T=treatment,
> >>C=Control group, Out=outcome whether positive or negative, and then
> >>frequency)
> >>study grp out freq
> >>11T+  4
> >>21T-119
> >>31C   +  11
> >>41C   - 128
> >>52T  

[R] Help with locating error on import of data

2020-06-23 Thread Ahson via R-help
I have imported data from an Excel file and I am getting errors:

> library(readxl)
> Balance_sheet <- read_excel("Y:/All Documents/Training/Data/Routines for 
> consolidating all the data/Individual tables/AIM 
> companies/Balance_sheet.xlsx", na = "")
New names:
* `` -> ...6
* `` -> ...7
* `` -> ...9
* `` -> ...10
* `` -> ...11
* ... and 22 more problems


How can I find where the error is originating? What does New names mean?

Thanks in advance for your help.


Sent from Mail for Windows 10


[[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] Help with locating error on import of data

2020-06-23 Thread Patrick (Malone Quantitative)
It looks like it's looking for column names in the first row of your Excel
sheet and not finding them. What does the first row contain?

On Tue, Jun 23, 2020 at 10:57 AM Ahson via R-help 
wrote:

> I have imported data from an Excel file and I am getting errors:
>
> > library(readxl)
> > Balance_sheet <- read_excel("Y:/All Documents/Training/Data/Routines for
> consolidating all the data/Individual tables/AIM
> companies/Balance_sheet.xlsx", na = "")
> New names:
> * `` -> ...6
> * `` -> ...7
> * `` -> ...9
> * `` -> ...10
> * `` -> ...11
> * ... and 22 more problems
>
>
> How can I find where the error is originating? What does New names mean?
>
> Thanks in advance for your help.
>
>
> Sent from Mail for Windows 10
>
>
> [[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.
>


-- 
Patrick S. Malone, Ph.D., Malone Quantitative
NEW Service Models: http://malonequantitative.com

He/Him/His

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread Viechtbauer, Wolfgang (SP)
You have loaded the 'meta' package after 'metafor' and then forest() will try 
to use the corresponding function from the meta package and not metafor. With:

metafor::forest(result.md)

it should work.

Best,
Wolfgang

>-Original Message-
>From: K Amoatwi [mailto:amoatwi...@gmail.com]
>Sent: Tuesday, 23 June, 2020 16:37
>To: Viechtbauer, Wolfgang (SP)
>Cc: r-help@r-project.org
>Subject: Re: [R] Error message in meta-analysis package Metafor-weights =""
>
>Dear Wolfgang,
>I have posted the requested information you asked for.
>
>>  sessionInfo()
>R version 4.0.1 (2020-06-06)
>Platform: x86_64-w64-mingw32/x64 (64-bit)
>Running under: Windows 10 x64 (build 18362)
>
>Matrix products: default
>
>locale:
>[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>States.1252
>[3] LC_MONETARY=English_United States.1252
>LC_NUMERIC=C
>[5] LC_TIME=English_United States.1252
>
>attached base packages:
>[1] stats     graphics  grDevices utils     datasets  methods   base
>
>other attached packages:
>[1] meta_4.12-0    reshape2_1.4.4 metafor_2.4-0  Matrix_1.2-18
>
>loaded via a namespace (and not attached):
> [1] Rcpp_1.0.4.6       lattice_0.20-41    MASS_7.3-
>51.6      grid_4.0.1
> [5] plyr_1.8.6         nlme_3.1-
>148       magrittr_1.5       stringi_1.4.6
> [9] minqa_1.2.4        nloptr_1.2.2.1     boot_1.3-
>25        splines_4.0.1
>[13] statmod_1.4.34     lme4_1.1-
>23        tools_4.0.1        stringr_1.4.0
>[17] CompQuadForm_1.4.3 compiler_4.0.1
>>
>
>> class(result.md)
>[1] "rma.uni" "rma"
>>
>
>Thank you
>Kobby
>
>On Tue, Jun 23, 2020 at 3:24 AM Viechtbauer, Wolfgang (SP)
> wrote:
>Dear Kobby,
>
>Please post the output of sessionInfo() and class(result.md).
>
>Best,
>Wolfgang
>
>>-Original Message-
>>From: K Amoatwi [mailto:amoatwi...@gmail.com]
>>Sent: Monday, 22 June, 2020 22:30
>>To: Viechtbauer, Wolfgang (SP)
>>Cc: r-help@r-project.org
>>Subject: Re: [R] Error message in meta-analysis package Metafor-weights =""
>>
>>Hi Wolfgang and All,
>>I am still practising my meta-analysis with the "Metafor" package, I tried
>>to run the code for "Forest plot" and got error message as shown below:
>>forest(result.md)
>>> forest(result.md)
>>Error in UseMethod("forest") :
>>  no applicable method for 'forest' applied to an object of class
>>"c('rma.uni', 'rma')"
>>
>>Thank you in advance for your support
>>
>>regards
>>Kobby
>>
>>On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP)
>> wrote:
>>Dear Amoatwi,
>>
>>This way of using the escalc() function has been deprecated. It might be
>>added back once there is actually any benefit from having this
>>functionality, but for years it just meant that I had to maintain two
>>different ways of doing the exact same thing without any additional
>>benefits.
>>
>>Best,
>>Wolfgang
>>
>>--
>>Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
>>Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
>>Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
>>
>>>-Original Message-
>>>From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of K Amoatwi
>>>Sent: Tuesday, 16 June, 2020 4:50
>>>To: r-help@r-project.org
>>>Subject: [R] Error message in meta-analysis package Metafor-weights =""
>>>
>>>Dear All,
>>>I am using the example from one of the tutorial about "Metafor" package
>and
>>>"escalc" function, to learn how this package can be applied to do
>>>meta-analysi; the code and the data is directly from the tutorials but
>>>"weights=freq" option in the escalc function is given me error message
>>>This is the code below:
>>>
>>>library(metafor) # Load package
>>>#DATASET 1: BCG Vaccine Trials
>>>data(dat.bcg) # BCG meta-analytic dataset
>>>
>>>##Formula based Specification
>>>##That is, what if I have multiple rows per study, corresponding to
>>>difference treatment groups?
>>>
>>>library(reshape2) # Load package for data reshaping
>>>
>>>bcg.long <- melt(dat.bcg[, c("trial", "tpos", "tneg", "cpos", "cneg")], id
>>>= "trial")
>>>bcg.long$pos <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "cpos", 1,
>>>0)
>>>bcg.long$group <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "tneg",
>>>1, 0)
>>>
>>>##sample of the data, the first 6 rows
>>>head(bcg.long)
>>>  trial variable value pos group
>>>1     1     tpos     4     1     1
>>>2     2     tpos     6     1     1
>>>3     3     tpos     3     1     1
>>>4     4     tpos    62    1     1
>>>5     5     tpos    33    1     1
>>>6     6     tpos   180   1     1
>>>
>>>##Now applying the " escalc " function
>>>
>>>escalc(factor(pos)~factor(group)| factor(trial),weights = value,data =
>>>bcg.long, measure = "OR")
>>>
>>>##Then I got this error message
>>>Error in escalc(factor(pos) ~ factor(group) | factor(trial), weights =
>>>value,  :
>>>  object 'value' not found
>>>
>>>I used the same data with different example from another author and got a
>>>similar error message
>>>Second code with the same data but different coding
>>

Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread K Amoatwi
Dear Wolfgang,
Yes! The "metafor::forest(result.md)" works

Thank you very much.

Any reason why "forest(result.md)" was not working?

Kobby

On Tue, Jun 23, 2020 at 11:18 AM Viechtbauer, Wolfgang (SP) <
wolfgang.viechtba...@maastrichtuniversity.nl> wrote:

> You have loaded the 'meta' package after 'metafor' and then forest() will
> try to use the corresponding function from the meta package and not
> metafor. With:
>
> metafor::forest(result.md)
>
> it should work.
>
> Best,
> Wolfgang
>
> >-Original Message-
> >From: K Amoatwi [mailto:amoatwi...@gmail.com]
> >Sent: Tuesday, 23 June, 2020 16:37
> >To: Viechtbauer, Wolfgang (SP)
> >Cc: r-help@r-project.org
> >Subject: Re: [R] Error message in meta-analysis package Metafor-weights
> =""
> >
> >Dear Wolfgang,
> >I have posted the requested information you asked for.
> >
> >>  sessionInfo()
> >R version 4.0.1 (2020-06-06)
> >Platform: x86_64-w64-mingw32/x64 (64-bit)
> >Running under: Windows 10 x64 (build 18362)
> >
> >Matrix products: default
> >
> >locale:
> >[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> >States.1252
> >[3] LC_MONETARY=English_United States.1252
> >LC_NUMERIC=C
> >[5] LC_TIME=English_United States.1252
> >
> >attached base packages:
> >[1] stats graphics  grDevices utils datasets  methods   base
> >
> >other attached packages:
> >[1] meta_4.12-0reshape2_1.4.4 metafor_2.4-0  Matrix_1.2-18
> >
> >loaded via a namespace (and not attached):
> > [1] Rcpp_1.0.4.6   lattice_0.20-41MASS_7.3-
> >51.6  grid_4.0.1
> > [5] plyr_1.8.6 nlme_3.1-
> >148   magrittr_1.5   stringi_1.4.6
> > [9] minqa_1.2.4nloptr_1.2.2.1 boot_1.3-
> >25splines_4.0.1
> >[13] statmod_1.4.34 lme4_1.1-
> >23tools_4.0.1stringr_1.4.0
> >[17] CompQuadForm_1.4.3 compiler_4.0.1
> >>
> >
> >> class(result.md)
> >[1] "rma.uni" "rma"
> >>
> >
> >Thank you
> >Kobby
> >
> >On Tue, Jun 23, 2020 at 3:24 AM Viechtbauer, Wolfgang (SP)
> > wrote:
> >Dear Kobby,
> >
> >Please post the output of sessionInfo() and class(result.md).
> >
> >Best,
> >Wolfgang
> >
> >>-Original Message-
> >>From: K Amoatwi [mailto:amoatwi...@gmail.com]
> >>Sent: Monday, 22 June, 2020 22:30
> >>To: Viechtbauer, Wolfgang (SP)
> >>Cc: r-help@r-project.org
> >>Subject: Re: [R] Error message in meta-analysis package Metafor-weights
> =""
> >>
> >>Hi Wolfgang and All,
> >>I am still practising my meta-analysis with the "Metafor" package, I
> tried
> >>to run the code for "Forest plot" and got error message as shown below:
> >>forest(result.md)
> >>> forest(result.md)
> >>Error in UseMethod("forest") :
> >>  no applicable method for 'forest' applied to an object of class
> >>"c('rma.uni', 'rma')"
> >>
> >>Thank you in advance for your support
> >>
> >>regards
> >>Kobby
> >>
> >>On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP)
> >> wrote:
> >>Dear Amoatwi,
> >>
> >>This way of using the escalc() function has been deprecated. It might be
> >>added back once there is actually any benefit from having this
> >>functionality, but for years it just meant that I had to maintain two
> >>different ways of doing the exact same thing without any additional
> >>benefits.
> >>
> >>Best,
> >>Wolfgang
> >>
> >>--
> >>Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
> >>Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
> >>Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com
> >>
> >>>-Original Message-
> >>>From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of K
> Amoatwi
> >>>Sent: Tuesday, 16 June, 2020 4:50
> >>>To: r-help@r-project.org
> >>>Subject: [R] Error message in meta-analysis package Metafor-weights =""
> >>>
> >>>Dear All,
> >>>I am using the example from one of the tutorial about "Metafor" package
> >and
> >>>"escalc" function, to learn how this package can be applied to do
> >>>meta-analysi; the code and the data is directly from the tutorials but
> >>>"weights=freq" option in the escalc function is given me error message
> >>>This is the code below:
> >>>
> >>>library(metafor) # Load package
> >>>#DATASET 1: BCG Vaccine Trials
> >>>data(dat.bcg) # BCG meta-analytic dataset
> >>>
> >>>##Formula based Specification
> >>>##That is, what if I have multiple rows per study, corresponding to
> >>>difference treatment groups?
> >>>
> >>>library(reshape2) # Load package for data reshaping
> >>>
> >>>bcg.long <- melt(dat.bcg[, c("trial", "tpos", "tneg", "cpos", "cneg")],
> id
> >>>= "trial")
> >>>bcg.long$pos <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "cpos",
> 1,
> >>>0)
> >>>bcg.long$group <- ifelse(bcg.long$var == "tpos" | bcg.long$var ==
> "tneg",
> >>>1, 0)
> >>>
> >>>##sample of the data, the first 6 rows
> >>>head(bcg.long)
> >>>  trial variable value pos group
> >>>1 1 tpos 4 1 1
> >>>2 2 tpos 6 1 1
> >>>3 3 tpos 3 1 1
> >>>4 4 tpos

Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread Michael Dewey
The two packages both define a function forest. When you load the second 
package R will have told you that it was masking the definition of 
forest from the first package. If you had loaded them in the other order 
it would have masked the other one.


In fact it masked seven functions in total in this case as the message 
told you.


Michael

On 23/06/2020 16:29, K Amoatwi wrote:

Dear Wolfgang,
Yes! The "metafor::forest(result.md)" works

Thank you very much.

Any reason why "forest(result.md)" was not working?

Kobby

On Tue, Jun 23, 2020 at 11:18 AM Viechtbauer, Wolfgang (SP) <
wolfgang.viechtba...@maastrichtuniversity.nl> wrote:


You have loaded the 'meta' package after 'metafor' and then forest() will
try to use the corresponding function from the meta package and not
metafor. With:

metafor::forest(result.md)

it should work.

Best,
Wolfgang


-Original Message-
From: K Amoatwi [mailto:amoatwi...@gmail.com]
Sent: Tuesday, 23 June, 2020 16:37
To: Viechtbauer, Wolfgang (SP)
Cc: r-help@r-project.org
Subject: Re: [R] Error message in meta-analysis package Metafor-weights

=""


Dear Wolfgang,
I have posted the requested information you asked for.


  sessionInfo()

R version 4.0.1 (2020-06-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252
LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] meta_4.12-0reshape2_1.4.4 metafor_2.4-0  Matrix_1.2-18

loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6   lattice_0.20-41MASS_7.3-
51.6  grid_4.0.1
[5] plyr_1.8.6 nlme_3.1-
148   magrittr_1.5   stringi_1.4.6
[9] minqa_1.2.4nloptr_1.2.2.1 boot_1.3-
25splines_4.0.1
[13] statmod_1.4.34 lme4_1.1-
23tools_4.0.1stringr_1.4.0
[17] CompQuadForm_1.4.3 compiler_4.0.1





class(result.md)

[1] "rma.uni" "rma"




Thank you
Kobby

On Tue, Jun 23, 2020 at 3:24 AM Viechtbauer, Wolfgang (SP)
 wrote:
Dear Kobby,

Please post the output of sessionInfo() and class(result.md).

Best,
Wolfgang


-Original Message-
From: K Amoatwi [mailto:amoatwi...@gmail.com]
Sent: Monday, 22 June, 2020 22:30
To: Viechtbauer, Wolfgang (SP)
Cc: r-help@r-project.org
Subject: Re: [R] Error message in meta-analysis package Metafor-weights

=""


Hi Wolfgang and All,
I am still practising my meta-analysis with the "Metafor" package, I

tried

to run the code for "Forest plot" and got error message as shown below:
forest(result.md)

forest(result.md)

Error in UseMethod("forest") :
  no applicable method for 'forest' applied to an object of class
"c('rma.uni', 'rma')"

Thank you in advance for your support

regards
Kobby

On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP)
 wrote:
Dear Amoatwi,

This way of using the escalc() function has been deprecated. It might be
added back once there is actually any benefit from having this
functionality, but for years it just meant that I had to maintain two
different ways of doing the exact same thing without any additional
benefits.

Best,
Wolfgang

--
Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry and
Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200 MD
Maastricht, The Netherlands | +31 (43) 388-4170 | http://www.wvbauer.com


-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of K

Amoatwi

Sent: Tuesday, 16 June, 2020 4:50
To: r-help@r-project.org
Subject: [R] Error message in meta-analysis package Metafor-weights =""

Dear All,
I am using the example from one of the tutorial about "Metafor" package

and

"escalc" function, to learn how this package can be applied to do
meta-analysi; the code and the data is directly from the tutorials but
"weights=freq" option in the escalc function is given me error message
This is the code below:

library(metafor) # Load package
#DATASET 1: BCG Vaccine Trials
data(dat.bcg) # BCG meta-analytic dataset

##Formula based Specification
##That is, what if I have multiple rows per study, corresponding to
difference treatment groups?

library(reshape2) # Load package for data reshaping

bcg.long <- melt(dat.bcg[, c("trial", "tpos", "tneg", "cpos", "cneg")],

id

= "trial")
bcg.long$pos <- ifelse(bcg.long$var == "tpos" | bcg.long$var == "cpos",

1,

0)
bcg.long$group <- ifelse(bcg.long$var == "tpos" | bcg.long$var ==

"tneg",

1, 0)

##sample of the data, the first 6 rows
head(bcg.long)
  trial variable value pos group
1 1 tpos 4 1 1
2 2 tpos 6 1 1
3 3 tpos 3 1 1
4 4 tpos621 1
5 5 tpos331 1
6 6 tpos   180   1 1

##Now applying the " escalc " function

escalc(factor(pos)~fac

Re: [R] Error message in meta-analysis package Metafor-weights =""

2020-06-23 Thread K Amoatwi
Thank Michael and Wolfgang, very much appreciated.

Kobby

On Tue, Jun 23, 2020 at 11:39 AM Michael Dewey 
wrote:

> The two packages both define a function forest. When you load the second
> package R will have told you that it was masking the definition of
> forest from the first package. If you had loaded them in the other order
> it would have masked the other one.
>
> In fact it masked seven functions in total in this case as the message
> told you.
>
> Michael
>
> On 23/06/2020 16:29, K Amoatwi wrote:
> > Dear Wolfgang,
> > Yes! The "metafor::forest(result.md)" works
> >
> > Thank you very much.
> >
> > Any reason why "forest(result.md)" was not working?
> >
> > Kobby
> >
> > On Tue, Jun 23, 2020 at 11:18 AM Viechtbauer, Wolfgang (SP) <
> > wolfgang.viechtba...@maastrichtuniversity.nl> wrote:
> >
> >> You have loaded the 'meta' package after 'metafor' and then forest()
> will
> >> try to use the corresponding function from the meta package and not
> >> metafor. With:
> >>
> >> metafor::forest(result.md)
> >>
> >> it should work.
> >>
> >> Best,
> >> Wolfgang
> >>
> >>> -Original Message-
> >>> From: K Amoatwi [mailto:amoatwi...@gmail.com]
> >>> Sent: Tuesday, 23 June, 2020 16:37
> >>> To: Viechtbauer, Wolfgang (SP)
> >>> Cc: r-help@r-project.org
> >>> Subject: Re: [R] Error message in meta-analysis package Metafor-weights
> >> =""
> >>>
> >>> Dear Wolfgang,
> >>> I have posted the requested information you asked for.
> >>>
>    sessionInfo()
> >>> R version 4.0.1 (2020-06-06)
> >>> Platform: x86_64-w64-mingw32/x64 (64-bit)
> >>> Running under: Windows 10 x64 (build 18362)
> >>>
> >>> Matrix products: default
> >>>
> >>> locale:
> >>> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> >>> States.1252
> >>> [3] LC_MONETARY=English_United States.1252
> >>> LC_NUMERIC=C
> >>> [5] LC_TIME=English_United States.1252
> >>>
> >>> attached base packages:
> >>> [1] stats graphics  grDevices utils datasets  methods   base
> >>>
> >>> other attached packages:
> >>> [1] meta_4.12-0reshape2_1.4.4 metafor_2.4-0  Matrix_1.2-18
> >>>
> >>> loaded via a namespace (and not attached):
> >>> [1] Rcpp_1.0.4.6   lattice_0.20-41MASS_7.3-
> >>> 51.6  grid_4.0.1
> >>> [5] plyr_1.8.6 nlme_3.1-
> >>> 148   magrittr_1.5   stringi_1.4.6
> >>> [9] minqa_1.2.4nloptr_1.2.2.1 boot_1.3-
> >>> 25splines_4.0.1
> >>> [13] statmod_1.4.34 lme4_1.1-
> >>> 23tools_4.0.1stringr_1.4.0
> >>> [17] CompQuadForm_1.4.3 compiler_4.0.1
> 
> >>>
>  class(result.md)
> >>> [1] "rma.uni" "rma"
> 
> >>>
> >>> Thank you
> >>> Kobby
> >>>
> >>> On Tue, Jun 23, 2020 at 3:24 AM Viechtbauer, Wolfgang (SP)
> >>>  wrote:
> >>> Dear Kobby,
> >>>
> >>> Please post the output of sessionInfo() and class(result.md).
> >>>
> >>> Best,
> >>> Wolfgang
> >>>
>  -Original Message-
>  From: K Amoatwi [mailto:amoatwi...@gmail.com]
>  Sent: Monday, 22 June, 2020 22:30
>  To: Viechtbauer, Wolfgang (SP)
>  Cc: r-help@r-project.org
>  Subject: Re: [R] Error message in meta-analysis package
> Metafor-weights
> >> =""
> 
>  Hi Wolfgang and All,
>  I am still practising my meta-analysis with the "Metafor" package, I
> >> tried
>  to run the code for "Forest plot" and got error message as shown
> below:
>  forest(result.md)
> > forest(result.md)
>  Error in UseMethod("forest") :
>    no applicable method for 'forest' applied to an object of class
>  "c('rma.uni', 'rma')"
> 
>  Thank you in advance for your support
> 
>  regards
>  Kobby
> 
>  On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP)
>   wrote:
>  Dear Amoatwi,
> 
>  This way of using the escalc() function has been deprecated. It might
> be
>  added back once there is actually any benefit from having this
>  functionality, but for years it just meant that I had to maintain two
>  different ways of doing the exact same thing without any additional
>  benefits.
> 
>  Best,
>  Wolfgang
> 
>  --
>  Wolfgang Viechtbauer, Ph.D., Statistician | Department of Psychiatry
> and
>  Neuropsychology | Maastricht University | P.O. Box 616 (VIJV1) | 6200
> MD
>  Maastricht, The Netherlands | +31 (43) 388-4170 |
> http://www.wvbauer.com
> 
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of K
> >> Amoatwi
> > Sent: Tuesday, 16 June, 2020 4:50
> > To: r-help@r-project.org
> > Subject: [R] Error message in meta-analysis package Metafor-weights
> =""
> >
> > Dear All,
> > I am using the example from one of the tutorial about "Metafor"
> package
> >>> and
> > "escalc" function, to learn how this package can be applied to do
> > meta-analysi; the code and the data is directly from the tutorials
> but
> > "weights=freq" option in the escalc function is given me erro

Re: [R] Help with locating error on import of data

2020-06-23 Thread Rui Barradas

Hello,

Try setting argument col.names = FALSE, it seems that the function is 
not find column headers and is choosing its own.



Balance_sheet <- read_excel("Y:/All Documents/Training/Data/Routines for 
consolidating all the data/Individual tables/AIM 
companies/Balance_sheet.xlsx", na = "", col_names = FALSE)



Hope this helps,

Rui Barradas

Às 15:56 de 23/06/2020, Ahson via R-help escreveu:

I have imported data from an Excel file and I am getting errors:


library(readxl)
Balance_sheet <- read_excel("Y:/All Documents/Training/Data/Routines for consolidating all the 
data/Individual tables/AIM companies/Balance_sheet.xlsx", na = "")

New names:
* `` -> ...6
* `` -> ...7
* `` -> ...9
* `` -> ...10
* `` -> ...11
* ... and 22 more problems


How can I find where the error is originating? What does New names mean?

Thanks in advance for your help.


Sent from Mail for Windows 10


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


--
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
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] RLQ and data.frame scores PCA

2020-06-23 Thread Adriana Acero
Hi everybody,

My name is Adriana and I'm working with Community Ecology and Geometric
morphometric of bats.

At this moment, I'm trying to perform an RLQ analysis with ADE4, with a
data frame that already contains the mean shape scores (PCA) of some
species of bats (Matriz Q).

I couldn't do the PCA into ADE4 because I'm working with landmarks and the
structure of the data is a multidimensional array, so the PCA comes from
Geomorph. I save only the scores in a data frame. I'm searching on the
internet for solutions but I don't find How to do an RLQ with my data.frame
or how to transform it in a dudi object without doing an extra analysis.

I appreciate your help.

Thanks

Adriana Acero

[[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] How to convert column from millisecond epoch time to yyyy-mm-dd GMT

2020-06-23 Thread Gregg via R-help
Hello to all the smart people out there

I have a data.frame labeled itsm_service_type_field. I need to convert the 
Timestamp field which is epoch time in milliseconds to a -mm-dd GMT Date. 

Data.frame format is below.

I've attempted to use the lapply and as.POSIXct functions to convert the time 
field in the original data.frame to a new data.frame I've labeled 
"itsm_service_type_field_adjusted_time",
but I've got the order and syntax wrong.

Help would be so much appreciated.

Thanks in advance.
Gregg
Arizona

Details - See Below:

itsm_service_type_field <- fread("itsm_service_type_2018-2019_CONUS.csv")

>???itsm_service_type_field_adjusted_time <- 
>lapply(itsm_service_type_field[ , Timestamp], 
>as.POSIXct(Timestamp, origin="1970-01-01", tz="GMT"))

head(itsm_service_type_field)
    Id                              Timestamp         Data Type Visibility      
                TYPE_SERVICE
1: INCBR0005072277 157705920 itsm-ticket U&FOUO&USA    0
2: INCBR0005073034 157705920 itsm-ticket U&FOUO&USA    1
3: INCBR0005073131 157705920 itsm-ticket U&FOUO&USA    0
4: INCBR0005074186 157705920 itsm-ticket U&FOUO&USA    0
5: INCBR0005074188 157705920 itsm-ticket U&FOUO&USA    0
6: INCBR0005074546 157705920 itsm-ticket U&FOUO&USA    0

signature.asc
Description: OpenPGP digital signature
__
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 create path for OpenBUGS into R using R2OpenBUGS with new Wineskin-Winery 1.8.4.1/Wineskin2.9.06-1 on MacOS Catalina 10.15.5

2020-06-23 Thread Jordan Rogan
Hi!

I recently downloaded the new Wineskin-Winery 1.8.4.1/Wineskin2.9.06-1 onto
my mac adapted for the limitations for MacOS Catalina 10.15.5 that caused
old versions of Wine to no longer work. I downloaded it so that I could
download the Windows program OpenBUGS and use R2openBUGS in R to use the
program. I am not very experienced with R, and I am trying to figure out
how to call OpenBUGS into R with R2OpenBUGS with the new
wineskin/wineskin-winery version. I found older code using the Wine
argument in R2OpenBuGS, but I think the path has significantly changed with
the new version of Wineskin which is not downloaded using homebrew as old
versions of Wine were. I think I just need to figure out how to create the
correct path for the new version of wine--I do not know if this is possible
using the old wine argument designed for older versions of wine.

I downloaded the new Wineskin from here:
https://github.com/Gcenx/WineskinServer/releases

The old path for OpenBUGS and R2OpenBUGS for older versions of wine I found
were: WINE="/usr/local/Cellar/wine/2.0.4/bin/wine"
WINEPATH="/usr/local/Cellar/wine/2.0.4/bin/winepath"
OpenBUGS.pgm="/Applications/OpenBUGS323/OpenBUGS.exe"

But trying to do the same, I received the error message: "Error in
bugs(spp.data, inits, params, "model1.txt", debug = T, n.chains = nc, : *unused
argument (OpenBUGS.pgm = bugs)"*

Part of my confusion is what the difference is between the arguments "wine"
and "winepath". There is also an argument "newWINE" that says: "Use new
versions of Wine that have ‘winepath’ utility", but I don't know if my
version of wine has this, and how this argument is then written.

If I go to the "get info" on where my wineskin app is on my computer, the
path is (while redacting my name)
"/Users/firstname_lastname/Applications/Wineskin/Wineskin-2.9.0.7.app".
Maybe this would work? But I don't know if this would be in the argument
for wine, or winepath.

I think perhaps if I can adapt the path, it will work. But I'm not sure
exactly what is needed, particularly for the new version of wine for MacOS
Catalina, and if the old wine arguments even work with the new version of
wine. If anyone could help I would sincerely appreciate it. Thanks!!

-- 
Jordan Rogan

Ph.D. Candidate, Applied Biodiversity Sciences
Department of Ecology and Conservation Biology (ECCB)
Texas A&M University
Website: jordanrogan.wordpress.com | Twitter: @jordrogan | Skype: jord0123

[[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] Help with locating error on import of data

2020-06-23 Thread jim holtman
one of the problems with Excel is that people can put anything in any
column.  You might want to restrict which columns you are reading
since if it finds data in some cells and there is not a header, it
will create one.

Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

On Tue, Jun 23, 2020 at 8:09 AM Patrick (Malone Quantitative)
 wrote:
>
> It looks like it's looking for column names in the first row of your Excel
> sheet and not finding them. What does the first row contain?
>
> On Tue, Jun 23, 2020 at 10:57 AM Ahson via R-help 
> wrote:
>
> > I have imported data from an Excel file and I am getting errors:
> >
> > > library(readxl)
> > > Balance_sheet <- read_excel("Y:/All Documents/Training/Data/Routines for
> > consolidating all the data/Individual tables/AIM
> > companies/Balance_sheet.xlsx", na = "")
> > New names:
> > * `` -> ...6
> > * `` -> ...7
> > * `` -> ...9
> > * `` -> ...10
> > * `` -> ...11
> > * ... and 22 more problems
> >
> >
> > How can I find where the error is originating? What does New names mean?
> >
> > Thanks in advance for your help.
> >
> >
> > Sent from Mail for Windows 10
> >
> >
> > [[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.
> >
>
>
> --
> Patrick S. Malone, Ph.D., Malone Quantitative
> NEW Service Models: http://malonequantitative.com
>
> He/Him/His
>
> [[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] How to convert column from millisecond epoch time to yyyy-mm-dd GMT

2020-06-23 Thread Enrico Schumann
On Tue, 23 Jun 2020, Gregg via R-help writes:

> Hello to all the smart people out there
>
> I have a data.frame labeled itsm_service_type_field. I need to convert
> the Timestamp field which is epoch time in milliseconds to a
> -mm-dd GMT Date. 
>
> Data.frame format is below.
>
> I've attempted to use the lapply and as.POSIXct
> functions to convert the time field in the original
> data.frame to a new data.frame I've labeled
> "itsm_service_type_field_adjusted_time",
> but I've got the order and syntax wrong.
>
> Help would be so much appreciated.
>
> Thanks in advance.
> Gregg
> Arizona
>
> Details - See Below:
>
> itsm_service_type_field <- fread("itsm_service_type_2018-2019_CONUS.csv")
>
>>???itsm_service_type_field_adjusted_time <- 
>>lapply(itsm_service_type_field[ , Timestamp], 
>>as.POSIXct(Timestamp, origin="1970-01-01", tz="GMT"))
>
> head(itsm_service_type_field)
>     Id                              Timestamp         Data Type Visibility    
>                   TYPE_SERVICE
> 1: INCBR0005072277 157705920 itsm-ticket U&FOUO&USA    0
> 2: INCBR0005073034 157705920 itsm-ticket U&FOUO&USA    1
> 3: INCBR0005073131 157705920 itsm-ticket U&FOUO&USA    0
> 4: INCBR0005074186 157705920 itsm-ticket U&FOUO&USA    0
> 5: INCBR0005074188 157705920 itsm-ticket U&FOUO&USA    0
> 6: INCBR0005074546 157705920 itsm-ticket U&FOUO&USA    0
>

You should divide by 1000:

.POSIXct(157705920/1000, tz = "GMT")
## [1] "2019-12-23 GMT"

as.POSIXct(157705920/1000,
   origin = as.POSIXct("1970-01-01 00:00:00", tz = "GMT"),
   tz = "GMT")
## [1] "2019-12-23 GMT"


-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

__
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 convert column from millisecond epoch time to yyyy-mm-dd GMT

2020-06-23 Thread William Dunlap via R-help
When you give an example it really helps to (a) show the data as the output
of dput() or dump() so one can copy and paste into R and (b) show the
result (the wrong value or error message) that you got.

You example is missing some quotes and has an unneeded call to lapply().

> dump("Data", file=stdout())
Data <-
structure(list(Id = c("INCBR0005072277", "INCBR0005073034",
"INCBR0005073131",
"INCBR0005074186", "INCBR0005074188"), Timestamp = c(157705920,
157705920, 157705920, 157705920, 157705920),
`Data Type` = c("itsm-ticket", "itsm-ticket", "itsm-ticket",
"itsm-ticket", "itsm-ticket"), Visibility = c("U&FOUO&USA",
"U&FOUO&USA", "U&FOUO&USA", "U&FOUO&USA", "U&FOUO&USA"),
TYPE_SERVER = c(0L, 1L, 0L, 0L, 0L)), row.names = c(NA, -5L
), class = "data.frame")
> str(as.POSIXct(Data$Timestamp/1000,
origin=as.POSIXct("1970-01-01",tz="UTC"), tz="UTC"))
 POSIXct[1:5], format: "2019-12-23" "2019-12-23" "2019-12-23" "2019-12-23"
"2019-12-23"

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Tue, Jun 23, 2020 at 11:24 AM Gregg via R-help 
wrote:

> Hello to all the smart people out there
>
> I have a data.frame labeled itsm_service_type_field. I need to convert the
> Timestamp field which is epoch time in milliseconds to a -mm-dd GMT
> Date.
>
> Data.frame format is below.
>
> I've attempted to use the lapply and as.POSIXct functions to convert the
> time field in the original data.frame to a new data.frame I've labeled
> "itsm_service_type_field_adjusted_time",
> but I've got the order and syntax wrong.
>
> Help would be so much appreciated.
>
> Thanks in advance.
> Gregg
> Arizona
>
> Details - See Below:
>
> itsm_service_type_field <- fread("itsm_service_type_2018-2019_CONUS.csv")
>
> >???itsm_service_type_field_adjusted_time <-
> lapply(itsm_service_type_field[ , Timestamp], as.POSIXct(Timestamp,
> origin="1970-01-01", tz="GMT"))
>
> head(itsm_service_type_field)
> Id  Timestamp Data Type
> Visibility  TYPE_SERVICE
> 1: INCBR0005072277 157705920 itsm-ticket U&FOUO&USA0
> 2: INCBR0005073034 157705920 itsm-ticket U&FOUO&USA1
> 3: INCBR0005073131 157705920 itsm-ticket U&FOUO&USA0
> 4: INCBR0005074186 157705920 itsm-ticket U&FOUO&USA0
> 5: INCBR0005074188 157705920 itsm-ticket U&FOUO&USA0
> 6: INCBR0005074546 157705920 itsm-ticket U&FOUO&USA
> 0__
> 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] How to create path for OpenBUGS into R using R2OpenBUGS with new Wineskin-Winery 1.8.4.1/Wineskin2.9.06-1 on MacOS Catalina 10.15.5

2020-06-23 Thread Jeff Newmiller
While you might get lucky here, there are two indicators in your post that 
suggest a different venue would be appropriate: one is that your question is 
very specific regarding a contributed package... this venue is about the 
language and base packages. Second, your customized (Wine+MacOSX) platform is 
very non-standard, though the nearest hit in the mailing lists may be r-sig-mac 
or r-sig-debian, since users on either of those platforms might have been 
tempted to use Wine at some point. But really you may need to ask in a 
Wine-specific mailing list because this smells like Wine-vs-Catalina 
incompatibility rather than an R issue.

On June 23, 2020 10:09:43 AM PDT, Jordan Rogan  wrote:
>Hi!
>
>I recently downloaded the new Wineskin-Winery 1.8.4.1/Wineskin2.9.06-1
>onto
>my mac adapted for the limitations for MacOS Catalina 10.15.5 that
>caused
>old versions of Wine to no longer work. I downloaded it so that I could
>download the Windows program OpenBUGS and use R2openBUGS in R to use
>the
>program. I am not very experienced with R, and I am trying to figure
>out
>how to call OpenBUGS into R with R2OpenBUGS with the new
>wineskin/wineskin-winery version. I found older code using the Wine
>argument in R2OpenBuGS, but I think the path has significantly changed
>with
>the new version of Wineskin which is not downloaded using homebrew as
>old
>versions of Wine were. I think I just need to figure out how to create
>the
>correct path for the new version of wine--I do not know if this is
>possible
>using the old wine argument designed for older versions of wine.
>
>I downloaded the new Wineskin from here:
>https://github.com/Gcenx/WineskinServer/releases
>
>The old path for OpenBUGS and R2OpenBUGS for older versions of wine I
>found
>were: WINE="/usr/local/Cellar/wine/2.0.4/bin/wine"
>WINEPATH="/usr/local/Cellar/wine/2.0.4/bin/winepath"
>OpenBUGS.pgm="/Applications/OpenBUGS323/OpenBUGS.exe"
>
>But trying to do the same, I received the error message: "Error in
>bugs(spp.data, inits, params, "model1.txt", debug = T, n.chains = nc, :
>*unused
>argument (OpenBUGS.pgm = bugs)"*
>
>Part of my confusion is what the difference is between the arguments
>"wine"
>and "winepath". There is also an argument "newWINE" that says: "Use new
>versions of Wine that have ‘winepath’ utility", but I don't know if my
>version of wine has this, and how this argument is then written.
>
>If I go to the "get info" on where my wineskin app is on my computer,
>the
>path is (while redacting my name)
>"/Users/firstname_lastname/Applications/Wineskin/Wineskin-2.9.0.7.app".
>Maybe this would work? But I don't know if this would be in the
>argument
>for wine, or winepath.
>
>I think perhaps if I can adapt the path, it will work. But I'm not sure
>exactly what is needed, particularly for the new version of wine for
>MacOS
>Catalina, and if the old wine arguments even work with the new version
>of
>wine. If anyone could help I would sincerely appreciate it. Thanks!!

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

__
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] RLQ and data.frame scores PCA

2020-06-23 Thread Bert Gunter
Wrong list. This list is for general R programming. Few of us here will
have a clue about RLQ analysis and other subject specific methodology. I
suggest you post on the r-sig-ecology of perhaps r-sig-phylo list (not sure
which is more appropriate) where you should find both the interest and
expertise you seek.

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, Jun 23, 2020 at 11:23 AM Adriana Acero <
adriana.carolina.ac...@gmail.com> wrote:

> Hi everybody,
>
> My name is Adriana and I'm working with Community Ecology and Geometric
> morphometric of bats.
>
> At this moment, I'm trying to perform an RLQ analysis with ADE4, with a
> data frame that already contains the mean shape scores (PCA) of some
> species of bats (Matriz Q).
>
> I couldn't do the PCA into ADE4 because I'm working with landmarks and the
> structure of the data is a multidimensional array, so the PCA comes from
> Geomorph. I save only the scores in a data frame. I'm searching on the
> internet for solutions but I don't find How to do an RLQ with my data.frame
> or how to transform it in a dudi object without doing an extra analysis.
>
> I appreciate your help.
>
> Thanks
>
> Adriana Acero
>
> [[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] Help with locating error on import of data

2020-06-23 Thread Rasmus Liland
On 2020-06-23 17:24 +0100, Rui Barradas wrote:
> Às 15:56 de 23/06/2020, Ahson via R-help escreveu:
> > I have imported data from an Excel file 
> > and I am getting errors:
> 
> Try setting argument col.names = FALSE, it 
> seems that the function is not find column 
> headers and is choosing its own.

Dear Ahson,

The openxlsx package is also worth checking 
out for situations like this one.

First read the file into a workbook object, 
then read the sheet names from the workbook, 
lastly use the sheet names to read each sheet 
from the workbook using lapply:

xlsxFile <- "hmm.xlsx"
wb <- openxlsx::loadWorkbook(xlsxFile)
sheets <- names(wb)
list.of.sheet.dfs <- lapply(sheets, function(sheet, wb) {
  openxlsx::read.xlsx(
xlsxFile=wb,
sheet=sheet,
colNames=FALSE)
}, wb=wb)
names(list.of.sheet.dfs) <- sheets
list.of.sheet.dfs

yields:

$Sheet1
 X1   X2   X3X4 X5
1  this   blablabla   
2   does  
3   not   
4make 
5 sense 42
6   lalala

$ReallyComplexSamples0003
X1  X2   X3X4 X5 X6   X7
1   some
2  with  other  
3  random   
4 info  sheet   
5   stuckin 
6it   lalala$$$ 
7 2 

Best,
Rasmus


signature.asc
Description: PGP signature
__
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] rNOMADS Package

2020-06-23 Thread Philip
Does anyone out there have any advise about how to download the wgrib2 software 
from the National Weather Service onto a Windows 10 computer?

I tried using the instructions from Bovine Aerospace website but am not sure if 
it loaded correctly.

Thanks,
Philip
[[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] R 4.0.2 is released

2020-06-23 Thread array chip via R-help
Hi,

I downloaded R4.0.2 and installed it succesffully without any error. However, 
when I opened up a R session (using x64) and tried to install packages, I got 
the following error message:

> utils:::menuInstallPkgs()
Warning: failed to download mirrors file (internet routines cannot be loaded); 
using local file 'C:/PROGRA~1/R/R-40~1.2/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository 
https://rweb.crmda.ku.edu/cran/src/contrib:
  internet routines cannot be loaded
Error in install.packages(lib = .libPaths()[1L], dependencies = NA, type = 
type) : 
  argument "pkgs" is missing, with no default
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
  unable to load shared object 
'C:/PROGRA~1/R/R-40~1.2/modules/x64/internet.dll':
  LoadLibrary failure:  Access is denied.

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)


Matrix products: default


locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252  
 
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                         
 
[5] LC_TIME=English_United States.1252    


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     


loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2   


However, if I load up a session using i386 verson, then everything is ok - I 
can install packages.

Can you and anyone suggest what is going on?

Thanks,

John




On Monday, June 22, 2020, 01:24:20 AM PDT, Peter Dalgaard via R-help 
 wrote: 





The build system rolled up R-4.0.2.tar.gz (codename "Taking Off Again") this 
morning.

The list below details the changes in this release.

You can get the source code from

http://cran.r-project.org/src/base/R-4/R-4.0.2.tar.gz

or wait for it to be mirrored at a CRAN site nearer to you.

Binaries for various platforms will appear in due course.


For the R Core Team,

Peter Dalgaard

These are the checksums (md5 and SHA-256) for the freshly created files, in 
case you wish
to check that they are uncorrupted:

MD5 (AUTHORS) = b9c44f9f78cab3184ad9898bebc854b4
MD5 (COPYING) = eb723b61539feef013de476e68b5c50a
MD5 (COPYING.LIB) = a6f89e2100d9b6cdffcea4f398e37343
MD5 (FAQ) = 4afa171cd982aaa60f0ba92e2e7bc5d6
MD5 (INSTALL) = 7893f754308ca31f1ccf62055090ad7b
MD5 (NEWS) = 566a6bb3642e28e6bf01cf98db31137c
MD5 (NEWS.0) = bfcd7c147251b5474d96848c6f57e5a8
MD5 (NEWS.1) = eb78c4d053ec9c32b815cf0c2ebea801
MD5 (NEWS.2) = 496062c138e2def06cebccddfb814ac6
MD5 (NEWS.3) = 012e7f4a80cc8ec947bf3f0ff6117ec8
MD5 (R-latest.tar.gz) = 1eac7293d5fe313a56ddabfda02b437e
MD5 (README) = f468f281c919665e276a1b691decbbe6
MD5 (RESOURCES) = 529223fd3ffef95731d0a87353108435
MD5 (THANKS) = 251d20510bfc3cc93b82c5a99f7efcc6
MD5 (VERSION-INFO.dcf) = 62496d3a0fd8cc2ed644ea518c052371
MD5 (R-4/R-4.0.2.tar.gz) = 1eac7293d5fe313a56ddabfda02b437e

2cde824a7b18958e5f06b391c801c8288be0f84fa8934b7ddefef23c67e60c09  AUTHORS
e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4  COPYING
6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3  COPYING.LIB
eddf87b12197c7b3b19cbc9b11c1beab95b14e3dcd715bf37d2f6a8b2a72c2a1  FAQ
f87461be6cbaecc4dce44ac58e5bd52364b0491ccdadaf846cb9b452e9550f31  INSTALL
ec05bba338358410fae6b34fed061605989ab3601aba1b3fcb45a610d5dd2eb9  NEWS
4e21b62f515b749f80997063fceab626d7258c7d650e81a662ba8e0640f12f62  NEWS.0
12b30c724117b1b2b11484673906a6dcd48a361f69fc420b36194f9218692d01  NEWS.1
e80de410c77f05ff2012fa70051b89119845f734a7fa5c55857e61e4ed7d5f6e  NEWS.2
7201d139947afa52b5e09d26dc01445edf444506264355b2185122bc1ed3dce0  NEWS.3
d3bceab364da0876625e4097808b42512395fdf41292f4915ab1fd257c1bbe75  
R-latest.tar.gz
2fdd3e90f23f32692d4b3a0c0452f2c219a10882033d1774f8cadf25886c3ddc  README
408737572ecc6e1135fdb2cf7a9dbb1a6cb27967c757f1771b8c39d1fd2f1ab9  RESOURCES
c9c7cb32308b4e560a22c858819ade9de524a602abd4e92d1c328c89f8037d73  THANKS
10cc5f566a4a5ce49147e7dcfbe9180dba09ccb9efb17298b067309eb799e92e  
VERSION-INFO.dcf
d3bceab364da0876625e4097808b42512395fdf41292f4915ab1fd257c1bbe75  
R-4/R-4.0.2.tar.gz

This is the relevant part of the NEWS file

CHANGES IN R 4.0.2:

  UTILITIES:

    * R CMD check skips vignette re-building (with a warning) if the
      VignetteBuilder package(s) are not available.

  BUG FIXES:

    * Paths with non-ASCII characters caused problems for package
      loading on Windows PR#17833.

    * Using tcltk widgets no longer crashes R on Windows.

    * source(*, echo=TRUE) no longer fails in some cases with empty
      lines; reported by Bill Dunlap in PR#17769.

    * on.exit() now correctly matches named arguments, thanks to
      PR#17815 (including patch) by Brodie Gaslam.

    * regexpr(*, perl=TRUE) no longer returns incorrect positions into
      text containing characters outside of the Unicode Basic
      Multilingual Plane on Windows.

-- 
Peter Dalgaard, Professor,
Center for Sta

Re: [R] R 4.0.2 is released

2020-06-23 Thread array chip via R-help
My current version of R is 3.6.3, there is no problem of installing packages 
there. I also have no problem installing bioconductor packages with 3.6.3. 

But installing packages from biocondcutor failed as well on 4.0.2 (also tried 
4.0.0 and failed, too)


On Tuesday, June 23, 2020, 08:56:45 PM PDT, array chip via R-help 
 wrote: 

Hi,

I downloaded R4.0.2 and installed it succesffully without any error. However, 
when I opened up a R session (using x64) and tried to install packages, I got 
the following error message:

> utils:::menuInstallPkgs()
Warning: failed to download mirrors file (internet routines cannot be loaded); 
using local file 'C:/PROGRA~1/R/R-40~1.2/doc/CRAN_mirrors.csv'
Warning: unable to access index for repository 
https://rweb.crmda.ku.edu/cran/src/contrib:
  internet routines cannot be loaded
Error in install.packages(lib = .libPaths()[1L], dependencies = NA, type = 
type) : 
  argument "pkgs" is missing, with no default
In addition: Warning message:
In download.file(url, destfile = f, quiet = TRUE) :
  unable to load shared object 
'C:/PROGRA~1/R/R-40~1.2/modules/x64/internet.dll':
  LoadLibrary failure:  Access is denied.

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)


Matrix products: default


locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252  
 
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                         
 
[5] LC_TIME=English_United States.1252    


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     


loaded via a namespace (and not attached):
[1] compiler_4.0.2 tools_4.0.2   


However, if I load up a session using i386 verson, then everything is ok - I 
can install packages.

Can you and anyone suggest what is going on?

Thanks,

John




On Monday, June 22, 2020, 01:24:20 AM PDT, Peter Dalgaard via R-help 
 wrote: 





The build system rolled up R-4.0.2.tar.gz (codename "Taking Off Again") this 
morning.

The list below details the changes in this release.

You can get the source code from

http://cran.r-project.org/src/base/R-4/R-4.0.2.tar.gz

or wait for it to be mirrored at a CRAN site nearer to you.

Binaries for various platforms will appear in due course.


For the R Core Team,

Peter Dalgaard

These are the checksums (md5 and SHA-256) for the freshly created files, in 
case you wish
to check that they are uncorrupted:

MD5 (AUTHORS) = b9c44f9f78cab3184ad9898bebc854b4
MD5 (COPYING) = eb723b61539feef013de476e68b5c50a
MD5 (COPYING.LIB) = a6f89e2100d9b6cdffcea4f398e37343
MD5 (FAQ) = 4afa171cd982aaa60f0ba92e2e7bc5d6
MD5 (INSTALL) = 7893f754308ca31f1ccf62055090ad7b
MD5 (NEWS) = 566a6bb3642e28e6bf01cf98db31137c
MD5 (NEWS.0) = bfcd7c147251b5474d96848c6f57e5a8
MD5 (NEWS.1) = eb78c4d053ec9c32b815cf0c2ebea801
MD5 (NEWS.2) = 496062c138e2def06cebccddfb814ac6
MD5 (NEWS.3) = 012e7f4a80cc8ec947bf3f0ff6117ec8
MD5 (R-latest.tar.gz) = 1eac7293d5fe313a56ddabfda02b437e
MD5 (README) = f468f281c919665e276a1b691decbbe6
MD5 (RESOURCES) = 529223fd3ffef95731d0a87353108435
MD5 (THANKS) = 251d20510bfc3cc93b82c5a99f7efcc6
MD5 (VERSION-INFO.dcf) = 62496d3a0fd8cc2ed644ea518c052371
MD5 (R-4/R-4.0.2.tar.gz) = 1eac7293d5fe313a56ddabfda02b437e

2cde824a7b18958e5f06b391c801c8288be0f84fa8934b7ddefef23c67e60c09  AUTHORS
e6d6a009505e345fe949e1310334fcb0747f28dae2856759de102ab66b722cb4  COPYING
6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3  COPYING.LIB
eddf87b12197c7b3b19cbc9b11c1beab95b14e3dcd715bf37d2f6a8b2a72c2a1  FAQ
f87461be6cbaecc4dce44ac58e5bd52364b0491ccdadaf846cb9b452e9550f31  INSTALL
ec05bba338358410fae6b34fed061605989ab3601aba1b3fcb45a610d5dd2eb9  NEWS
4e21b62f515b749f80997063fceab626d7258c7d650e81a662ba8e0640f12f62  NEWS.0
12b30c724117b1b2b11484673906a6dcd48a361f69fc420b36194f9218692d01  NEWS.1
e80de410c77f05ff2012fa70051b89119845f734a7fa5c55857e61e4ed7d5f6e  NEWS.2
7201d139947afa52b5e09d26dc01445edf444506264355b2185122bc1ed3dce0  NEWS.3
d3bceab364da0876625e4097808b42512395fdf41292f4915ab1fd257c1bbe75  
R-latest.tar.gz
2fdd3e90f23f32692d4b3a0c0452f2c219a10882033d1774f8cadf25886c3ddc  README
408737572ecc6e1135fdb2cf7a9dbb1a6cb27967c757f1771b8c39d1fd2f1ab9  RESOURCES
c9c7cb32308b4e560a22c858819ade9de524a602abd4e92d1c328c89f8037d73  THANKS
10cc5f566a4a5ce49147e7dcfbe9180dba09ccb9efb17298b067309eb799e92e  
VERSION-INFO.dcf
d3bceab364da0876625e4097808b42512395fdf41292f4915ab1fd257c1bbe75  
R-4/R-4.0.2.tar.gz

This is the relevant part of the NEWS file

CHANGES IN R 4.0.2:

  UTILITIES:

    * R CMD check skips vignette re-building (with a warning) if the
      VignetteBuilder package(s) are not available.

  BUG FIXES:

    * Paths with non-ASCII characters caused problems for package
      loading on Windows PR#17833.

    * Using tcltk widgets no longer crashes R on Windows.

    * source(*, echo=TRUE) no longer fails in some cases with empty
      lines; reported by Bill Dunlap in PR#17769