Re: [R] Error message

2024-03-22 Thread Ivan Krylov via R-help
В Fri, 22 Mar 2024 14:52:05 -0500
Val  пишет:

> : 8d5a 35f8 1ac5 cc14 a04e be5c 572f a3ad  .Z5..N.\W/..
> 0010: 6210 7024 9b58 93c7 34d0 acb7 7a82 3f99  b.p$.X..4...z.?.

Thank you!

This doesn't look like any structured data to me. In particular, it
doesn't look like something written by R: those created by modern
versions of R with default settings typically start with an "RDX2\n"
(52 44 58 32 0a) or at least "X\n" (58 0a). Could be a middle of
compressed stream, as if the file was truncated while it was being
written.

Do you get similar results with saveRDS(datafilename, 'X1.rds') and
data2 <- readRDS('X1.rds')? Does this happen with other R objects that
you try to save or in your other scripts?

-- 
Best regards,
Ivan

__
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

2024-03-22 Thread Val
Here is the first few bytes,
xxd -l 128 X1.RData
: 8d5a 35f8 1ac5 cc14 a04e be5c 572f a3ad  .Z5..N.\W/..
0010: 6210 7024 9b58 93c7 34d0 acb7 7a82 3f99  b.p$.X..4...z.?.
0020: 66ce 0ebb 2057 ec36 55b4 0ece a036 695a  f... W.6U6iZ
0030: 258b 3493 b661 f620 f7fe ada7 158a 15f7  %.4..a. 
0040: e016 a548 6fcb 20c8 6fb4 493d adc9 ea4a  ...Ho. .o.I=...J
0050: 0a2b b7cf a416 336e 5e4e abc5 9874 7be3  .+3n^N...t{.
0060: 5a5a 3405 fe35 8a3d ad80 0dc0 ca3e ea7a  ZZ4..5.=.>.z
0070: e628 b220 ee50 0b9f 3a81 e971 8a19 4f54  .(. .P..:..q..OT

On Fri, Mar 22, 2024 at 2:36 PM Ivan Krylov  wrote:
>
> В Fri, 22 Mar 2024 14:31:17 -0500
> Val  пишет:
>
> > How do I get the first   few bytes?
>
> What does file.info('X1.RData') say?
>
> Do you get any output if you run print(readBin('X1.RData', raw(), 128))?
>
> If this is happening on a Linux or macOS machine, the operating system
> command xxd -l 128 X1.RData will give the same output in a more
> readable manner, but the readBin(...) output from R should be fine too.
>
> --
> Best regards,
> Ivan

__
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

2024-03-22 Thread Ivan Krylov via R-help
В Fri, 22 Mar 2024 14:31:17 -0500
Val  пишет:

> How do I get the first   few bytes?

What does file.info('X1.RData') say?

Do you get any output if you run print(readBin('X1.RData', raw(), 128))?

If this is happening on a Linux or macOS machine, the operating system
command xxd -l 128 X1.RData will give the same output in a more
readable manner, but the readBin(...) output from R should be fine too.

-- 
Best regards,
Ivan

__
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

2024-03-22 Thread Val
Yes, X1.RData is large(more than 40M rows) .
How do I get the first   few bytes?

On Fri, Mar 22, 2024 at 2:20 PM Ivan Krylov  wrote:
>
> В Fri, 22 Mar 2024 14:02:09 -0500
> Val  пишет:
>
> > X2.R
> > load("X1.RData")
> >
> > I am getting this error message:
> >  Error in load("X1.RData", :
> >  bad restore file magic number (file may be corrupted)  .. no data
> > loaded.
>
> This error happens very early when R tries to load the file, right
> at the first few bytes. Is "X1.RData" large? Can you share it, or at
> least a hexadecimal dump of the first few hundred bytes?
>
> --
> Best regards,
> Ivan

__
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

2024-03-22 Thread Ivan Krylov via R-help
В Fri, 22 Mar 2024 14:02:09 -0500
Val  пишет:

> X2.R
> load("X1.RData")
> 
> I am getting this error message:
>  Error in load("X1.RData", :
>  bad restore file magic number (file may be corrupted)  .. no data
> loaded.

This error happens very early when R tries to load the file, right
at the first few bytes. Is "X1.RData" large? Can you share it, or at
least a hexadecimal dump of the first few hundred bytes?

-- 
Best regards,
Ivan

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


[R] Error message

2024-03-22 Thread Val
Hi all,

I am creating an X1.RData file using the R 4.2.2 library.
   x1.R
save(datafilename, file="X1.RData")

When I am trying to load  this file using another script

X2.R
load("X1.RData")

I am getting this error message:
 Error in load("X1.RData", :
 bad restore file magic number (file may be corrupted)  .. no data  loaded.

I am using the same R library (R 4.2.2)

What would be the cause for this error message and how to fix it?

Thank you,

__
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 when using 'optim' for numerical maximum likelihood

2023-05-14 Thread Rui Barradas

Às 06:28 de 14/05/2023, iguodala edwin via R-help escreveu:

Good morning, How can I resolved error message New_X with convergence 1.Thanks
[[alternative HTML version deleted]]

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

Hello,

Please include data and the code you tried in your questions to R-Help.
We'll be glad to help but like this it is not possible to do so.

Rui Barradas

__
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 when using 'optim' for numerical maximum likelihood

2023-05-14 Thread iguodala edwin via R-help
Good morning, How can I resolved error message New_X with convergence 1.Thanks
[[alternative HTML version deleted]]

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


Re: [R] error message from read.csv in loop

2021-07-10 Thread Migdonio González
Thank you very much for the clarification. I will try to use a more precise
language next time.

Warm regards
Migdonio G.

On Sat, Jul 10, 2021 at 11:30 AM Bert Gunter  wrote:

> "It seems that your problem is that you are using single quotes inside of
> the double quotes."
>
> That is FALSE. From ?Quotes:
> "Single and double quotes delimit character constants. They can be
> used interchangeably but double quotes are preferred (and character
> constants are printed using double quotes), so single quotes are
> normally only used to delimit character constants containing double
> quotes."
>
> Of course, pairs of each type of quote must properly match, must not
> get confused with quotes in the delineated string, etc. , but they are
> otherwise interchangeable. The whole of ?Quotes, especially the
> examples, is informative and worth the read (imo).
>
> 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 Sat, Jul 10, 2021 at 8:20 AM Migdonio González
>  wrote:
> >
> >  It seems that your problem is that you are using single quotes inside of
> > the double quotes. This is not necessary. Here is the corrected for-loop:
> >
> > for (j in 1:nrow(ora))
> > {
> > mycol  <- ora[j,"fname"]
> > mycsv  <- paste0(mycol,".csv")
> > rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/",
> mycsv))
> > rr <- read.csv(rdcsv)
> > }
> >
> > Also note that the rr variable will only store the last CSV, not all CSV.
> > You will need to initialize the rr variable as a list to store all CSVs
> if
> > that is what you require. Something like this:
> >
> > # Initialize the rr variable as a list.
> > rr <- as.list(rep(NA, nrow(ora)))
> >
> > # Run the for-loop to store all the CSVs in rr.
> > for (j in 1:nrow(ora))
> > {
> > mycol  <- ora[j,"fname"]
> > mycsv  <- paste0(mycol,".csv")
> > rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/",
> mycsv))
> > rr[[j]] <- read.csv(rdcsv)
> > }
> >
> > Regards
> > Migdonio G.
> >
> > On Fri, Jul 9, 2021 at 1:10 PM Kai Yang via R-help  >
> > wrote:
> >
> > > Hello List,
> > > I use for loop to read csv difference file into data frame rr.  The
> data
> > > frame rr will be deleted after a comparison and go to the next csv
> file.
> > > Below is my code:
> > > for (j in 1:nrow(ora))
> > > {
> > >   mycol  <- ora[j,"fname"]
> > >   mycsv  <- paste0(mycol,".csv'")
> > >   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
> > >   rr <- read.csv(rdcsv)
> > > }
> > > but when I run this code, I got error message below:
> > > Error in file(file, "rt") : cannot open the connection
> > > In addition: Warning message:
> > > In file(file, "rt") :
> > >   cannot open file
> > > ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No such file
> or
> > > directory
> > >
> > > so, I checked the rdcsv and print it out, see below:
> > > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
> > > [1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
> > > it seems correct. I copy and paste it into a code :
> > >  rr <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
> > > and it works fine.
> > > Can someone help me debug where is the problem in my for loop code?
> > > Thanks,
> > > Kai
> > >
> > >
> > >
> > >
> > >
> > > [[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.
> > >
> >
> > [[alternati

Re: [R] error message from read.csv in loop

2021-07-10 Thread Duncan Murdoch

On 10/07/2021 12:30 p.m., Bert Gunter wrote:

"It seems that your problem is that you are using single quotes inside of
the double quotes."

That is FALSE. From ?Quotes:
"Single and double quotes delimit character constants. They can be
used interchangeably but double quotes are preferred (and character
constants are printed using double quotes), so single quotes are
normally only used to delimit character constants containing double
quotes."

Of course, pairs of each type of quote must properly match, must not
get confused with quotes in the delineated string, etc. , but they are
otherwise interchangeable. The whole of ?Quotes, especially the
examples, is informative and worth the read (imo).


I think Migdonio is right.  From the error message the problem is that 
the filename was being specified as 
"'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'"


That is not a legal filename:  the single quotes probably tell Windows 
to interpret it as a single filename entry, not drive, path, filename. 
Or maybe the drive is being interpreted as "'w", which isn't a legal 
drive id.


In any case, if you set f to an existing full path, and file.exists(f) 
returns TRUE, you'll find that file.exists(paste0("'", f, "'")) returns 
FALSE.


Duncan Murdoch



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 Sat, Jul 10, 2021 at 8:20 AM Migdonio González
 wrote:


  It seems that your problem is that you are using single quotes inside of
the double quotes. This is not necessary. Here is the corrected for-loop:

for (j in 1:nrow(ora))
{
 mycol  <- ora[j,"fname"]
 mycsv  <- paste0(mycol,".csv")
 rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
 rr <- read.csv(rdcsv)
}

Also note that the rr variable will only store the last CSV, not all CSV.
You will need to initialize the rr variable as a list to store all CSVs if
that is what you require. Something like this:

# Initialize the rr variable as a list.
rr <- as.list(rep(NA, nrow(ora)))

# Run the for-loop to store all the CSVs in rr.
for (j in 1:nrow(ora))
{
 mycol  <- ora[j,"fname"]
 mycsv  <- paste0(mycol,".csv")
 rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
 rr[[j]] <- read.csv(rdcsv)
}

Regards
Migdonio G.

On Fri, Jul 9, 2021 at 1:10 PM Kai Yang via R-help 
wrote:


Hello List,
I use for loop to read csv difference file into data frame rr.  The data
frame rr will be deleted after a comparison and go to the next csv file.
Below is my code:
for (j in 1:nrow(ora))
{
   mycol  <- ora[j,"fname"]
   mycsv  <- paste0(mycol,".csv'")
   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
   rr <- read.csv(rdcsv)
}
but when I run this code, I got error message below:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
   cannot open file
''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No such file or
directory

so, I checked the rdcsv and print it out, see below:
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
it seems correct. I copy and paste it into a code :
  rr <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
and it works fine.
Can someone help me debug where is the problem in my for loop code?
Thanks,
Kai





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

Re: [R] error message from read.csv in loop

2021-07-10 Thread Bert Gunter
"It seems that your problem is that you are using single quotes inside of
the double quotes."

That is FALSE. From ?Quotes:
"Single and double quotes delimit character constants. They can be
used interchangeably but double quotes are preferred (and character
constants are printed using double quotes), so single quotes are
normally only used to delimit character constants containing double
quotes."

Of course, pairs of each type of quote must properly match, must not
get confused with quotes in the delineated string, etc. , but they are
otherwise interchangeable. The whole of ?Quotes, especially the
examples, is informative and worth the read (imo).

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 Sat, Jul 10, 2021 at 8:20 AM Migdonio González
 wrote:
>
>  It seems that your problem is that you are using single quotes inside of
> the double quotes. This is not necessary. Here is the corrected for-loop:
>
> for (j in 1:nrow(ora))
> {
> mycol  <- ora[j,"fname"]
> mycsv  <- paste0(mycol,".csv")
> rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
> rr <- read.csv(rdcsv)
> }
>
> Also note that the rr variable will only store the last CSV, not all CSV.
> You will need to initialize the rr variable as a list to store all CSVs if
> that is what you require. Something like this:
>
> # Initialize the rr variable as a list.
> rr <- as.list(rep(NA, nrow(ora)))
>
> # Run the for-loop to store all the CSVs in rr.
> for (j in 1:nrow(ora))
> {
> mycol  <- ora[j,"fname"]
> mycsv  <- paste0(mycol,".csv")
> rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
> rr[[j]] <- read.csv(rdcsv)
> }
>
> Regards
> Migdonio G.
>
> On Fri, Jul 9, 2021 at 1:10 PM Kai Yang via R-help 
> wrote:
>
> > Hello List,
> > I use for loop to read csv difference file into data frame rr.  The data
> > frame rr will be deleted after a comparison and go to the next csv file.
> > Below is my code:
> > for (j in 1:nrow(ora))
> > {
> >   mycol  <- ora[j,"fname"]
> >   mycsv  <- paste0(mycol,".csv'")
> >   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
> >   rr <- read.csv(rdcsv)
> > }
> > but when I run this code, I got error message below:
> > Error in file(file, "rt") : cannot open the connection
> > In addition: Warning message:
> > In file(file, "rt") :
> >   cannot open file
> > ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No such file or
> > directory
> >
> > so, I checked the rdcsv and print it out, see below:
> > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
> > [1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
> > it seems correct. I copy and paste it into a code :
> >  rr <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
> > and it works fine.
> > Can someone help me debug where is the problem in my for loop code?
> > Thanks,
> > Kai
> >
> >
> >
> >
> >
> > [[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 --

Re: [R] error message from read.csv in loop

2021-07-10 Thread Migdonio González
Hello Kai,

Just as you did to store the data inside of rr. Try class(rr[[1]]) or
class(rr[[2]]) and so on to explore a bit more. The variable rr is a list
that contains dataframes within it. To access the dataframes you must use
the syntax rr[[i]] where i is the index of the element of the list (or the
number of the dataframe in your case). For example:

df1 <- rr[[1]]
class(df1) # Check if this is class "data.frame".

df2 <- rr[[2]]
class(df2)

You can also try other ways to store the dataframes more efficiently. This
is just a quick-and-dirty solution to the code you provided. I recommend
reading more about lists in R to understand how they work and how they
differ from other data structures like vectors.

Hope this helps,
Warm regards.
Migdonio G.

On Fri, Jul 9, 2021 at 2:24 PM Kai Yang  wrote:

> Hi Migdonio,
>
> I did try your code:
>
> # Initialize the rr variable as a list.
>
> rr <- as.list(rep(NA, nrow(ora)))
>
>
>
> # Run the for-loop to store all the CSVs in rr.
>
> for (j in 1:nrow(ora))
>
> {
>
> mycol  <- ora[j,"fname"]
>
> mycsv  <- paste0(mycol,".csv")
>
> rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
>
> rr[[j]] <- read.csv(rdcsv)
>
> }
>
>
> this code is working, but rr is not a data frame, R said: Large list ( 20
> elements .). how can I use it as a data frame one by one?
>
> Thank you for your help
>
> Kai
>
> On Friday, July 9, 2021, 11:39:59 AM PDT, Migdonio González <
> migdonio.gonzale...@gmail.com> wrote:
>
>
> It seems that your problem is that you are using single quotes inside of
> the double quotes. This is not necessary. Here is the corrected for-loop:
>
> for (j in 1:nrow(ora))
> {
> mycol  <- ora[j,"fname"]
> mycsv  <- paste0(mycol,".csv")
> rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
> rr <- read.csv(rdcsv)
> }
>
> Also note that the rr variable will only store the last CSV, not all CSV.
> You will need to initialize the rr variable as a list to store all CSVs if
> that is what you require. Something like this:
>
> # Initialize the rr variable as a list.
> rr <- as.list(rep(NA, nrow(ora)))
>
> # Run the for-loop to store all the CSVs in rr.
> for (j in 1:nrow(ora))
> {
> mycol  <- ora[j,"fname"]
> mycsv  <- paste0(mycol,".csv")
> rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
> rr[[j]] <- read.csv(rdcsv)
> }
>
> Regards
> Migdonio G.
>
> On Fri, Jul 9, 2021 at 1:10 PM Kai Yang via R-help 
> wrote:
>
> Hello List,
> I use for loop to read csv difference file into data frame rr.  The data
> frame rr will be deleted after a comparison and go to the next csv file.
> Below is my code:
> for (j in 1:nrow(ora))
> {
>   mycol  <- ora[j,"fname"]
>   mycsv  <- paste0(mycol,".csv'")
>   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
>   rr <- read.csv(rdcsv)
> }
> but when I run this code, I got error message below:
> Error in file(file, "rt") : cannot open the connection
> In addition: Warning message:
> In file(file, "rt") :
>   cannot open file
> ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No such file or
> directory
>
> so, I checked the rdcsv and print it out, see below:
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
> it seems correct. I copy and paste it into a code :
>  rr <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
> and it works fine.
> Can someone help me debug where is the problem in my for loop code?
> Thanks,
> Kai
>
>
>
>
>
> [[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 comm

Re: [R] error message from read.csv in loop

2021-07-10 Thread Migdonio González
 It seems that your problem is that you are using single quotes inside of
the double quotes. This is not necessary. Here is the corrected for-loop:

for (j in 1:nrow(ora))
{
mycol  <- ora[j,"fname"]
mycsv  <- paste0(mycol,".csv")
rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
rr <- read.csv(rdcsv)
}

Also note that the rr variable will only store the last CSV, not all CSV.
You will need to initialize the rr variable as a list to store all CSVs if
that is what you require. Something like this:

# Initialize the rr variable as a list.
rr <- as.list(rep(NA, nrow(ora)))

# Run the for-loop to store all the CSVs in rr.
for (j in 1:nrow(ora))
{
mycol  <- ora[j,"fname"]
mycsv  <- paste0(mycol,".csv")
rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
rr[[j]] <- read.csv(rdcsv)
}

Regards
Migdonio G.

On Fri, Jul 9, 2021 at 1:10 PM Kai Yang via R-help 
wrote:

> Hello List,
> I use for loop to read csv difference file into data frame rr.  The data
> frame rr will be deleted after a comparison and go to the next csv file.
> Below is my code:
> for (j in 1:nrow(ora))
> {
>   mycol  <- ora[j,"fname"]
>   mycsv  <- paste0(mycol,".csv'")
>   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
>   rr <- read.csv(rdcsv)
> }
> but when I run this code, I got error message below:
> Error in file(file, "rt") : cannot open the connection
> In addition: Warning message:
> In file(file, "rt") :
>   cannot open file
> ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No such file or
> directory
>
> so, I checked the rdcsv and print it out, see below:
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
> it seems correct. I copy and paste it into a code :
>  rr <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
> and it works fine.
> Can someone help me debug where is the problem in my for loop code?
> Thanks,
> Kai
>
>
>
>
>
> [[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] error message from read.csv in loop

2021-07-09 Thread Rui Barradas

Hello,

1. When there are systematic errors, use ?try or, better yet, ?tryCatch.
Something like the code below will create a list of errors and read in 
the data if none occurred.
The code starts by creating an empty list for tryCatch results. It uses 
?file.path instead of noquote/paste0 to assemble the file name and wraps 
tryCatch around read.csv. Then, after the for loop, it gets the wrong 
reads and displays the error messages.
3. I'm assuming that after processing the data file by file you discard 
the data.frame if it's read without problems and move on to the next 
one. It would also be possible to store them all in a list, together 
with the errors.



ok <- vector("list", nrow(ora))
for (j in 1:nrow(ora))
{
  mycol  <- ora[j,"fname"]
  mycsv  <- paste0(mycol, ".csv'")
  rdcsv  <- file.path("w:/project/_Joe.B/Oracle/data", mycsv)
  rr <- tryCatch(read.csv(rdcsv), error = function(e) e)
  if(inherits(rr, "error"))
    ok[[i]] <- rr
  else ok[[i]] <- TRUE
}

i_err <- sapply(ok, inherits, "error")
for(e in ok[i_err]) message(e$message)


2. I'm assuming that you want to process file by file and  if the data 
are read without problems you discard the data.frame after processing it 
and move on to the next file. It is also possible to store them all in a 
list, together with the errors.



fun <- function(j, data = ora, mypath = "w:/project/_Joe.B/Oracle/data")
{
  mycol  <- data[j, "fname"]
  mycsv  <- paste0(mycol, ".csv")
  rdcsv  <- file.path(mypath, mycsv)
  tryCatch(read.csv(rdcsv), error = function(e) e)
}

df_list <- lapply(seq_len(nrow(ora)), fun)
i_err <- sapply(df_list, inherits, "error")
df_list[!i_err]  # these are ok

# hypothetical processing strategy
processing_results <- lapply(df_list[!i_err], function(rr) {
  # code goes here
  # ...etc...
})


Hope this helps,

Rui Barradas



Às 19:01 de 09/07/2021, Kai Yang via R-help escreveu:

Hello List,
I use for loop to read csv difference file into data frame rr.  The data frame 
rr will be deleted after a comparison and go to the next csv file.  Below is my 
code:
for (j in 1:nrow(ora))
{
   mycol  <- ora[j,"fname"]
   mycsv  <- paste0(mycol,".csv'")
   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
   rr     <- read.csv(rdcsv)
}
but when I run this code, I got error message below:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
   cannot open file ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No 
such file or directory

so, I checked the rdcsv and print it out, see below:
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
it seems correct. I copy and paste it into a code :
  rr     <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
and it works fine.
Can someone help me debug where is the problem in my for loop code?
Thanks,
Kai





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


Re: [R] error message from read.csv in loop

2021-07-09 Thread Kai Yang via R-help
 Hi Migdonio,
I did try your code:
# Initialize the rr variable as a list.

rr <- as.list(rep(NA, nrow(ora)))


# Run the for-loop to store all the CSVs in rr.

for (j in 1:nrow(ora))

{

        mycol  <- ora[j,"fname"]

        mycsv  <- paste0(mycol,".csv")

        rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))

        rr[[j]]     <- read.csv(rdcsv)

}

this code is working, but rr is not a data frame, R said: Large list ( 20 
elements .). how can I use it as a data frame one by one?
Thank you for your help
Kai
On Friday, July 9, 2021, 11:39:59 AM PDT, Migdonio González 
 wrote:  
 
 It seems that your problem is that you are using single quotes inside of the 
double quotes. This is not necessary. Here is the corrected for-loop:
for (j in 1:nrow(ora))
{
        mycol  <- ora[j,"fname"]
        mycsv  <- paste0(mycol,".csv")
        rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
        rr     <- read.csv(rdcsv)
}
Also note that the rr variable will only store the last CSV, not all CSV. You 
will need to initialize the rr variable as a list to store all CSVs if that is 
what you require. Something like this:
# Initialize the rr variable as a list.
rr <- as.list(rep(NA, nrow(ora)))
# Run the for-loop to store all the CSVs in rr.
for (j in 1:nrow(ora))
{
        mycol  <- ora[j,"fname"]
        mycsv  <- paste0(mycol,".csv")
        rdcsv  <- noquote(paste0("w:/project/_Joe.B/Oracle/data/", mycsv))
        rr[[j]]     <- read.csv(rdcsv)
} 

RegardsMigdonio G.

On Fri, Jul 9, 2021 at 1:10 PM Kai Yang via R-help  wrote:

Hello List,
I use for loop to read csv difference file into data frame rr.  The data frame 
rr will be deleted after a comparison and go to the next csv file.  Below is my 
code:
for (j in 1:nrow(ora))
{
  mycol  <- ora[j,"fname"]
  mycsv  <- paste0(mycol,".csv'")
  rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
  rr     <- read.csv(rdcsv)
}
but when I run this code, I got error message below:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No 
such file or directory

so, I checked the rdcsv and print it out, see below:
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
it seems correct. I copy and paste it into a code :
 rr     <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
and it works fine.
Can someone help me debug where is the problem in my for loop code?
Thanks,
Kai





        [[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] error message from read.csv in loop

2021-07-09 Thread Eric Berger
it complained about  ASSAY_DEFINITIONS not about  RESPONDENTS.
Can you try with the ASSAY_DEFINITIONS  file?


On Fri, Jul 9, 2021 at 9:10 PM Kai Yang via R-help 
wrote:

> Hello List,
> I use for loop to read csv difference file into data frame rr.  The data
> frame rr will be deleted after a comparison and go to the next csv file.
> Below is my code:
> for (j in 1:nrow(ora))
> {
>   mycol  <- ora[j,"fname"]
>   mycsv  <- paste0(mycol,".csv'")
>   rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
>   rr <- read.csv(rdcsv)
> }
> but when I run this code, I got error message below:
> Error in file(file, "rt") : cannot open the connection
> In addition: Warning message:
> In file(file, "rt") :
>   cannot open file
> ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No such file or
> directory
>
> so, I checked the rdcsv and print it out, see below:
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
> [1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
> it seems correct. I copy and paste it into a code :
>  rr <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
> and it works fine.
> Can someone help me debug where is the problem in my for loop code?
> Thanks,
> Kai
>
>
>
>
>
> [[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] error message from read.csv in loop

2021-07-09 Thread Kai Yang via R-help
Hello List,
I use for loop to read csv difference file into data frame rr.  The data frame 
rr will be deleted after a comparison and go to the next csv file.  Below is my 
code:
for (j in 1:nrow(ora))
{
  mycol  <- ora[j,"fname"]
  mycsv  <- paste0(mycol,".csv'")
  rdcsv  <- noquote(paste0("'w:/project/_Joe.B/Oracle/data/", mycsv))
  rr     <- read.csv(rdcsv)
}
but when I run this code, I got error message below:
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
  cannot open file ''w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'': No 
such file or directory

so, I checked the rdcsv and print it out, see below:
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_QUESTIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ASSAY_RUNS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DATA_ENTRY_PAGES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/DISCRETE_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/ENTRY_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_CODELIST_VALUES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_LOT_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/GEMD_SAMPLES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/MOLECULAR_WAREHOUSE.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_DEFINITIONS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/QUESTION_GROUPS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv'
[1] 'w:/project/_Joe.B/Oracle/data/RESPONSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_LIST_NAMES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/SAMPLE_PLATE_ADDRESSES.csv'
[1] 'w:/project/_Joe.B/Oracle/data/STORAGE_UNITS.csv'
it seems correct. I copy and paste it into a code :
 rr     <- read.csv( 'w:/project/_Joe.B/Oracle/data/RESPONDENTS.csv')
and it works fine.
Can someone help me debug where is the problem in my for loop code?
Thanks,
Kai





[[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 Cannot use `+.gg()` with a single argument. Did you accidentally put + on a new line?

2020-12-19 Thread Eric Berger
As the error message says, move the '+' sign from the start of the second
line to the end of the preceding line.


On Sat, Dec 19, 2020 at 10:29 PM Rosato, Kyle  wrote:

> For some simple reason, I am unable to see the mistake:
>
> ggplot(filter(nlsw88, !(is.na(union))), aes(y = wage, x = union, fill =
> union))
> + geom_boxplot() + facet_wrap(~idblack)
>
> [[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] Error Message Cannot use `+.gg()` with a single argument. Did you accidentally put + on a new line?

2020-12-19 Thread Rosato, Kyle
For some simple reason, I am unable to see the mistake:

ggplot(filter(nlsw88, !(is.na(union))), aes(y = wage, x = union, fill = union))
+ geom_boxplot() + facet_wrap(~idblack)

[[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 With the "MCMCmixfactanal" Function

2020-11-11 Thread Jeff Newmiller
Someone may feel like tackling this anyway, but technically it is off-topic 
here, as this forum is about the R language rather than specific contributed 
packages. (http://www.r-project.org/posting-guide.html). Lookup the package 
DESCRIPTION file on CRAN and if it does not mention a recommended support forum 
then correspond with the package maintainer.

On November 11, 2020 2:06:03 PM PST, Ziad Elmously 
 wrote:
>To Whom It May Concern,
>
>In am using the script below to test the function "MAMCmixfactanal" in
>the package "MCMCpack".
>
>library(MCMCpack)
>data(PErisk)
>post <- MCMCmixfactanal(~courts+barb2+prsexp2+prscorr2+gdpw2,
>factors=1, data=PErisk, lambda.constraints=
>list(courts=list(2,"-")),burnin=5000,mcmc=100,thin=50,verbose=500,L0=.25,store.lambda=TRUE,store.scores=TRUE,tune=1.2)
>plot(post)
>summary(post)
>
>However, I get the error message below.
>
>Acceptance rates:
>Error in print.default(t(accepts)/(posterior$burnin + posterior$mcmc), 
>:
>  invalid printing width
>
>Your help would be greatly appreciated.
>
>Kind regards,
>
>Ziad Elmously
>Director, Advanced Analytics & Data Science
>
>MetrixLab, a Macromill Group company
>Chalfont, PA, USA
>T (+1) 267 298 1159 � M (+1) 267 218 4724
>ziad.elmou...@us.metrixlab.com �
>www.metrixlab.com
>
>How do you create a powerful packaging design?
>Discover our 9 best practices. Read our whitepaper
>>
>
>
>   [[alternative HTML version deleted]]

-- 
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] Error Message With the "MCMCmixfactanal" Function

2020-11-11 Thread Bert Gunter
Please read and follow the posting guide linked below, especially this:

"For questions about functions in standard packages distributed with R (see
the FAQ Add-on packages in R
), ask
questions on R-help.
If the question relates to a *contributed package* , e.g., one downloaded
from CRAN, try contacting the package maintainer first. You can also use
find("functionname") and packageDescription("packagename") to find this
information. *Only* send such questions to R-help or R-devel if you get no
reply or need further assistance. This applies to both requests for help
and to bug reports. "

Note: also ?maintainer for finding emails of maintainers.

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 Wed, Nov 11, 2020 at 5:30 PM Ziad Elmously <
ziad.elmou...@us.metrixlab.com> wrote:

> To Whom It May Concern,
>
> In am using the script below to test the function "MAMCmixfactanal" in the
> package "MCMCpack".
>
> library(MCMCpack)
> data(PErisk)
> post <- MCMCmixfactanal(~courts+barb2+prsexp2+prscorr2+gdpw2, factors=1,
> data=PErisk, lambda.constraints=
>
> list(courts=list(2,"-")),burnin=5000,mcmc=100,thin=50,verbose=500,L0=.25,store.lambda=TRUE,store.scores=TRUE,tune=1.2)
> plot(post)
> summary(post)
>
> However, I get the error message below.
>
> Acceptance rates:
> Error in print.default(t(accepts)/(posterior$burnin + posterior$mcmc),  :
>   invalid printing width
>
> Your help would be greatly appreciated.
>
> Kind regards,
>
> Ziad Elmously
> Director, Advanced Analytics & Data Science
>
> MetrixLab, a Macromill Group company
> Chalfont, PA, USA
> T (+1) 267 298 1159   M (+1) 267 218 4724
> ziad.elmou...@us.metrixlab.com
> www.metrixlab.com
>
> How do you create a powerful packaging design?
> Discover our 9 best practices. Read our whitepaper > >
>
>
> [[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] Error Message With the "MCMCmixfactanal" Function

2020-11-11 Thread Ziad Elmously
To Whom It May Concern,

In am using the script below to test the function "MAMCmixfactanal" in the 
package "MCMCpack".

library(MCMCpack)
data(PErisk)
post <- MCMCmixfactanal(~courts+barb2+prsexp2+prscorr2+gdpw2, factors=1, 
data=PErisk, lambda.constraints=
  
list(courts=list(2,"-")),burnin=5000,mcmc=100,thin=50,verbose=500,L0=.25,store.lambda=TRUE,store.scores=TRUE,tune=1.2)
plot(post)
summary(post)

However, I get the error message below.

Acceptance rates:
Error in print.default(t(accepts)/(posterior$burnin + posterior$mcmc),  :
  invalid printing width

Your help would be greatly appreciated.

Kind regards,

Ziad Elmously
Director, Advanced Analytics & Data Science

MetrixLab, a Macromill Group company
Chalfont, PA, USA
T (+1) 267 298 1159 � M (+1) 267 218 4724
ziad.elmou...@us.metrixlab.com � 
www.metrixlab.com

How do you create a powerful packaging design?
Discover our 9 best practices. Read our whitepaper >


[[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 when using "revtools" package

2020-11-05 Thread Michael Dewey

Dear John

Your .bib file did not make it through the system as only a very limited 
set of attachments is supported. Try to make a minimal .bib file which 
triggers the problem by splitting your file in half, testing each half, 
repeat until you get the smallest file which triggers the error. 
Hopefully that will be a single entry which you can then include in your 
post. It also increases the chances of someone looking at it as a large 
.bib file is going to deter people.


Michael

On 05/11/2020 02:38, John wrote:

Hi,

 I tried to read a bib file by  "read_bibliography" function in
"revtools" package, but I got an error message but don't know how to fix
it. Anyone can help? Thank you so much!!

###
library(revtools)
data2 <- read_bibliography("mlf_ref201105_2.bib", return_df = FALSE)
###

Error message:

Error in if (any(names(entry_list) == "author")) { :
   missing value where TRUE/FALSE needed


My "mlf_ref201105_2.bib" file is attached.

I have no problem reading the built-in ris file:


file_location <- system.file(
   "extdata",
   "avian_ecology_bibliography.ris",
   package = "revtools")
x <- read_bibliography(file_location)

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



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

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


Re: [R] Error message when using "revtools" package

2020-11-04 Thread Bert Gunter
Perhaps better suggestion: r-sig-meta-analysis  ?

Bert Gunter

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

[[alternative HTML version deleted]]

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


[R] Error message when using "revtools" package

2020-11-04 Thread John
Hi,

I tried to read a bib file by  "read_bibliography" function in
"revtools" package, but I got an error message but don't know how to fix
it. Anyone can help? Thank you so much!!

###
   library(revtools)
   data2 <- read_bibliography("mlf_ref201105_2.bib", return_df = FALSE)
###

Error message:

Error in if (any(names(entry_list) == "author")) { :
  missing value where TRUE/FALSE needed


   My "mlf_ref201105_2.bib" file is attached.

   I have no problem reading the built-in ris file:


file_location <- system.file(
  "extdata",
  "avian_ecology_bibliography.ris",
  package = "revtools")
x <- read_bibliography(file_location)

__
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 from "patternbar_s"

2020-08-18 Thread PIKAL Petr
Hi

You probably do not have date in your data. Or date in R sense. What 
str(df_c_m) tells you about your date. I believe date is factor or character 
variable, which need to be converted do Date variable by appropriate way - 
e.g. strptime or as.Date.

BTW, "dput" result is useful for exchanging data without losing structure.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of John
> Sent: Monday, August 17, 2020 10:58 AM
> To: r-help 
> Subject: [R] Error message from "patternbar_s"
>
> Hi ,
>
>I got warning message from the following code and the graph did not show
> as expected; I don't have the date on the x-axis and I do not have legend.
> Graph is attached.
>How can I fix it?
> **
> x<-df_c_m$date
> y<-df_c_m$percentage
> group <- df_c_m$direction
> patternbar_s(df_c_m, x,y, group, xlab='', ylab='%', label.size=3, 
> pattern.type=c(
> 'hlines', 'vlines','bricks'), pattern.line.size=c(5, 5, 5),frame.size=1,
>  #,background.color=c('grey', 'chartreuse3',  'bisque')
>  pixel=16, density=c(18, 72, 54),frame.color='black',
>  legend.type='h', legend.h=12, legend.y.pos=0.49, 
> legend.pixel=6,
> legend.w=0.275, legend.x.pos=1.05,
>  legend.label=c("up", "uc", "dn" ),
> bar.width=0.8)+scale_y_continuous(limits = c(0, 100))+ggtitle('')
> **
>
> > df_c_m
>   date direction percentage
> 1  2019M08   up1  71.751356
> 2  2019M09   up1  75.247309
> 3  2019M10   up1  73.748786
> 4  2019M11   up1  72.412511
> 5  2019M12   up1  72.391628
> 6  2020M01   up1  73.431773
> 7  2020M02   up1  72.093799
> 8  2020M03   up1  65.852532
> 9  2020M04   up1  53.943831
> 10 2020M05   up1  49.841939
> 11 2020M06   up1  64.906832
> 12 2020M07   up1  64.419087
> 13 2019M08   uc1  26.538817
> 14 2019M09   uc1  22.657967
> 15 2019M10   uc1  24.500303
> 16 2019M11   uc1  25.870263
> 17 2019M12   uc1  25.969088
> 18 2020M01   uc1  25.248130
> 19 2020M02   uc1  25.272400
> 20 2020M03   uc1  27.652675
> 21 2020M04   uc1  33.452643
> 22 2020M05   uc1  41.622761
> 23 2020M06   uc1  31.469979
> 24 2020M07   uc1  32.572614
> 25 2019M08   dn1   1.709827
> 26 2019M09   dn1   2.094724
> 27 2019M10   dn1   1.750911
> 28 2019M11   dn1   1.717225
> 29 2019M12   dn1   1.639284
> 30 2020M01   dn1   1.320097
> 31 2020M02   dn1   2.633801
> 32 2020M03   dn1   6.494793
> 33 2020M04   dn1  12.603527
> 34 2020M05   dn1   8.535300
> 35 2020M06   dn1   3.623188
> 36 2020M07   dn1   3.008299
> > x
>  [1] "2019M08" "2019M09" "2019M10" "2019M11" "2019M12" "2020M01"
> "2020M02"
>  [8] "2020M03" "2020M04" "2020M05" "2020M06" "2020M07" "2019M08"
> "2019M09"
> [15] "2019M10" "2019M11" "2019M12" "2020M01" "2020M02" "2020M03"
> "2020M04"
> [22] "2020M05" "2020M06" "2020M07" "2019M08" "2019M09" "2019M10"
> "2019M11"
> [29] "2019M12" "2020M01" "2020M02" "2020M03" "2020M04" "2020M05"
> "2020M06"
> [36] "2020M07"
> > y
>  [1] 71.751356 75.247309 73.748786 72.412511 72.391628 73.431773
> 72.093799  [8] 65.852532 53.943831 49.841939 64.906832 64.419087
> 26.538817 22.657967 [15] 24.500303 25.870263 25.969088 25.248130
> 25.272400 27.652675 33.452643 [22] 41.622761 31.469979 32.572614
> 1.709827  2.094724  1.750911  1.717225 [29]  1.639284  1.320097  2.633801
> 6.494793 12.603527  8.535300  3.623188 [36]  3.008299
> > group
>  [1] up1 up1 up1 up1 up1 up1 up1 up1 up1 up1 up1 up1 uc1 uc1 uc1 uc1 uc1
> uc1 uc1
> [20] uc1 uc1 uc1 uc1 uc1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1
> Levels: up1 uc1 dn1
__
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 from "patternbar_s"

2020-08-17 Thread John
Thanks!!

PIKAL Petr  於 2020年8月17日 週一 下午8:17寫道:

> Hi
>
> You probably do not have date in your data. Or date in R sense. What
> str(df_c_m) tells you about your date. I believe date is factor or
> character
> variable, which need to be converted do Date variable by appropriate way -
> e.g. strptime or as.Date.
>
> BTW, "dput" result is useful for exchanging data without losing structure.
>
> Cheers
> Petr
>
> > -Original Message-
> > From: R-help  On Behalf Of John
> > Sent: Monday, August 17, 2020 10:58 AM
> > To: r-help 
> > Subject: [R] Error message from "patternbar_s"
> >
> > Hi ,
> >
> >I got warning message from the following code and the graph did not
> show
> > as expected; I don't have the date on the x-axis and I do not have
> legend.
> > Graph is attached.
> >How can I fix it?
> > **
> > x<-df_c_m$date
> > y<-df_c_m$percentage
> > group <- df_c_m$direction
> > patternbar_s(df_c_m, x,y, group, xlab='', ylab='%', label.size=3,
> > pattern.type=c(
> > 'hlines', 'vlines','bricks'), pattern.line.size=c(5, 5, 5),frame.size=1,
> >  #,background.color=c('grey', 'chartreuse3',  'bisque')
> >  pixel=16, density=c(18, 72, 54),frame.color='black',
> >  legend.type='h', legend.h=12, legend.y.pos=0.49,
> > legend.pixel=6,
> > legend.w=0.275, legend.x.pos=1.05,
> >  legend.label=c("up", "uc", "dn" ),
> > bar.width=0.8)+scale_y_continuous(limits = c(0, 100))+ggtitle('')
> > **
> >
> > > df_c_m
> >   date direction percentage
> > 1  2019M08   up1  71.751356
> > 2  2019M09   up1  75.247309
> > 3  2019M10   up1  73.748786
> > 4  2019M11   up1  72.412511
> > 5  2019M12   up1  72.391628
> > 6  2020M01   up1  73.431773
> > 7  2020M02   up1  72.093799
> > 8  2020M03   up1  65.852532
> > 9  2020M04   up1  53.943831
> > 10 2020M05   up1  49.841939
> > 11 2020M06   up1  64.906832
> > 12 2020M07   up1  64.419087
> > 13 2019M08   uc1  26.538817
> > 14 2019M09   uc1  22.657967
> > 15 2019M10   uc1  24.500303
> > 16 2019M11   uc1  25.870263
> > 17 2019M12   uc1  25.969088
> > 18 2020M01   uc1  25.248130
> > 19 2020M02   uc1  25.272400
> > 20 2020M03   uc1  27.652675
> > 21 2020M04   uc1  33.452643
> > 22 2020M05   uc1  41.622761
> > 23 2020M06   uc1  31.469979
> > 24 2020M07   uc1  32.572614
> > 25 2019M08   dn1   1.709827
> > 26 2019M09   dn1   2.094724
> > 27 2019M10   dn1   1.750911
> > 28 2019M11   dn1   1.717225
> > 29 2019M12   dn1   1.639284
> > 30 2020M01   dn1   1.320097
> > 31 2020M02   dn1   2.633801
> > 32 2020M03   dn1   6.494793
> > 33 2020M04   dn1  12.603527
> > 34 2020M05   dn1   8.535300
> > 35 2020M06   dn1   3.623188
> > 36 2020M07   dn1   3.008299
> > > x
> >  [1] "2019M08" "2019M09" "2019M10" "2019M11" "2019M12" "2020M01"
> > "2020M02"
> >  [8] "2020M03" "2020M04" "2020M05" "2020M06" "2020M07" "2019M08"
> > "2019M09"
> > [15] "2019M10" "2019M11" "2019M12" "2020M01" "2020M02" "2020M03"
> > "2020M04"
> > [22] "2020M05" "2020M06" "2020M07" "2019M08" "2019M09" "2019M10"
> > "2019M11"
> > [29] "2019M12" "2020M01" "2020M02" "2020M03" "2020M04" "2020M05"
> > "2020M06"
> > [36] "2020M07"
> > > y
> >  [1] 71.751356 75.247309 73.748786 72.412511 72.391628 73.431773
> > 72.093799  [8] 65.852532 53.943831 49.841939 64.906832 64.419087
> > 26.538817 22.657967 [15] 24.500303 25.870263 25.969088 25.248130
> > 25.272400 27.652675 33.452643 [22] 41.622761 31.469979 32.572614
> > 1.709827  2.094724  1.750911  1.717225 [29]  1.639284  1.320097  2.633801
> > 6.494793 12.603527  8.535300  3.623188 [36]  3.008299
> > > group
> >  [1] up1 up1 up1 up1 up1 up1 up1 up1 up1 up1 up1 up1 uc1 uc1 uc1 uc1 uc1
> > uc1 uc1
> > [20] uc1 uc1 uc1 uc1 uc1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1 dn1
> > Levels: up1 uc1 dn1
>

[[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 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
> >>>>
> >&g

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(bc

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 d

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

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

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-22 Thread K Amoatwi
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) <
wolfgang.viechtba...@maastrichtuniversity.nl> 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   +6
> >62T   -  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
>

[[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-16 Thread K Amoatwi
Thank you, very much appreciated.

On Tue, Jun 16, 2020 at 12:50 PM Viechtbauer, Wolfgang (SP) <
wolfgang.viechtba...@maastrichtuniversity.nl> 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   +6
> >62T   -  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
>

[[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-16 Thread Viechtbauer, Wolfgang (SP)
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   +6
>62T   -  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.


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

2020-06-16 Thread K Amoatwi
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   +6
62T   -  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

[[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 using boot.ci function

2020-03-30 Thread Rui Barradas

Hello,

David is right, the response is named 'crp', not 'fastMM'. And there is 
no need to run the regression twice.


Try

# function to obtain MSE
MSE <- function(data, indices, formula, method) {
  d <- data[indices, ] # allows boot to select sample
  fit <- lmrob(formula, data = d, method = method)
  ypred <- predict(fit)
  mean((d[["crp"]] - ypred)^2)

}


Hope this helps,

Rui Barradas

Às 15:56 de 30/03/20, David Winsemius escreveu:


On 3/30/20 2:45 AM, varin sacha wrote:

Many thanks David,

But I am not sure the Dataset and newdata are the real problem. I have 
solved, at least I think so, what you were asking. Here below my new R 
code but still the same error message. IMHO the problem is with 
"boot.ci" function...


# # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA,34,35,45,65,43,23,12,11,15,43,23,88,78,79,89,89,99,43,21,34,32,45,65,76,56,45,34,23,12,32) 

glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23,11,12,32,12,14,12,11,10,9,8,9,8,7,90,76,32,12,11,12,23,11,123,32,12,14,34,54,65,76,87) 

crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA,32,123,213,145,143,123,132,143,165,176,181,123,87,567,342,123,143,132,143,234,345,32,123,132,143,345,321,543,231,123) 

age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33,23,65,43,23,43,12,132,56,76,87,98,78,76,56,78,54,34,56,76,99,12,45,34,65,76,87,98,97,64,53) 

sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0) 



Dataset=data.frame( bmi,glucose,crp,age,sex)
newdata=na.omit(Dataset)

#install.packages( "robustbase",dependencies=TRUE )
#install.packages( "boot",dependencies=TRUE )
library(boot)
library(robustbase)

  # function to obtain MSE
  MSE <- function(data, indices, formula,method) {
 d <- data[indices, ] # allows boot to select sample
 fastMM <- lmrob( crp ~ bmi+glucose+age+sex,data=newdata)
 fit <- lmrob(formula, data = d, method="MM")
 ypred <- predict(fit)
    mean((d[["fastMM"]]-ypred)^2)


At this point I do not see any reason for assuming there is a column in 
the d-object with the name "fastMM".





__
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 using boot.ci function

2020-03-30 Thread varin sacha via R-help
Hi David,

Yes, you are right but it does not change anything to my problem. According to 
the error message, what I understand is that there is/are NAs values in "t". 
Using newdata <- na.omit(Dataset) I create new dataset without missing data, so 
I don't understand what is going on with these NAs values. 
I found on the Net (google search) Brian D. Ripley answers this : "Correct your 
'statistic' function not to return NaN."
Ben Bolker in another website answers this : "This is caused by the combination 
of the default na.omit setting and the fact that refit is trying to account for 
omitted values."
So, instead of na.omit(Dataset) I have tried with newdata<- 
na.exclude(Dataset). It does not work !

I am lost ...

 
# # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA,34,35,45,65,43,23,12,11,15,43,23,88,78,79,89,89,99,43,21,34,32,45,65,76,56,45,34,23,12,32)
glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23,11,12,32,12,14,12,11,10,9,8,9,8,7,90,76,32,12,11,12,23,11,123,32,12,14,34,54,65,76,87)
crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA,32,123,213,145,143,123,132,143,165,176,181,123,87,567,342,123,143,132,143,234,345,32,123,132,143,345,321,543,231,123)
age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33,23,65,43,23,43,12,132,56,76,87,98,78,76,56,78,54,34,56,76,99,12,45,34,65,76,87,98,97,64,53)
sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0)

Dataset=data.frame( bmi,glucose,crp,age,sex)
newdata=na.omit(Dataset)

#install.packages( "robustbase",dependencies=TRUE )
#install.packages( "boot",dependencies=TRUE )
library(boot)
library(robustbase)

 # function to obtain MSE
 MSE <- function(data, indices, formula,method) {
    d <- data[indices, ] # allows boot to select sample
    fit <- lmrob(formula, data = d, method="MM")
    ypred <- predict(fit)
   mean((d[["fastMM"]]-ypred)^2)

 }

 # bootstrapping with 100 replications
 results <- boot(data = newdata, statistic = MSE,
  R = 100, formula = crp ~ bmi+glucose+age+sex,method="MM")

str(results)
boot.ci(results, type="norm" )

str(Dataset)
str(newdata)
summary(results$t)
# # # # # # # # # # # # # # # # # # # # # # # # #






Le lundi 30 mars 2020 à 16:56:57 UTC+2, David Winsemius 
 a écrit : 






On 3/30/20 2:45 AM, varin sacha wrote:
> Many thanks David,
>
> But I am not sure the Dataset and newdata are the real problem. I have 
> solved, at least I think so, what you were asking. Here below my new R code 
> but still the same error message. IMHO the problem is with "boot.ci" 
> function...
>
> # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
> bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA,34,35,45,65,43,23,12,11,15,43,23,88,78,79,89,89,99,43,21,34,32,45,65,76,56,45,34,23,12,32)
> glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23,11,12,32,12,14,12,11,10,9,8,9,8,7,90,76,32,12,11,12,23,11,123,32,12,14,34,54,65,76,87)
> crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA,32,123,213,145,143,123,132,143,165,176,181,123,87,567,342,123,143,132,143,234,345,32,123,132,143,345,321,543,231,123)
> age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33,23,65,43,23,43,12,132,56,76,87,98,78,76,56,78,54,34,56,76,99,12,45,34,65,76,87,98,97,64,53)
> sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0)
>
> Dataset=data.frame( bmi,glucose,crp,age,sex)
> newdata=na.omit(Dataset)
>
> #install.packages( "robustbase",dependencies=TRUE )
> #install.packages( "boot",dependencies=TRUE )
> library(boot)
> library(robustbase)
>
>   # function to obtain MSE
>   MSE <- function(data, indices, formula,method) {
>      d <- data[indices, ] # allows boot to select sample
>      fastMM <- lmrob( crp ~ bmi+glucose+age+sex,data=newdata)
>      fit <- lmrob(formula, data = d, method="MM")
>      ypred <- predict(fit)
>     mean((d[["fastMM"]]-ypred)^2)

At this point I do not see any reason for assuming there is a column in 
the d-object with the name "fastMM".



-- 

David

>
>   }
>
>   # bootstrapping with 100 replications
>   results <- boot(data = newdata, statistic = MSE,
>    R = 100, formula = crp ~ bmi+glucose+age+sex,method="MM")
>
> str(results)
> boot.ci(results, type="norm" )
>
> str(Dataset)
> str(newdata)
> summary(results$t)
> # # # # # # # # # # # # # # # # # # # # # # # # #
>
>
>
>
>
>
>
> Le lundi 30 mars 2020 à 00:40:33 UTC+2, David Winsemius 
>  a écrit :
>
>
>
>
>
>
> On 3/28/20 12:25 PM, varin sacha via R-help wrote:
>> Dear R-experts,
>>
>> Here below my "toy" reproducible example showing many warnings and an error 
>> message. What I am interested in is the error message.
>> Of course I can access and view the results doing : summary(results$t) to 
>> give me an idea of what is going on. But I don't know how to correct/solve 
>> my problem. Any help to solve my problem would be highly appreciated.
>
> I do suggest you look at:
>
>
> str(Datas

Re: [R] Error message using boot.ci function

2020-03-30 Thread David Winsemius



On 3/30/20 2:45 AM, varin sacha wrote:

Many thanks David,

But I am not sure the Dataset and newdata are the real problem. I have solved, at least I 
think so, what you were asking. Here below my new R code but still the same error 
message. IMHO the problem is with "boot.ci" function...

# # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA,34,35,45,65,43,23,12,11,15,43,23,88,78,79,89,89,99,43,21,34,32,45,65,76,56,45,34,23,12,32)
glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23,11,12,32,12,14,12,11,10,9,8,9,8,7,90,76,32,12,11,12,23,11,123,32,12,14,34,54,65,76,87)
crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA,32,123,213,145,143,123,132,143,165,176,181,123,87,567,342,123,143,132,143,234,345,32,123,132,143,345,321,543,231,123)
age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33,23,65,43,23,43,12,132,56,76,87,98,78,76,56,78,54,34,56,76,99,12,45,34,65,76,87,98,97,64,53)
sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0)

Dataset=data.frame( bmi,glucose,crp,age,sex)
newdata=na.omit(Dataset)

#install.packages( "robustbase",dependencies=TRUE )
#install.packages( "boot",dependencies=TRUE )
library(boot)
library(robustbase)

  # function to obtain MSE
  MSE <- function(data, indices, formula,method) {
     d <- data[indices, ] # allows boot to select sample
     fastMM <- lmrob( crp ~ bmi+glucose+age+sex,data=newdata)
     fit <- lmrob(formula, data = d, method="MM")
     ypred <- predict(fit)
    mean((d[["fastMM"]]-ypred)^2)


At this point I do not see any reason for assuming there is a column in 
the d-object with the name "fastMM".



--

David



  }

  # bootstrapping with 100 replications
  results <- boot(data = newdata, statistic = MSE,
   R = 100, formula = crp ~ bmi+glucose+age+sex,method="MM")

str(results)
boot.ci(results, type="norm" )

str(Dataset)
str(newdata)
summary(results$t)
# # # # # # # # # # # # # # # # # # # # # # # # #







Le lundi 30 mars 2020 à 00:40:33 UTC+2, David Winsemius 
 a écrit :






On 3/28/20 12:25 PM, varin sacha via R-help wrote:

Dear R-experts,

Here below my "toy" reproducible example showing many warnings and an error 
message. What I am interested in is the error message.
Of course I can access and view the results doing : summary(results$t) to give 
me an idea of what is going on. But I don't know how to correct/solve my 
problem. Any help to solve my problem would be highly appreciated.


I do suggest you look at:


str(Dataset)

str(newdata)


The problem is actually in your construction of Dataset. Do not quote
object names next time.



__
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 using boot.ci function

2020-03-30 Thread varin sacha via R-help
Many thanks David,

But I am not sure the Dataset and newdata are the real problem. I have solved, 
at least I think so, what you were asking. Here below my new R code but still 
the same error message. IMHO the problem is with "boot.ci" function...

# # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA,34,35,45,65,43,23,12,11,15,43,23,88,78,79,89,89,99,43,21,34,32,45,65,76,56,45,34,23,12,32)
glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23,11,12,32,12,14,12,11,10,9,8,9,8,7,90,76,32,12,11,12,23,11,123,32,12,14,34,54,65,76,87)
crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA,32,123,213,145,143,123,132,143,165,176,181,123,87,567,342,123,143,132,143,234,345,32,123,132,143,345,321,543,231,123)
age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33,23,65,43,23,43,12,132,56,76,87,98,78,76,56,78,54,34,56,76,99,12,45,34,65,76,87,98,97,64,53)
sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0)

Dataset=data.frame( bmi,glucose,crp,age,sex)
newdata=na.omit(Dataset)

#install.packages( "robustbase",dependencies=TRUE )
#install.packages( "boot",dependencies=TRUE )
library(boot)
library(robustbase)

 # function to obtain MSE
 MSE <- function(data, indices, formula,method) {
    d <- data[indices, ] # allows boot to select sample
    fastMM <- lmrob( crp ~ bmi+glucose+age+sex,data=newdata)
    fit <- lmrob(formula, data = d, method="MM")
    ypred <- predict(fit)
   mean((d[["fastMM"]]-ypred)^2)

 }

 # bootstrapping with 100 replications
 results <- boot(data = newdata, statistic = MSE,
  R = 100, formula = crp ~ bmi+glucose+age+sex,method="MM")

str(results)
boot.ci(results, type="norm" )

str(Dataset)
str(newdata)
summary(results$t)
# # # # # # # # # # # # # # # # # # # # # # # # #







Le lundi 30 mars 2020 à 00:40:33 UTC+2, David Winsemius 
 a écrit : 






On 3/28/20 12:25 PM, varin sacha via R-help wrote:
> Dear R-experts,
>
> Here below my "toy" reproducible example showing many warnings and an error 
> message. What I am interested in is the error message.
> Of course I can access and view the results doing : summary(results$t) to 
> give me an idea of what is going on. But I don't know how to correct/solve my 
> problem. Any help to solve my problem would be highly appreciated.


I do suggest you look at:


str(Dataset)

str(newdata)


The problem is actually in your construction of Dataset. Do not quote 
object names next time.

-- 

David


>
> # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
> bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA)
> glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23)
> crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA)
> age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33)
> sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA)
>
> Dataset=data.frame("bmi","glucose","crp","age","sex")
> newdata=na.omit(Dataset)
>
> #install.packages( "robustbase",dependencies=TRUE )
> #install.packages( "boot",dependencies=TRUE )
> library(boot)
> library(robustbase)
>
>   # function to obtain MSE
>   MSE <- function(data, indices, formula,method) {
> fastMM <- lmrob( crp ~ bmi+glucose+age+sex, data=newdata)
>      d <- data[indices, ] # allows boot to select sample
>      fit <- lmrob(formula, data = d, method="MM")
>      ypred <- predict(fit)
>     mean((d[["fastMM"]]-ypred)^2)
>   }
>
>   # bootstrapping with 1000 replications
>   results <- boot(data = newdata, statistic = MSE,
>    R = 1000, formula = crp ~ bmi+glucose+age+sex,method="MM")
>
> str(results)
> boot.ci(results, type="norm" )
>
> summary(results$t)
> # # # # # # # # # # # # # # # # # # # # # # # # #
>
> __
> 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] Error message using boot.ci function

2020-03-29 Thread David Winsemius



On 3/28/20 12:25 PM, varin sacha via R-help wrote:

Dear R-experts,

Here below my "toy" reproducible example showing many warnings and an error 
message. What I am interested in is the error message.
Of course I can access and view the results doing : summary(results$t) to give 
me an idea of what is going on. But I don't know how to correct/solve my 
problem. Any help to solve my problem would be highly appreciated.



I do suggest you look at:


str(Dataset)

str(newdata)


The problem is actually in your construction of Dataset. Do not quote 
object names next time.


--

David



# # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # #
bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA)
glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23)
crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA)
age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33)
sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA)

Dataset=data.frame("bmi","glucose","crp","age","sex")
newdata=na.omit(Dataset)

#install.packages( "robustbase",dependencies=TRUE )
#install.packages( "boot",dependencies=TRUE )
library(boot)
library(robustbase)

  # function to obtain MSE
  MSE <- function(data, indices, formula,method) {
fastMM <- lmrob( crp ~ bmi+glucose+age+sex, data=newdata)
     d <- data[indices, ] # allows boot to select sample
     fit <- lmrob(formula, data = d, method="MM")
     ypred <- predict(fit)
    mean((d[["fastMM"]]-ypred)^2)
  }

  # bootstrapping with 1000 replications
  results <- boot(data = newdata, statistic = MSE,
   R = 1000, formula = crp ~ bmi+glucose+age+sex,method="MM")

str(results)
boot.ci(results, type="norm" )

summary(results$t)
# # # # # # # # # # # # # # # # # # # # # # # # #

__
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] Error message using boot.ci function

2020-03-28 Thread varin sacha via R-help
Dear R-experts,

Here below my "toy" reproducible example showing many warnings and an error 
message. What I am interested in is the error message.
Of course I can access and view the results doing : summary(results$t) to give 
me an idea of what is going on. But I don't know how to correct/solve my 
problem. Any help to solve my problem would be highly appreciated.

# # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # # 
bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA)
glucose=c(NA,12,23,11,12,21,23,21,23,43,23,12,NA,23)
crp=c(123,212,154,342,123,111,121,765,453,123,213,211,NA,NA)
age=c(67,45,34,56,87,NA,NA,23,18,65,45,87,65,33)
sex=c(0,1,1,0,1,0,1,0,0,1,1,1,NA,NA)

Dataset=data.frame("bmi","glucose","crp","age","sex")
newdata=na.omit(Dataset) 

#install.packages( "robustbase",dependencies=TRUE )
#install.packages( "boot",dependencies=TRUE )
library(boot)
library(robustbase)

 # function to obtain MSE
 MSE <- function(data, indices, formula,method) {
fastMM <- lmrob( crp ~ bmi+glucose+age+sex, data=newdata)
    d <- data[indices, ] # allows boot to select sample
    fit <- lmrob(formula, data = d, method="MM")
    ypred <- predict(fit)
   mean((d[["fastMM"]]-ypred)^2)
 }

 # bootstrapping with 1000 replications
 results <- boot(data = newdata, statistic = MSE,
  R = 1000, formula = crp ~ bmi+glucose+age+sex,method="MM")

str(results)
boot.ci(results, type="norm" )

summary(results$t)
# # # # # # # # # # # # # # # # # # # # # # # # #

__
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 when adding drift for Arima model

2019-05-13 Thread Michael Howell
Yes that is a little off topic but I will look into it more. Thank you very
much for your help.

Michael

On Mon, May 13, 2019 at 11:33 AM Rui Barradas  wrote:

> Hello,
>
> Sorry for the late reply.
> Inline.
>
> Às 17:54 de 10/05/19, Michael Howell escreveu:
> > Rui,
> > I'm still new to ARIMA forecasting but I examined the PACF and saw
> > significant correlation at lag 2.
>
> You saw a PACF with a significant correlation at lag 2 but not at lag 1.
> When this happens, it many times means that you shouldn't consider the
> lag 2. In fact, it might mean that the process is nonlinear.
> And the ACF shows an insignificant lag 1.
>
> Try
>
> ords <- list(c(1, 0, 0), c(2, 0, 0), c(0, 0, 1))
> fit_list <- lapply(ords, function(o)
>Arima(tsdata, order = o, include.drift = TRUE))
> sapply(fit_list, AIC)
> sapply(fit_list, BIC)
>
>
> Which gives the minimum AIC? And BIC?
> These are not perfect and automated model selection can have problems,
> but it's not unreasonable to compare them.
>
> I believe this is off-topic for R-Help, since it's a question about
> statistics and nonlinear time series is a really, really broad field to
> be discussed here. Try to find local help on this.
>
> Hope this helps,
>
> Rui Barradas
>
> The ACF showed a more gradual decline
> > which seemed to indicate it was Autoregressive. That should mean it's a
> > AR(2) process right?
> >
> > image.png
> > **//___^
> > Regards,
> > Michael Howell
> >
> >
> > On Fri, May 10, 2019 at 12:51 AM Rui Barradas  > > wrote:
> >
> > Why not
> >
> > Arima(tsdata, c(0, 0, 1), include.drift = TRUE)
> >
> > ?
> >
> > Why do you say it should be an AR(2) model?
> >
> > Hope this helps,
> >
> > Rui Barradas
> >
> > Às 06:43 de 10/05/19, Rui Barradas escreveu:
> >  > Hello,
> >  >
> >  > This is just a typo, in R logical values ("true) are not character
> >  > strings. You must pass FALSE (the default, can be omited) or TRUE.
> >  >
> >  > fitdata  <-  Arima(tsdata, c(2, 0, 0), include.drift = TRUE)
> >  >
> >  >
> >  >  From the help page ?logical
> >  >
> >  > Details
> >  >
> >  > TRUE and FALSE are reserved words denoting logical constants in
> > the R
> >  > language, whereas T and F are global variables whose initial
> > values set
> >  > to these. All four are logical(1) vectors.
> >  >
> >  > Hope this helps,
> >  >
> >  > Rui Barradas
> >  >
> >  > Às 00:26 de 10/05/19, Bert Gunter escreveu:
> >  >> In future, always cc the list (unless it's personal,which this
> > isn't). I
> >  >> have done so here. As I am largely ignorant on the subject
> > matter, others
> >  >> will have to help, which is why you should cc the list.
> >  >>
> >  >> 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 Thu, May 9, 2019 at 3:49 PM Michael Howell
> > mailto:mchowe...@gmail.com>>
> >  >> wrote:
> >  >>
> >  >>> I apologize for that. The Arima() function that I'm trying to
> > use comes
> >  >>> from the forecast package. I created a time series object using
> > the
> >  >>> above
> >  >>> 24 observations. The initial model I created doesn't seem to
> > perform so
> >  >>> well so I thought a drift term might fit the data better. I
> > used the
> >  >>> following code to create the time series object:
> >  >>>
> >  >>> tsdata<- ts(data, start = c(1,1), end = c(24,1), frequency = 1)
> >  >>>
> >  >>>
> >  >>> Where* data* is the dataframe that contains the initial 24
> > observations.
> >  >>> I then used the following code to try to create the model:
> >  >>>
> >  >>> fitdata  <-  Arima(tsdata,c(2,0,0),include.drift="true")
> >  
> >  >>>
> >  >>> After doing this I obtained the following error message:
> >  >>>
> >  >>> Error in (order[2] + seasonal$order[2]) > 1 & include.drift:
> > operations
> >   are possible only for numeric, logical or complex types
> >   Traceback:
> >  
> >   1. Arima(tsdata, c(2, 0, 0), include.drift = "true")
> >  >>>
> >  >>>
> >  >>>   I hope this is more clear.
> >  >>>
> >  >>> On Thu, May 9, 2019 at 4:39 PM Bert Gunter
> > mailto:bgunter.4...@gmail.com>>
> >  >>> wrote:
> >  >>>
> >   Please start by reading and following the posting guide linked
> > at the
> >   bottom of this email. In particular:
> >  
> >   1) Post in **plain text** on this plain text list so we don't
> > get the
> >   mangled html of your post.
> >  
> >   2) Tell us what package Arima() is 

Re: [R] Error message when adding drift for Arima model

2019-05-13 Thread Rui Barradas

Hello,

Sorry for the late reply.
Inline.

Às 17:54 de 10/05/19, Michael Howell escreveu:

Rui,
I'm still new to ARIMA forecasting but I examined the PACF and saw 
significant correlation at lag 2. 


You saw a PACF with a significant correlation at lag 2 but not at lag 1. 
When this happens, it many times means that you shouldn't consider the 
lag 2. In fact, it might mean that the process is nonlinear.

And the ACF shows an insignificant lag 1.

Try

ords <- list(c(1, 0, 0), c(2, 0, 0), c(0, 0, 1))
fit_list <- lapply(ords, function(o)
  Arima(tsdata, order = o, include.drift = TRUE))
sapply(fit_list, AIC)
sapply(fit_list, BIC)


Which gives the minimum AIC? And BIC?
These are not perfect and automated model selection can have problems, 
but it's not unreasonable to compare them.


I believe this is off-topic for R-Help, since it's a question about 
statistics and nonlinear time series is a really, really broad field to 
be discussed here. Try to find local help on this.


Hope this helps,

Rui Barradas

The ACF showed a more gradual decline
which seemed to indicate it was Autoregressive. That should mean it's a 
AR(2) process right?


image.png
**//___^
Regards,
Michael Howell


On Fri, May 10, 2019 at 12:51 AM Rui Barradas > wrote:


Why not

Arima(tsdata, c(0, 0, 1), include.drift = TRUE)

?

Why do you say it should be an AR(2) model?

Hope this helps,

Rui Barradas

Às 06:43 de 10/05/19, Rui Barradas escreveu:
 > Hello,
 >
 > This is just a typo, in R logical values ("true) are not character
 > strings. You must pass FALSE (the default, can be omited) or TRUE.
 >
 > fitdata  <-  Arima(tsdata, c(2, 0, 0), include.drift = TRUE)
 >
 >
 >  From the help page ?logical
 >
 > Details
 >
 > TRUE and FALSE are reserved words denoting logical constants in
the R
 > language, whereas T and F are global variables whose initial
values set
 > to these. All four are logical(1) vectors.
 >
 > Hope this helps,
 >
 > Rui Barradas
 >
 > Às 00:26 de 10/05/19, Bert Gunter escreveu:
 >> In future, always cc the list (unless it's personal,which this
isn't). I
 >> have done so here. As I am largely ignorant on the subject
matter, others
 >> will have to help, which is why you should cc the list.
 >>
 >> 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 Thu, May 9, 2019 at 3:49 PM Michael Howell
mailto:mchowe...@gmail.com>>
 >> wrote:
 >>
 >>> I apologize for that. The Arima() function that I'm trying to
use comes
 >>> from the forecast package. I created a time series object using
the
 >>> above
 >>> 24 observations. The initial model I created doesn't seem to
perform so
 >>> well so I thought a drift term might fit the data better. I
used the
 >>> following code to create the time series object:
 >>>
 >>> tsdata<- ts(data, start = c(1,1), end = c(24,1), frequency = 1)
 >>>
 >>>
 >>> Where* data* is the dataframe that contains the initial 24
observations.
 >>> I then used the following code to try to create the model:
 >>>
 >>> fitdata  <-  Arima(tsdata,c(2,0,0),include.drift="true")
 
 >>>
 >>> After doing this I obtained the following error message:
 >>>
 >>> Error in (order[2] + seasonal$order[2]) > 1 & include.drift:
operations
  are possible only for numeric, logical or complex types
  Traceback:
 
  1. Arima(tsdata, c(2, 0, 0), include.drift = "true")
 >>>
 >>>
 >>>   I hope this is more clear.
 >>>
 >>> On Thu, May 9, 2019 at 4:39 PM Bert Gunter
mailto:bgunter.4...@gmail.com>>
 >>> wrote:
 >>>
  Please start by reading and following the posting guide linked
at the
  bottom of this email. In particular:
 
  1) Post in **plain text** on this plain text list so we don't
get the
  mangled html of your post.
 
  2) Tell us what package Arima() is in.
 
  Cheers,
  Bert Gunter
 
 
 
 
  On Thu, May 9, 2019 at 2:27 PM Michael Howell
mailto:mchowe...@gmail.com>>
  wrote:
 
 > Hello everyone,
 > So this is my first post to this list, I'm trying to fit an
Arima
 > (2,0,0)
 > model and I think a drift term would help but I'm getting an
error
 > term
 > when I'm trying to include it. Here is my data:
 >
 > -6.732172338
 > -2.868884273
 > -5.371585089
 > -6.512740463
 > -4.171062657
 > -5.738499071
 > -3

Re: [R] Error message when adding drift for Arima model

2019-05-09 Thread Rui Barradas

Why not

Arima(tsdata, c(0, 0, 1), include.drift = TRUE)

?

Why do you say it should be an AR(2) model?

Hope this helps,

Rui Barradas

Às 06:43 de 10/05/19, Rui Barradas escreveu:

Hello,

This is just a typo, in R logical values ("true) are not character 
strings. You must pass FALSE (the default, can be omited) or TRUE.


fitdata  <-  Arima(tsdata, c(2, 0, 0), include.drift = TRUE)


 From the help page ?logical

Details

TRUE and FALSE are reserved words denoting logical constants in the R 
language, whereas T and F are global variables whose initial values set 
to these. All four are logical(1) vectors.


Hope this helps,

Rui Barradas

Às 00:26 de 10/05/19, Bert Gunter escreveu:

In future, always cc the list (unless it's personal,which this isn't). I
have done so here. As I am largely ignorant on the subject matter, others
will have to help, which is why you should cc the list.

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 Thu, May 9, 2019 at 3:49 PM Michael Howell  
wrote:



I apologize for that. The Arima() function that I'm trying to use comes
from the forecast package. I created a time series object using the 
above

24 observations. The initial model I created doesn't seem to perform so
well so I thought a drift term might fit the data better. I used the
following code to create the time series object:

tsdata<- ts(data, start = c(1,1), end = c(24,1), frequency = 1)


Where* data* is the dataframe that contains the initial 24 observations.
I then used the following code to try to create the model:

fitdata  <-  Arima(tsdata,c(2,0,0),include.drift="true")




After doing this I obtained the following error message:

Error in (order[2] + seasonal$order[2]) > 1 & include.drift: operations

are possible only for numeric, logical or complex types
Traceback:

1. Arima(tsdata, c(2, 0, 0), include.drift = "true")



  I hope this is more clear.

On Thu, May 9, 2019 at 4:39 PM Bert Gunter  
wrote:



Please start by reading and following the posting guide linked at the
bottom of this email. In particular:

1) Post in **plain text** on this plain text list so we don't get the
mangled html of your post.

2) Tell us what package Arima() is in.

Cheers,
Bert Gunter




On Thu, May 9, 2019 at 2:27 PM Michael Howell 
wrote:


Hello everyone,
So this is my first post to this list, I'm trying to fit an Arima 
(2,0,0)
model and I think a drift term would help but I'm getting an error 
term

when I'm trying to include it. Here is my data:

-6.732172338
-2.868884273
-5.371585089
-6.512740463
-4.171062657
-5.738499071
-3.343947176
-1.944879508
-5.464109272
-3.189183392
-3.684700232
-2.168303451
-2.329837082
-0.761979236
-2.189025304
1.094238807
-4.812300745
0.784198777
-1.567075922
0.143963653
1.131119051
2.899746353
-0.498719993
3.121623505 I created a time series object with 24 annual 
observations. I
didn't include dates because there isn't an observation for every 
year.


tsdata<-ts(read.csv("...\\Pre2001LaunchDateTraining.csv"), start =
c(1,1),
end = c(24,1), frequency = 1) I then created a time series object 
using

the
Arima() function. fitdata <- Arima(tsdata,c(2,0,0),include.drift =
"true")
After executing I get this error: Error in (order[2] +
seasonal$order[2]) >
1 & include.drift: operations are possible only for numeric, 
logical or

complex types Traceback: 1. Arima(tsdata, c(2, 0, 0), include.drift =
"true")
Any help would be greatly appreciated!

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


__
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 when adding drift for Arima model

2019-05-09 Thread Rui Barradas

Hello,

This is just a typo, in R logical values ("true) are not character 
strings. You must pass FALSE (the default, can be omited) or TRUE.


fitdata  <-  Arima(tsdata, c(2, 0, 0), include.drift = TRUE)


From the help page ?logical

Details

TRUE and FALSE are reserved words denoting logical constants in the R 
language, whereas T and F are global variables whose initial values set 
to these. All four are logical(1) vectors.


Hope this helps,

Rui Barradas

Às 00:26 de 10/05/19, Bert Gunter escreveu:

In future, always cc the list (unless it's personal,which this isn't). I
have done so here. As I am largely ignorant on the subject matter, others
will have to help, which is why you should cc the list.

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 Thu, May 9, 2019 at 3:49 PM Michael Howell  wrote:


I apologize for that. The Arima() function that I'm trying to use comes
from the forecast package. I created a time series object using the above
24 observations. The initial model I created doesn't seem to perform so
well so I thought a drift term might fit the data better. I used the
following code to create the time series object:

tsdata<- ts(data, start = c(1,1), end = c(24,1), frequency = 1)


Where* data* is the dataframe that contains the initial 24 observations.
I then used the following code to try to create the model:

fitdata  <-  Arima(tsdata,c(2,0,0),include.drift="true")




After doing this I obtained the following error message:

Error in (order[2] + seasonal$order[2]) > 1 & include.drift: operations

are possible only for numeric, logical or complex types
Traceback:

1. Arima(tsdata, c(2, 0, 0), include.drift = "true")



  I hope this is more clear.

On Thu, May 9, 2019 at 4:39 PM Bert Gunter  wrote:


Please start by reading and following the posting guide linked at the
bottom of this email. In particular:

1) Post in **plain text** on this plain text list so we don't get the
mangled html of your post.

2) Tell us what package Arima() is in.

Cheers,
Bert Gunter




On Thu, May 9, 2019 at 2:27 PM Michael Howell 
wrote:


Hello everyone,
So this is my first post to this list, I'm trying to fit an Arima (2,0,0)
model and I think a drift term would help but I'm getting an error term
when I'm trying to include it. Here is my data:

-6.732172338
-2.868884273
-5.371585089
-6.512740463
-4.171062657
-5.738499071
-3.343947176
-1.944879508
-5.464109272
-3.189183392
-3.684700232
-2.168303451
-2.329837082
-0.761979236
-2.189025304
1.094238807
-4.812300745
0.784198777
-1.567075922
0.143963653
1.131119051
2.899746353
-0.498719993
3.121623505 I created a time series object with 24 annual observations. I
didn't include dates because there isn't an observation for every year.

tsdata<-ts(read.csv("...\\Pre2001LaunchDateTraining.csv"), start =
c(1,1),
end = c(24,1), frequency = 1) I then created a time series object using
the
Arima() function. fitdata <- Arima(tsdata,c(2,0,0),include.drift =
"true")
After executing I get this error: Error in (order[2] +
seasonal$order[2]) >
1 & include.drift: operations are possible only for numeric, logical or
complex types Traceback: 1. Arima(tsdata, c(2, 0, 0), include.drift =
"true")
Any help would be greatly appreciated!

 [[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] Error message when adding drift for Arima model

2019-05-09 Thread Bert Gunter
In future, always cc the list (unless it's personal,which this isn't). I
have done so here. As I am largely ignorant on the subject matter, others
will have to help, which is why you should cc the list.

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 Thu, May 9, 2019 at 3:49 PM Michael Howell  wrote:

> I apologize for that. The Arima() function that I'm trying to use comes
> from the forecast package. I created a time series object using the above
> 24 observations. The initial model I created doesn't seem to perform so
> well so I thought a drift term might fit the data better. I used the
> following code to create the time series object:
>
> tsdata<- ts(data, start = c(1,1), end = c(24,1), frequency = 1)
>
>
> Where* data* is the dataframe that contains the initial 24 observations.
> I then used the following code to try to create the model:
>
> fitdata  <-  Arima(tsdata,c(2,0,0),include.drift="true")
>>
>
> After doing this I obtained the following error message:
>
> Error in (order[2] + seasonal$order[2]) > 1 & include.drift: operations
>> are possible only for numeric, logical or complex types
>> Traceback:
>>
>> 1. Arima(tsdata, c(2, 0, 0), include.drift = "true")
>
>
>  I hope this is more clear.
>
> On Thu, May 9, 2019 at 4:39 PM Bert Gunter  wrote:
>
>> Please start by reading and following the posting guide linked at the
>> bottom of this email. In particular:
>>
>> 1) Post in **plain text** on this plain text list so we don't get the
>> mangled html of your post.
>>
>> 2) Tell us what package Arima() is in.
>>
>> Cheers,
>> Bert Gunter
>>
>>
>>
>>
>> On Thu, May 9, 2019 at 2:27 PM Michael Howell 
>> wrote:
>>
>>> Hello everyone,
>>> So this is my first post to this list, I'm trying to fit an Arima (2,0,0)
>>> model and I think a drift term would help but I'm getting an error term
>>> when I'm trying to include it. Here is my data:
>>>
>>> -6.732172338
>>> -2.868884273
>>> -5.371585089
>>> -6.512740463
>>> -4.171062657
>>> -5.738499071
>>> -3.343947176
>>> -1.944879508
>>> -5.464109272
>>> -3.189183392
>>> -3.684700232
>>> -2.168303451
>>> -2.329837082
>>> -0.761979236
>>> -2.189025304
>>> 1.094238807
>>> -4.812300745
>>> 0.784198777
>>> -1.567075922
>>> 0.143963653
>>> 1.131119051
>>> 2.899746353
>>> -0.498719993
>>> 3.121623505 I created a time series object with 24 annual observations. I
>>> didn't include dates because there isn't an observation for every year.
>>>
>>> tsdata<-ts(read.csv("...\\Pre2001LaunchDateTraining.csv"), start =
>>> c(1,1),
>>> end = c(24,1), frequency = 1) I then created a time series object using
>>> the
>>> Arima() function. fitdata <- Arima(tsdata,c(2,0,0),include.drift =
>>> "true")
>>> After executing I get this error: Error in (order[2] +
>>> seasonal$order[2]) >
>>> 1 & include.drift: operations are possible only for numeric, logical or
>>> complex types Traceback: 1. Arima(tsdata, c(2, 0, 0), include.drift =
>>> "true")
>>> Any help would be greatly appreciated!
>>>
>>> [[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] Error message when adding drift for Arima model

2019-05-09 Thread Bert Gunter
Please start by reading and following the posting guide linked at the
bottom of this email. In particular:

1) Post in **plain text** on this plain text list so we don't get the
mangled html of your post.

2) Tell us what package Arima() is in.

Cheers,
Bert Gunter




On Thu, May 9, 2019 at 2:27 PM Michael Howell  wrote:

> Hello everyone,
> So this is my first post to this list, I'm trying to fit an Arima (2,0,0)
> model and I think a drift term would help but I'm getting an error term
> when I'm trying to include it. Here is my data:
>
> -6.732172338
> -2.868884273
> -5.371585089
> -6.512740463
> -4.171062657
> -5.738499071
> -3.343947176
> -1.944879508
> -5.464109272
> -3.189183392
> -3.684700232
> -2.168303451
> -2.329837082
> -0.761979236
> -2.189025304
> 1.094238807
> -4.812300745
> 0.784198777
> -1.567075922
> 0.143963653
> 1.131119051
> 2.899746353
> -0.498719993
> 3.121623505 I created a time series object with 24 annual observations. I
> didn't include dates because there isn't an observation for every year.
>
> tsdata<-ts(read.csv("...\\Pre2001LaunchDateTraining.csv"), start = c(1,1),
> end = c(24,1), frequency = 1) I then created a time series object using the
> Arima() function. fitdata <- Arima(tsdata,c(2,0,0),include.drift = "true")
> After executing I get this error: Error in (order[2] + seasonal$order[2]) >
> 1 & include.drift: operations are possible only for numeric, logical or
> complex types Traceback: 1. Arima(tsdata, c(2, 0, 0), include.drift =
> "true")
> Any help would be greatly appreciated!
>
> [[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] Error message when adding drift for Arima model

2019-05-09 Thread Michael Howell
Hello everyone,
So this is my first post to this list, I'm trying to fit an Arima (2,0,0)
model and I think a drift term would help but I'm getting an error term
when I'm trying to include it. Here is my data:

-6.732172338
-2.868884273
-5.371585089
-6.512740463
-4.171062657
-5.738499071
-3.343947176
-1.944879508
-5.464109272
-3.189183392
-3.684700232
-2.168303451
-2.329837082
-0.761979236
-2.189025304
1.094238807
-4.812300745
0.784198777
-1.567075922
0.143963653
1.131119051
2.899746353
-0.498719993
3.121623505 I created a time series object with 24 annual observations. I
didn't include dates because there isn't an observation for every year.

tsdata<-ts(read.csv("...\\Pre2001LaunchDateTraining.csv"), start = c(1,1),
end = c(24,1), frequency = 1) I then created a time series object using the
Arima() function. fitdata <- Arima(tsdata,c(2,0,0),include.drift = "true")
After executing I get this error: Error in (order[2] + seasonal$order[2]) >
1 & include.drift: operations are possible only for numeric, logical or
complex types Traceback: 1. Arima(tsdata, c(2, 0, 0), include.drift = "true")
Any help would be greatly appreciated!

[[alternative HTML version deleted]]

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


[R] Error Message During ANOVA

2019-03-21 Thread Sara Ciancitto via R-help
I know this is several years later but...

I ran into the same issue and was able to solve it by verifying the spacing 
between variables within original text file. For example, Item1, Item2, and 
Item3 had a single space between them while the numbers in each item had 5 
spaces between them, resulting in a mismatch between r and tm. 

Hope this helps somebody. 

Chris
__
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] Nelson-Aalen Estimator in R: Error Message

2018-05-22 Thread A.C. van der Burgh
Thank you for your reply. It is about the MICE package indeed. 
I have tried your 'solution', but I do not see anything unusual going on. 

My variable Time is a numerical variable, ranging from 0 to 1200. My variable 
Falls is coded as zero one, where one is having the event. 
Maybe this information can help a little more to get an idea of the data.  

-Original Message-
From: peter dalgaard [mailto:pda...@gmail.com] 
Sent: dinsdag 22 mei 2018 17:03
To: A.C. van der Burgh
Cc: r-help@r-project.org
Subject: Re: [R] Nelson-Aalen Estimator in R: Error Message

Hard to tell from the info you are giving us. I assume this regards the "mice" 
package?

One way to proceed is to set options(error=recover) which will dump you into 
the browser() environment when the error occurs and you can oka around and see 
what the value of variables was at the point of the error. This could give you 
a clue about what is going on.

-pd

> On 22 May 2018, at 15:29 , A.C. van der Burgh  
> wrote:
> 
> Dear all,
> 
> Currently, I am doing a research project about serum sodium levels and 
> falling. I am doing my analysis in R. I am performing the multiple imputation 
> right now. I want to perform a survival analysis later, but therefore I need 
> to specify the Nelson-Aalen estimator. My dataset is called DF1, the event 
> indicator is Falls and the time variable is Time. The code that I use is as 
> follows:
> 
> NAE <- nelsonaalen(data = DF1, statusvar = Falls, timevar = Time)
> 
> However, I get this error: Error in Surv(time, status) : Time variable is not 
> numeric
> 
> If I do the following:
> 
> class(DF1$Time) [1] "numeric"
> 
> It shows that my variable is numeric. Can you help me with how I can solve 
> this issue?
> 
> Thank you in advance.
> 
> Lisa
> 
> 
>   [[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.

-- 
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] Nelson-Aalen Estimator in R: Error Message

2018-05-22 Thread peter dalgaard
Hard to tell from the info you are giving us. I assume this regards the "mice" 
package?

One way to proceed is to set options(error=recover) which will dump you into 
the browser() environment when the error occurs and you can oka around and see 
what the value of variables was at the point of the error. This could give you 
a clue about what is going on.

-pd

> On 22 May 2018, at 15:29 , A.C. van der Burgh  
> wrote:
> 
> Dear all,
> 
> Currently, I am doing a research project about serum sodium levels and 
> falling. I am doing my analysis in R. I am performing the multiple imputation 
> right now. I want to perform a survival analysis later, but therefore I need 
> to specify the Nelson-Aalen estimator. My dataset is called DF1, the event 
> indicator is Falls and the time variable is Time. The code that I use is as 
> follows:
> 
> NAE <- nelsonaalen(data = DF1, statusvar = Falls, timevar = Time)
> 
> However, I get this error: Error in Surv(time, status) : Time variable is not 
> numeric
> 
> If I do the following:
> 
> class(DF1$Time) [1] "numeric"
> 
> It shows that my variable is numeric. Can you help me with how I can solve 
> this issue?
> 
> Thank you in advance.
> 
> Lisa
> 
> 
>   [[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.

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


[R] Nelson-Aalen Estimator in R: Error Message

2018-05-22 Thread A.C. van der Burgh
Dear all,

Currently, I am doing a research project about serum sodium levels and falling. 
I am doing my analysis in R. I am performing the multiple imputation right now. 
I want to perform a survival analysis later, but therefore I need to specify 
the Nelson-Aalen estimator. My dataset is called DF1, the event indicator is 
Falls and the time variable is Time. The code that I use is as follows:

NAE <- nelsonaalen(data = DF1, statusvar = Falls, timevar = Time)

However, I get this error: Error in Surv(time, status) : Time variable is not 
numeric

If I do the following:

class(DF1$Time) [1] "numeric"

It shows that my variable is numeric. Can you help me with how I can solve this 
issue?

Thank you in advance.

Lisa


[[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 from sqldf

2018-03-10 Thread José María Mateos
On Sat, Mar 10, 2018 at 09:30:42PM +, Ding, Yuan Chun wrote:
> chr10 <- sqldf("select * from manifest where CHR==10")
> 
> UCN3cpg <-  sqldf("select * from chr10 where MAPINFO between 5405573 and 
> 5407594),
> overwrite = TRUE")
> Error: Table chr10 exists in database, and both overwrite and append are FALSE

Could it be that `chr10` already exists when you try to run your code. 
What about rewriting it as:

chr10 <- sqldf("select * from manifest where CHR==10", overwrite = TRUE)

Also, it seems to me that the second line is not closing the quotes 
properly. Shouldn't this be correct instead?

UCN3cpg <-  sqldf("select * from chr10 where MAPINFO between 5405573 and 
5407594",
  overwrite = TRUE)

Cheers,

-- 
José María (Chema) Mateos
https://rinzewind.org/blog-es || https://rinzewind.org/blog-en

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


[R] error message from sqldf

2018-03-10 Thread Ding, Yuan Chun
Dear R users,

I got the following error message from running sqldf code in R.   do you know 
how to fix it?  I read the sqldf package instruction and did not find a 
solution.

Thank you,

Ding

chr10 <- sqldf("select * from manifest where CHR==10")

UCN3cpg <-  sqldf("select * from chr10 where MAPINFO between 5405573 and 
5407594),
overwrite = TRUE")
Error: Table chr10 exists in database, and both overwrite and append are FALSE


>





-
-SECURITY/CONFIDENTIALITY WARNING-
This message (and any attachments) are intended solely f...{{dropped:22}}

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


Re: [R] error message for function: lmer (from lme4 package)

2017-11-17 Thread David Winsemius

> snipped
> 
> Hi, Bert,
> Sorry about that! David seemed to be able to read the post since he replied.

The only reason it appear readable was that you copied me as well as the list. 
Then HTML was still  the basic format although it did npt appear that way to me 
since my reader could handle it without difficulty. Everybody else saw a 
"complete mess" as Bert accurately put it.

Again, learn to post in plain text. Learn to post data objects with dput.

-- 
David.
> Here I just email you the sample code and error message:
>> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), 
>> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( 
>> rep("11",6),rep("12",6),rep(> example.3levels replicate conditions1  
>> 43. 0 112  42.0942 1 113  57.8131
>>  2 114  57.1726 3 115  77.8678 4 116 
>>  44.7578 5 117  69.5078 0 128  52.0581   
>>   1 129  40.0602 2 1210 45.5487 3 
>> 1211 43.6201 4 1212 60.4939 5 1213 64.1932   
>>   0 1314 53.4055 1 1315 59.6701 2
>>  1316 52.6922 3 1317 53.8712 4 1318 60.2770  
>>5 13> m.example.3=lmer(as.numeric( levels)~conditions+( 
>> conditions|replicate),data= example.3)Error in lmer(as.numeric(levels) ~ 
>> conditions + (conditions | replicate),  :   could not find function "lmer"> 
> Hopefully you could read it and provide some comments!
> Thank you very much for your time.
> Kind regards,
> Ace

snipped

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

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   
-Gehm's Corollary to Clarke's Third Law

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


Re: [R] error message for function: lmer (from lme4 package)

2017-11-16 Thread Fix Ace via R-help
Hi, Bert,
Thank you very much for the comments and suggestions!
Ace 

On Wednesday, November 15, 2017 10:44 AM, Bert Gunter 
 wrote:
 

 Always cc the list, which I have done here. I am not a (free) private 
consultant, nor do I have all the answers.

Based on what you sent me, which is not what you have previously posted, you 
failed to load the lme3 package. See ?library.

As for the appropriateness of your modeling, you should do what David already 
suggested and post to the r-sig-mixed-models list instead.

-- Bert



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 Wed, Nov 15, 2017 at 5:09 AM, Fix Ace  wrote:

Hi, Bert,
Sorry about that! David seemed to be able to read the post since he replied. 
Here I just email you the sample code and error message:
> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), 
> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( 
> rep("11",6),rep("12",6),rep(> example.3    levels replicate conditions1  
> 43.         0         112  42.0942         1         113  57.8131         
> 2         114  57.1726         3         115  77.8678         4         116  
> 44.7578         5         117  69.5078         0         128  52.0581         
> 1         129  40.0602         2         1210 45.5487         3         1211 
> 43.6201         4         1212 60.4939         5         1213 64.1932         
> 0         1314 53.4055         1         1315 59.6701         2         1316 
> 52.6922         3         1317 53.8712         4         1318 60.2770         
> 5         13> m.example.3=lmer(as.numeric( levels)~conditions+( 
> conditions|replicate),data= example.3)Error in lmer(as.numeric(levels) ~ 
> conditions + (conditions | replicate),  :   could not find function "lmer"> 
Hopefully you could read it and provide some comments!
Thank you very much for your time.
Kind regards,
Ace

 

On Tuesday, November 14, 2017 6:12 PM, Bert Gunter  
wrote:
 

 Still a complete mess!

Post in **plain text**. This should be an option in your email software. Please 
seek local help if you cannot figure out how to do this.

-- Bert  



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, Nov 14, 2017 at 12:49 PM, Fix Ace via R-help  
wrote:

Hi, David,
Thank you very much for getting back to me! Sorry about the messy code example. 
I am re-posting here (including the error message):
> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), 
> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( 
> rep("11",6),rep("12",6),rep(" 13",6)))> example.3    levels replicate 
> conditions1  43.         0         112  42.0942         1         113  
> 57.8131         2         114  57.1726         3         115  77.8678         
> 4         116  44.7578         5         117  69.5078         0         128  
> 52.0581         1         129  40.0602         2         1210 45.5487         
> 3         1211 43.6201         4         1212 60.4939         5         1213 
> 64.1932         0         1314 53.4055         1         1315 59.6701         
> 2         1316 52.6922         3         1317 53.8712         4         1318 
> 60.2770         5         13> m.example.3=lmer(as.numeric( 
> levels)~conditions+( conditions|replicate),data= example.3)Error: number of 
> observations (=18) <= number of random effects (=18) for term (conditions | 
> replicate); the random-effects parameters and the residual variance (or scale 
> parameter) are probably unidentifiable> 
Please let me know if it is readable this time. 
Again, many thanks for your time and please help me fix the issue.
Kind regards,
Ace

    On Tuesday, November 14, 2017 12:19 PM, David Winsemius 
 wrote:



> On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help  wrote:
>
> Dear R Community,
> My data have 3 conditions and each condition has 6 replicates. I am trying to 
> fit my data for a linear mixed model using the lmer function from lme4 
> package to find the random effects of the replicates;

Better venue for this question might be SIG-mixed-models. See the link 
avaialble at the bottom of every posting from rhelp:

https://stat.ethz.ch/mailman/ listinfo/r-help:



> however, I got the error message. Here are the example codes:
>> example.3=data.frame(levels= as.numeric(XXX[,c(4)]), 
>> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c( 
>> rep("11",6),rep("12",6),rep(" 13",6)))> example.3    levels replicate 
>> conditions1  43.        0        112  42.0942        1        113  
>> 57.8131        2        114  57.1726        3        115  77.8678        4   
>>      116  44.7578        5        117  69.5078        0        128  52.0581  
>>       1        129  40.0602        2        1210 45.5487        3        
>> 1211 43.6201     

Re: [R] error message for function: lmer (from lme4 package)

2017-11-15 Thread Bert Gunter
Always cc the list, which I have done here. I am not a (free) private
consultant, nor do I have all the answers.

Based on what you sent me, which is not what you have previously posted,
you failed to load the lme3 package. See ?library.

As for the appropriateness of your modeling, you should do what David
already suggested and post to the r-sig-mixed-models list instead.

-- Bert



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 Wed, Nov 15, 2017 at 5:09 AM, Fix Ace  wrote:

> Hi, Bert,
>
> Sorry about that! David seemed to be able to read the post since he
> replied. Here I just email you the sample code and error message:
>
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep(>
> example.3
> levels replicate conditions
> 1  43. 0 11
> 2  42.0942 1 11
> 3  57.8131 2 11
> 4  57.1726 3 11
> 5  77.8678 4 11
> 6  44.7578 5 11
> 7  69.5078 0 12
> 8  52.0581 1 12
> 9  40.0602 2 12
> 10 45.5487 3 12
> 11 43.6201 4 12
> 12 60.4939 5 12
> 13 64.1932 0 13
> 14 53.4055 1 13
> 15 59.6701 2 13
> 16 52.6922 3 13
> 17 53.8712 4 13
> 18 60.2770 5 13
> > m.example.3=lmer(as.numeric(levels)~conditions+(
> conditions|replicate),data=example.3)
> Error in lmer(as.numeric(levels) ~ conditions + (conditions | replicate),
> :
>   could not find function "lmer"
> >
>
> Hopefully you could read it and provide some comments!
>
> Thank you very much for your time.
>
> Kind regards,
>
> Ace
>
>
>
>
> On Tuesday, November 14, 2017 6:12 PM, Bert Gunter 
> wrote:
>
>
> Still a complete mess!
>
> Post in **plain text**. This should be an option in your email software.
> Please seek local help if you cannot figure out how to do this.
>
> -- Bert
>
>
>
> 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, Nov 14, 2017 at 12:49 PM, Fix Ace via R-help  > wrote:
>
> Hi, David,
> Thank you very much for getting back to me! Sorry about the messy code
> example. I am re-posting here (including the error message):
> > example.3=data.frame(levels= as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep(" 13",6)))> example.3levels replicate
> conditions1  43. 0 112  42.0942 1 113
> 57.8131 2 114  57.1726 3 115  77.8678
>   4 116  44.7578 5 117  69.5078 0
> 128  52.0581 1 129  40.0602 2 1210 45.5487
> 3 1211 43.6201 4 1212 60.4939 5
> 1213 64.1932 0 1314 53.4055 1 1315
> 59.6701 2 1316 52.6922 3 1317 53.8712
>   4 1318 60.2770 5 13> m.example.3=lmer(as.numeric(
> levels)~conditions+( conditions|replicate),data= example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> Please let me know if it is readable this time.
> Again, many thanks for your time and please help me fix the issue.
> Kind regards,
> Ace
>
> On Tuesday, November 14, 2017 12:19 PM, David Winsemius <
> dwinsem...@comcast.net> wrote:
>
>
>
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help 
> wrote:
> >
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am
> trying to fit my data for a linear mixed model using the lmer function from
> lme4 package to find the random effects of the replicates;
>
> Better venue for this question might be SIG-mixed-models. See the link
> avaialble at the bottom of every posting from rhelp:
>
> https://stat.ethz.ch/mailman/ listinfo/r-help
> :
>
>
>
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels= as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2"," 3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep(" 13",6)))> example.3levels replicate
> conditions1  43.0112  42.09421113
> 57.81312114  57.17263115  77.86784
>   116  44.75785117  69.50780128
> 52.05811129  40.060221210 45.54873
>   1211 43.6201 

Re: [R] error message for function: lmer (from lme4 package)

2017-11-14 Thread David Winsemius

> On Nov 14, 2017, at 12:49 PM, Fix Ace  wrote:
> 
> Hi, David,
> 
> Thank you very much for getting back to me! Sorry about the messy code 
> example. I am re-posting here (including the error message):
> 
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))
> > example.3
> levels replicate conditions
> 1  43. 0 11
> 2  42.0942 1 11
> 3  57.8131 2 11
> 4  57.1726 3 11
> 5  77.8678 4 11
> 6  44.7578 5 11
> 7  69.5078 0 12
> 8  52.0581 1 12
> 9  40.0602 2 12
> 10 45.5487 3 12
> 11 43.6201 4 12
> 12 60.4939 5 12
> 13 64.1932 0 13
> 14 53.4055 1 13
> 15 59.6701 2 13
> 16 52.6922 3 13
> 17 53.8712 4 13
> 18 60.2770 5 13
> > m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)
> Error: number of observations (=18) <= number of random effects (=18) for 
> term (conditions | replicate); the random-effects parameters and the residual 
> variance (or scale parameter) are probably unidentifiable

The error message seems fairly clear. The formula you have provided is asking 
for estimation of too many parameters. I think you probably want:

m.example.3=lmer(levels~conditions+(1|replicate),data=example.3)

... although your description of the hypothesis under test is ... non-existent.

-- 
David.
> > 
> 
> Please let me know if it is readable this time. 
> 
> Again, many thanks for your time and please help me fix the issue.
> 
> Kind regards,
> 
> Ace
> 
> 
> On Tuesday, November 14, 2017 12:19 PM, David Winsemius 
>  wrote:
> 
> 
> 
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help  
> > wrote:
> > 
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am trying 
> > to fit my data for a linear mixed model using the lmer function from lme4 
> > package to find the random effects of the replicates;
> 
> Better venue for this question might be SIG-mixed-models. See the link 
> avaialble at the bottom of every posting from rhelp:
> 
> https://stat.ethz.ch/mailman/listinfo/r-help:
> 
> 
> 
> 
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))>
> >>  example.3levels replicate conditions1  43.0 112  
> >> 42.09421113  57.81312114  57.17263 
> >>115  77.86784116  44.75785117  
> >> 69.50780128  52.05811129  40.06022 
> >>1210 45.548731211 43.620141212 
> >> 60.493951213 64.193201314 53.40551 
> >>1315 59.670121316 52.692231317 
> >> 53.871241318 60.2770513> 
> >> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error:
> >>  number of observations (=18) <= number of random effects (=18) for term 
> >> (conditions | replicate); the random-effects parameters and the residual 
> >> variance (or scale parameter) are probably u
 nidentifiable> 
> > Could anyone help me figure out how to fix the issue? 
> > Thank you very much for any inputs!
> > Ace
> 
> > 
> > [[alternative HTML version deleted]]
> 
> Complete mess. If you haven't yet been advised to posting in plain text, then 
> this should be your wakeup call. If you have, then why are you ignoring 
> sensible advice?
> 
> 
> > 
> > __
> > 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.
> 
> David Winsemius
> Alameda, CA, USA
> 
> 'Any technology distinguishable from magic is insufficiently advanced.'  
> -Gehm's Corollary to Clarke's Third Law
> 
> 
> 
> 
> 
> 
> 

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   
-Gehm's Corollary to Clarke's Third Law

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


Re: [R] error message for function: lmer (from lme4 package)

2017-11-14 Thread Bert Gunter
Still a complete mess!

Post in **plain text**. This should be an option in your email software.
Please seek local help if you cannot figure out how to do this.

-- Bert



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, Nov 14, 2017 at 12:49 PM, Fix Ace via R-help 
wrote:

> Hi, David,
> Thank you very much for getting back to me! Sorry about the messy code
> example. I am re-posting here (including the error message):
> > example.3=data.frame(levels=as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep("13",6)))> example.3levels replicate
> conditions1  43. 0 112  42.0942 1 113
> 57.8131 2 114  57.1726 3 115  77.8678
>   4 116  44.7578 5 117  69.5078 0
> 128  52.0581 1 129  40.0602 2 1210 45.5487
> 3 1211 43.6201 4 1212 60.4939 5
> 1213 64.1932 0 1314 53.4055 1 1315
> 59.6701 2 1316 52.6922 3 1317 53.8712
>   4 1318 60.2770 5 13> m.example.3=lmer(as.numeric(
> levels)~conditions+(conditions|replicate),data=example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> Please let me know if it is readable this time.
> Again, many thanks for your time and please help me fix the issue.
> Kind regards,
> Ace
>
> On Tuesday, November 14, 2017 12:19 PM, David Winsemius <
> dwinsem...@comcast.net> wrote:
>
>
>
> > On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help 
> wrote:
> >
> > Dear R Community,
> > My data have 3 conditions and each condition has 6 replicates. I am
> trying to fit my data for a linear mixed model using the lmer function from
> lme4 package to find the random effects of the replicates;
>
> Better venue for this question might be SIG-mixed-models. See the link
> avaialble at the bottom of every posting from rhelp:
>
> https://stat.ethz.ch/mailman/listinfo/r-help:
>
>
>
> > however, I got the error message. Here are the example codes:
> >> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),
> replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(
> rep("11",6),rep("12",6),rep("13",6)))> example.3levels replicate
> conditions1  43.0112  42.09421113
> 57.81312114  57.17263115  77.86784
>   116  44.75785117  69.50780128
> 52.05811129  40.060221210 45.54873
>   1211 43.620141212 60.493951213
> 64.193201314 53.405511315 59.67012
>   1316 52.692231317 53.871241318
> 60.2770513> m.example.3=lmer(as.numeric(
> levels)~conditions+(conditions|replicate),data=example.3)Error: number of
> observations (=18) <= number of random effects (=18) for term (conditions |
> replicate); the random-effects parameters and the residual variance (or
> scale parameter) are probably unidentifiable>
> > Could anyone help me figure out how to fix the issue?
> > Thank you very much for any inputs!
> > Ace
> >
> > [[alternative HTML version deleted]]
>
> Complete mess. If you haven't yet been advised to posting in plain text,
> then this should be your wakeup call. If you have, then why are you
> ignoring sensible advice?
>
>
> >
> > __
> > 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.
>
> David Winsemius
> Alameda, CA, USA
>
> 'Any technology distinguishable from magic is insufficiently advanced.'
> -Gehm's Corollary to Clarke's Third Law
>
>
>
>
>
>
>
> [[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] error message for function: lmer (from lme4 package)

2017-11-14 Thread Fix Ace via R-help
Hi, David,
Thank you very much for getting back to me! Sorry about the messy code example. 
I am re-posting here (including the error message):
> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))>
>  example.3    levels replicate conditions1  43.         0         112  
> 42.0942         1         113  57.8131         2         114  57.1726         
> 3         115  77.8678         4         116  44.7578         5         117  
> 69.5078         0         128  52.0581         1         129  40.0602         
> 2         1210 45.5487         3         1211 43.6201         4         1212 
> 60.4939         5         1213 64.1932         0         1314 53.4055         
> 1         1315 59.6701         2         1316 52.6922         3         1317 
> 53.8712         4         1318 60.2770         5         13> 
> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error:
>  number of observations (=18) <= number of random effects (=18) for term 
> (conditions | replicate); the random-effects parameters and the residual 
> variance (or scale parameter) are probably unidentifiable> 
Please let me know if it is readable this time. 
Again, many thanks for your time and please help me fix the issue.
Kind regards,
Ace 

On Tuesday, November 14, 2017 12:19 PM, David Winsemius 
 wrote:
 

 
> On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help  wrote:
> 
> Dear R Community,
> My data have 3 conditions and each condition has 6 replicates. I am trying to 
> fit my data for a linear mixed model using the lmer function from lme4 
> package to find the random effects of the replicates;

Better venue for this question might be SIG-mixed-models. See the link 
avaialble at the bottom of every posting from rhelp:

https://stat.ethz.ch/mailman/listinfo/r-help:



> however, I got the error message. Here are the example codes:
>> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))>
>>  example.3    levels replicate conditions1  43.        0        112  
>> 42.0942        1        113  57.8131        2        114  57.1726        3   
>>      115  77.8678        4        116  44.7578        5        117  69.5078  
>>       0        128  52.0581        1        129  40.0602        2        
>> 1210 45.5487        3        1211 43.6201        4        1212 60.4939       
>>  5        1213 64.1932        0        1314 53.4055        1        1315 
>> 59.6701        2        1316 52.6922        3        1317 53.8712        4   
>>      1318 60.2770        5        13> 
>> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error:
>>  number of observations (=18) <= number of random effects (=18) for term 
>> (conditions | replicate); the random-effects parameters and the residual 
>> variance (or scale parameter) are probably unidentifiable> 
> Could anyone help me figure out how to fix the issue? 
> Thank you very much for any inputs!
> Ace
> 
>     [[alternative HTML version deleted]]

Complete mess. If you haven't yet been advised to posting in plain text, then 
this should be your wakeup call. If you have, then why are you ignoring 
sensible advice?


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

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'  
-Gehm's Corollary to Clarke's Third Law






   
[[alternative HTML version deleted]]

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

Re: [R] error message for function: lmer (from lme4 package)

2017-11-14 Thread David Winsemius

> On Nov 14, 2017, at 5:13 AM, Fix Ace via R-help  wrote:
> 
> Dear R Community,
> My data have 3 conditions and each condition has 6 replicates. I am trying to 
> fit my data for a linear mixed model using the lmer function from lme4 
> package to find the random effects of the replicates;

Better venue for this question might be SIG-mixed-models. See the link 
avaialble at the bottom of every posting from rhelp:

https://stat.ethz.ch/mailman/listinfo/r-help:



> however, I got the error message. Here are the example codes:
>> example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))>
>>  example.3levels replicate conditions1  43. 0 112  
>> 42.0942 1 113  57.8131 2 114  57.1726
>>  3 115  77.8678 4 116  44.7578 5 117 
>>  69.5078 0 128  52.0581 1 129  40.0602   
>>   2 1210 45.5487 3 1211 43.6201 4 
>> 1212 60.4939 5 1213 64.1932 0 1314 53.4055   
>>   1 1315 59.6701 2 1316 52.6922 3
>>  1317 53.8712 4 1318 60.2770 5 13> 
>> m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error:
>>  number of observations (=18) <= number of random effects (=18) for term 
>> (conditions | replicate); the random-effects parameters and the residual 
>> variance (o
 r scale parameter) are probably unidentifiable> 
> Could anyone help me figure out how to fix the issue? 
> Thank you very much for any inputs!
> Ace
> 
>   [[alternative HTML version deleted]]

Complete mess. If you haven't yet been advised to posting in plain text, then 
this should be your wakeup call. If you have, then why are you ignoring 
sensible advice?


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

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   
-Gehm's Corollary to Clarke's Third Law

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


[R] error message for function: lmer (from lme4 package)

2017-11-14 Thread Fix Ace via R-help
Dear R Community,
My data have 3 conditions and each condition has 6 replicates. I am trying to 
fit my data for a linear mixed model using the lmer function from lme4 package 
to find the random effects of the replicates; however, I got the error message. 
Here are the example codes:
>example.3=data.frame(levels=as.numeric(XXX[,c(4)]),replicate=rep(c("0","1","2","3","4","5"),3),conditions=c(rep("11",6),rep("12",6),rep("13",6)))>
> example.3    levels replicate conditions1  43.         0         112  
>42.0942         1         113  57.8131         2         114  57.1726         
>3         115  77.8678         4         116  44.7578         5         117  
>69.5078         0         128  52.0581         1         129  40.0602         
>2         1210 45.5487         3         1211 43.6201         4         1212 
>60.4939         5         1213 64.1932         0         1314 53.4055         
>1         1315 59.6701         2         1316 52.6922         3         1317 
>53.8712         4         1318 60.2770         5         13> 
>m.example.3=lmer(as.numeric(levels)~conditions+(conditions|replicate),data=example.3)Error:
> number of observations (=18) <= number of random effects (=18) for term 
>(conditions | replicate); the random-effects parameters and the residual 
>variance (or scale parameter) are probably unidentifiable> 
Could anyone help me figure out how to fix the issue? 
Thank you very much for any inputs!
Ace

[[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] Error message "cs_lu(A) failed: near-singular A (or out of memory)"

2017-06-05 Thread Jeff Newmiller
This appears to be a case of insufficient understanding of statistics, which is 
not on topic for r-help. Look at how well the per-firm models would work... my 
guess is that some of the firms have insufficient data for useful analysis. If 
that is not it, consider providing a more concrete example on 
stats.stackexchange.com.
-- 
Sent from my phone. Please excuse my brevity.

On June 5, 2017 3:14:59 AM PDT, "Keilhacker, Michael" 
 wrote:
>Dear Arne,
>
>
>thank you very much upfront for your time that you invest in answering
>my question.
>
>
>I'm using your systemfit R package to analyze if companies risk
>appetite has a relationship to their performance and how it evolves
>over time. We collected data for ca. 80 companies, from 6 segments over
>15 years that gives us a final data set with 1,312 firm-year
>observations. We have set up 3 equations (based on existing SEM from
>literature) and experience the following:
>
>- The systemfit package performs well when using no dummy variables
>(e.g. for year, segment, firm)
>
>- When adding dummy variables (year / segment) the systemfit package
>still provides results; however, if we remove the segment dummy
>variable and add a firm dummy variable we experience the error message:
>"cs_lu(A) failed: near-singular A (or out of memory)"
>
>- We also tested the systemfit package with firm and year dummy
>variable using a sub-sample of our data (ca. 10 companies) and the
>package worked without any error messages
>
>- Afterwards we tested the systemfit package using a server (64 gb ram,
>16 core,...) by applying the systemfit package again on the final data
>set. However, we experienced again the same error message.
>
>
>We use R 3.3.2 and the systemfit package 1.1-20.
>
>
>I would be very grateful if you could support us anyhow and give us a
>hint how we could solve the situation.
>
>
>Thanks again for your help.
>
>
>Warm Regards from Munich,
>
>Michael
>___
>
>Michael Keilhacker, MBA, M.A.
>Logistics and Supply Chain Management
>Technische Universit�t M�nchen � TUM School of Management
>Arcisstra�e 21 � 80333 M�nchen �
>+49-163-5454918 �
>michael.keilhac...@tum.de
>www.log.wi.tum.de
>
>   [[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] Error message "cs_lu(A) failed: near-singular A (or out of memory)"

2017-06-05 Thread Keilhacker, Michael
Dear Arne,


thank you very much upfront for your time that you invest in answering my 
question.


I'm using your systemfit R package to analyze if companies risk appetite has a 
relationship to their performance and how it evolves over time. We collected 
data for ca. 80 companies, from 6 segments over 15 years that gives us a final 
data set with 1,312 firm-year observations. We have set up 3 equations (based 
on existing SEM from literature) and experience the following:

- The systemfit package performs well when using no dummy variables (e.g. for 
year, segment, firm)

- When adding dummy variables (year / segment) the systemfit package still 
provides results; however, if we remove the segment dummy variable and add a 
firm dummy variable we experience the error message: "cs_lu(A) failed: 
near-singular A (or out of memory)"

- We also tested the systemfit package with firm and year dummy variable using 
a sub-sample of our data (ca. 10 companies) and the package worked without any 
error messages

- Afterwards we tested the systemfit package using a server (64 gb ram, 16 
core,...) by applying the systemfit package again on the final data set. 
However, we experienced again the same error message.


We use R 3.3.2 and the systemfit package 1.1-20.


I would be very grateful if you could support us anyhow and give us a hint how 
we could solve the situation.


Thanks again for your help.


Warm Regards from Munich,

Michael
___

Michael Keilhacker, MBA, M.A.
Logistics and Supply Chain Management
Technische Universit�t M�nchen � TUM School of Management
Arcisstra�e 21 � 80333 M�nchen � +49-163-5454918 � 
michael.keilhac...@tum.de
www.log.wi.tum.de

[[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 when executing wordcloud(bd_clean)

2016-10-31 Thread Jeff Newmiller
A) Please post in plain text so your code doesn't get mangled by HTML.

B) Please provide a reproducible example. [1] [2]

C) RStudio is probably not the problem, but if it is then this is the wrong 
place to ask about that (see the RStudio website for help with that software). 
Simply try your code directly in R to verify that RStudio is not the problem, 
and then leave it out of your questions asked here from now on. 

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

[2] http://adv-r.had.co.nz/Reproducibility.html
-- 
Sent from my phone. Please excuse my brevity.

On October 29, 2016 3:07:33 PM PDT, betelgui...@gmail.com wrote:
>Hello everybody
>
>I am using RStudio version 0.99.903, and recently installed and loaded
>the
>package wordcloud.  My platform is Mac OS Sierra.
>
>I came across the following error message when I execute the command
>line
>wordcloud(bd_clean):
>
>> wordcloud(bd_clean)
>Error in if (min.freq > max(freq)) min.freq <- 0 :
>missing value where TRUE/FALSE needed
>In addition: Warning messages:
>1: In mclapply(unname(content(x)), termFreq, control) :
>scheduled cores 2 encountered errors in user code, all values of the
>jobs
>will be affected
>2: In simple_triplet_matrix(i = i, j = j, v = as.numeric(v), nrow =
>length(allTerms), :
>NAs introduced by coercion
>
>I have a hunch it may have something to do with my RStudio working
>directory and the wordcloud package installed.  I created this post to
>see
>if anybody have come across similar error before?  If so, can someone
>help
>to shed some light to what this error means, and what are the
>workarounds
>available for this error.
>
>Thank you in advance for your responses
>
>Best regards
>
>
>--
>Khairil Anuar SULONG AHMAD
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

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


[R] Error Message when executing wordcloud(bd_clean)

2016-10-30 Thread betelguiese
Hello everybody

I am using RStudio version 0.99.903, and recently installed and loaded the
package wordcloud.  My platform is Mac OS Sierra.

I came across the following error message when I execute the command line
wordcloud(bd_clean):

> wordcloud(bd_clean)
Error in if (min.freq > max(freq)) min.freq <- 0 :
missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In mclapply(unname(content(x)), termFreq, control) :
scheduled cores 2 encountered errors in user code, all values of the jobs
will be affected
2: In simple_triplet_matrix(i = i, j = j, v = as.numeric(v), nrow =
length(allTerms), :
NAs introduced by coercion

I have a hunch it may have something to do with my RStudio working
directory and the wordcloud package installed.  I created this post to see
if anybody have come across similar error before?  If so, can someone help
to shed some light to what this error means, and what are the workarounds
available for this error.

Thank you in advance for your responses

Best regards


--
Khairil Anuar SULONG AHMAD

[[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 SIS package

2016-10-19 Thread Maity, Arnab K
Thank you all. That helps. I provided "x" as matrix. Actually the data is huge. 
When I work with a small subset of the data the error goes away. Let me try to 
post a reproducible data which can throw the same error.  

Arnab Kumar Maity
Department of Statistics
Texas A&M University
3143 TAMU, Room 401A
College Station, TX 77843
aku...@stat.tamu.edu
+1 779 777 3428


From: David Winsemius 
Sent: Wednesday, October 19, 2016 3:06 PM
To: Maity, Arnab K
Cc: r-help@r-project.org
Subject: Re: [R] Error message in SIS package

> On Oct 17, 2016, at 1:54 PM, Maity, Arnab K  wrote:
>
> I try to run the following code:
>
> sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family = 
> "cox", penalty = "lasso", tune = "cv",
> nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), 
> iter = FALSE, seed = 334)
>
> I get the following error:
>
> Error in names(coef.beta) = paste("X", ix1, sep = "") :
>  'names' attribute [1] must be the same length as the vector [0].

You supplied a matrix as an argument to 'x' but the error message is suggesting 
to me that the code was written to expect a list (or dataframe). (On the other 
hand I suppose you could have a matrix accessioned with a length-1 'i' or 'j' 
argument that would return a "named"-vector.)

Reading the help page for SIS, one sees that x was supposed to be a "design 
matrix, of dimensions n * p, without an intercept." I cannot determine whether 
your 'x' argument qualifies as such. Others may be able to determine from the 
circumstantial evidence whether that is possibly the case. Rhelp's posting 
guide suggest that questions about unexpected behavior should be accompanied by 
a discussion that include prior correspondence with the package maintainer as 
well as data ojects from `dump` or `dput` that would allow replication of the 
error.

The code to obtain the maintainer's email address :

maintainer('SIS')

--
David.
>
> here is some information about the data.
>
>> head(y)
>  time status
> 1   24  1
> 2   31  0
> 3   39  0
> 4   64  1
> 5   72  1
> 66  0
>> str(y)
> num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:2] "time" "status"
>> str(x)
> num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows >= 8 x64 (build 9200)
>
> locale:
> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
> States.1252LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C   LC_TIME=English_United States.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> other attached packages:
> [1] survival_2.39-4 SIS_0.8-3   glmnet_2.0-5foreach_1.4.3   
> Matrix_1.2-6
>
> loaded via a namespace (and not attached):
> [1] tools_3.3.1  splines_3.3.1codetools_0.2-14 grid_3.3.1   
> iterators_1.0.8  ncvreg_3.6-0 lattice_0.20-33
>>
>
> Please help!?
>
>
>
>
> Arnab Kumar Maity
> Department of Statistics
> Texas A&M University
> 3143 TAMU, Room 401A
> College Station, TX 77843
> aku...@stat.tamu.edu<mailto:arnabkrma...@stat.tamu.edu>
> +1 779 777 3428
>
>   [[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.

David Winsemius
Alameda, CA, USA


__
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 SIS package

2016-10-19 Thread David Winsemius

> On Oct 17, 2016, at 1:54 PM, Maity, Arnab K  wrote:
> 
> I try to run the following code:
> 
> sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family = 
> "cox", penalty = "lasso", tune = "cv",
> nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), 
> iter = FALSE, seed = 334)
> 
> I get the following error:
> 
> Error in names(coef.beta) = paste("X", ix1, sep = "") :
>  'names' attribute [1] must be the same length as the vector [0].

You supplied a matrix as an argument to 'x' but the error message is suggesting 
to me that the code was written to expect a list (or dataframe). (On the other 
hand I suppose you could have a matrix accessioned with a length-1 'i' or 'j' 
argument that would return a "named"-vector.)

Reading the help page for SIS, one sees that x was supposed to be a "design 
matrix, of dimensions n * p, without an intercept." I cannot determine whether 
your 'x' argument qualifies as such. Others may be able to determine from the 
circumstantial evidence whether that is possibly the case. Rhelp's posting 
guide suggest that questions about unexpected behavior should be accompanied by 
a discussion that include prior correspondence with the package maintainer as 
well as data ojects from `dump` or `dput` that would allow replication of the 
error.

The code to obtain the maintainer's email address :

maintainer('SIS')

-- 
David.
> 
> here is some information about the data.
> 
>> head(y)
>  time status
> 1   24  1
> 2   31  0
> 3   39  0
> 4   64  1
> 5   72  1
> 66  0
>> str(y)
> num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:2] "time" "status"
>> str(x)
> num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
>> sessionInfo()
> R version 3.3.1 (2016-06-21)
> Platform: x86_64-w64-mingw32/x64 (64-bit)
> Running under: Windows >= 8 x64 (build 9200)
> 
> locale:
> [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
> States.1252LC_MONETARY=English_United States.1252
> [4] LC_NUMERIC=C   LC_TIME=English_United States.1252
> 
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
> 
> other attached packages:
> [1] survival_2.39-4 SIS_0.8-3   glmnet_2.0-5foreach_1.4.3   
> Matrix_1.2-6
> 
> loaded via a namespace (and not attached):
> [1] tools_3.3.1  splines_3.3.1codetools_0.2-14 grid_3.3.1   
> iterators_1.0.8  ncvreg_3.6-0 lattice_0.20-33
>> 
> 
> Please help!?
> 
> 
> 
> 
> Arnab Kumar Maity
> Department of Statistics
> Texas A&M University
> 3143 TAMU, Room 401A
> College Station, TX 77843
> aku...@stat.tamu.edu
> +1 779 777 3428
> 
>   [[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.

David Winsemius
Alameda, CA, USA

__
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 SIS package

2016-10-17 Thread Jeff Newmiller
I doubt I will know how to help you in any case, but I can see that you are 
shackling yourself to a very small (possibly empty) set of helpers by not 
making your example reproducible. 

You will also slow any helpers down once you change that if you post again in 
HTML format... set your email program to send plain text so the code you supply 
doesn't get corrupted. 

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

http://adv-r.had.co.nz/Reproducibility.html

PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
-- 
Sent from my phone. Please excuse my brevity.

On October 17, 2016 1:54:52 PM PDT, "Maity, Arnab K"  
wrote:
>I try to run the following code:
>
>sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family =
>"cox", penalty = "lasso", tune = "cv",
>nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), iter =
>FALSE, seed = 334)
>
>I get the following error:
>
>Error in names(coef.beta) = paste("X", ix1, sep = "") :
>  'names' attribute [1] must be the same length as the vector [0].
>
>here is some information about the data.
>
>> head(y)
>  time status
>1   24  1
>2   31  0
>3   39  0
>4   64  1
>5   72  1
>66  0
>> str(y)
> num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:2] "time" "status"
>> str(x)
> num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
> - attr(*, "dimnames")=List of 2
>  ..$ : chr [1:46] "1" "2" "3" "4" ...
>  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
>> sessionInfo()
>R version 3.3.1 (2016-06-21)
>Platform: x86_64-w64-mingw32/x64 (64-bit)
>Running under: Windows >= 8 x64 (build 9200)
>
>locale:
>[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>States.1252LC_MONETARY=English_United States.1252
>[4] LC_NUMERIC=C   LC_TIME=English_United
>States.1252
>
>attached base packages:
>[1] stats graphics  grDevices utils datasets  methods   base
>
>other attached packages:
>[1] survival_2.39-4 SIS_0.8-3   glmnet_2.0-5foreach_1.4.3  
>Matrix_1.2-6
>
>loaded via a namespace (and not attached):
>[1] tools_3.3.1  splines_3.3.1codetools_0.2-14 grid_3.3.1  
>iterators_1.0.8  ncvreg_3.6-0 lattice_0.20-33
>>
>
>Please help!?
>
>
>
>
>Arnab Kumar Maity
>Department of Statistics
>Texas A&M University
>3143 TAMU, Room 401A
>College Station, TX 77843
>aku...@stat.tamu.edu
>+1 779 777 3428
>
>   [[alternative HTML version deleted]]
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

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


[R] Error message in SIS package

2016-10-17 Thread Maity, Arnab K
I try to run the following code:

sis.fit <- SIS(y = Surv(time = y[, 1], event = y[, 2]), x = x, family = "cox", 
penalty = "lasso", tune = "cv",
 nfolds = 10, type.measure = "deviance", nsis = min(dim(x)), 
iter = FALSE, seed = 334)

I get the following error:

Error in names(coef.beta) = paste("X", ix1, sep = "") :
  'names' attribute [1] must be the same length as the vector [0].

here is some information about the data.

> head(y)
  time status
1   24  1
2   31  0
3   39  0
4   64  1
5   72  1
66  0
> str(y)
 num [1:46, 1:2] 24 31 39 64 72 6 87 17 53 54 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:46] "1" "2" "3" "4" ...
  ..$ : chr [1:2] "time" "status"
> str(x)
 num [1:46, 1:66] 0.59234 0.30042 0.28278 -0.00966 0.08189 ...
 - attr(*, "dimnames")=List of 2
  ..$ : chr [1:46] "1" "2" "3" "4" ...
  ..$ : chr [1:66] "EIF4EBP1" "TP53BP1" "AKT1.AKT2.AKT3" "AR" ...
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

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

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

other attached packages:
[1] survival_2.39-4 SIS_0.8-3   glmnet_2.0-5foreach_1.4.3   Matrix_1.2-6

loaded via a namespace (and not attached):
[1] tools_3.3.1  splines_3.3.1codetools_0.2-14 grid_3.3.1   
iterators_1.0.8  ncvreg_3.6-0 lattice_0.20-33
>

Please help!?




Arnab Kumar Maity
Department of Statistics
Texas A&M University
3143 TAMU, Room 401A
College Station, TX 77843
aku...@stat.tamu.edu
+1 779 777 3428

[[alternative HTML version deleted]]

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


Re: [R] error message for every parenthesis

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

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

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

Thanks,
Tara

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

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

[[alternative HTML version deleted]]

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


Re: [R] error message for every parenthesis

2016-02-16 Thread Michael Dewey

Dear Tara

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

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

Hi,

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

Thank you,

Tara Kerin

An example from my GUI is below:

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

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

library()




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

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

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

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

Duncan Murdoch

[[alternative HTML version deleted]]

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



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

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


[R] error message for every parenthesis

2016-02-16 Thread Tara Kerin
Hi,

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

Thank you,

Tara Kerin

An example from my GUI is below:

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

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



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

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

Duncan Murdoch

[[alternative HTML version deleted]]

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


Re: [R] Error message when running gam (mgcv). object not found

2015-12-11 Thread Simon Wood
Hi Diego, I suggest you send me an example offline, along with the 
result of  sessionInfo(), best, Simon


On 11/12/15 09:25, Diego Pavon wrote:

Dear all

I am trying to fit gam to my data but it keeps giving me errors.


It does not find the covariate ArrivalTime even though it is clearly
defined in the data frame. It happens with any covariate that I put in the
s() term... And not only for this data set, but for any dataset that I try
to analyse.

Do you have any idea why I can't run gam? I can run perfectly any other
type of models (GLM, GLMM, ZIP...)..

Any help would be appreciated. Thank you very much.

Best

Diego







--
Simon Wood, School of Mathematics, University of Bristol BS8 1TW UK
+44 (0)117 33 18273 http://www.maths.bris.ac.uk/~sw15190

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


[R] Error message when running gam (mgcv). object not found

2015-12-11 Thread Diego Pavon
Dear all

I am trying to fit gam to my data but it keeps giving me errors.


It does not find the covariate ArrivalTime even though it is clearly
defined in the data frame. It happens with any covariate that I put in the
s() term... And not only for this data set, but for any dataset that I try
to analyse.

Do you have any idea why I can't run gam? I can run perfectly any other
type of models (GLM, GLMM, ZIP...)..

Any help would be appreciated. Thank you very much.

Best

Diego




-- 
*Diego Pavón Jordán*

*Finnish Museum of Natural History*
*PO BOX 17 *

*Helsinki. Finland*



*0445061210https://tuhat.halvi.helsinki.fi/portal/en/persons/diego-pavon-jordan%288d5db37c-eddd-4fca-92cd-9c9956a42b4a%29.html
http://www.linkedin.com/profile/view?id=170617924&trk=nav_responsive_tab_profile
https://helsinki.academia.edu/DiegoPavon
*

> T1 <- gam(E1 ~ s(ArrivalTime), data = Owls)Error in as.matrix(x) : object 
> 'ArrivalTime' not found> ls(Owls) [1] "ArrivalTime""BroodSize"
>   "FoodTreatment"  "LogNeg"
 [5] "NegPerChick""Nest"   "SexParent"
"SiblingNegotiation"
 [9] "Xcoord" "Ycoord"

[[alternative HTML version deleted]]

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

[R] Error Message when using VarSelection in YaiImpute package with the randomForest

2015-09-16 Thread andrew haywood
Dear All,

when using the following code

x <- iris[,1:2]  # Sepal.Length Sepal.Width
y <- iris[,3:4]  # Petal.Length Petal.Width
vsel <-
varSelection(x=x,y=y,nboot=5,yaiMethod="randomForest",useParallel=FALSE)


I get the following error code

Error in yai(x = xa, y = y, method = yaiMethod, bootstrap = bootstrap,  :
  object 'xcvRefs' not found


If anybody could tell me what I am doing wrong.

Cheers
Andrew

[[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 from allEffects(model) / effect(model)" ‘range’ not meaningful for factors"

2015-08-19 Thread Michael Dewey

You rm is of class summary.lm
Is that what allEffects is expecting?

On 19/08/2015 01:49, Robert Zimbardo wrote:

Hi

I cannot figure out why the effects package throws me error messages
with the following simple code:


rm(list=ls(all=TRUE)); set.seed(1); library(effects)
# set up data
x <- factor(rep(letters[1:3], each=100))
y <- c(rnorm(100, 3, 3), rnorm(100, 4, 3), rnorm(100, 5, 3))


# fit linear model
m <- summary(lm(y~x)) # no problem

# now the problem
plot(allEffects(m))
# Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,  :
#   ‘range’ not meaningful for factors
plot(effect("x", m))
# Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,  :
#   ‘range’ not meaningful for factors


Any ideas? It's go to be something superobvious, but I don't get it. Thanks,
RZ

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



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

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

Re: [R] Error message from allEffects(model) / effect(model)" ‘range’ not meaningful for factors"

2015-08-19 Thread John Fox
Hi,

> m <- lm(y~x) # no problem

> allEffects(m)# also no problem
 model: y ~ x

 x effect
x
   abc 
3.322448 3.830997 4.969154

> effect("x", m) # ditto

 x effect
x
   abc 
3.322448 3.830997 4.969154 

> Effect("x", m) # ditto

 x effect
x
   abc 
3.322448 3.830997 4.969154

Best,
 John

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




> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Robert
> Zimbardo
> Sent: Tuesday, August 18, 2015 8:50 PM
> To: r-help@r-project.org
> Subject: [R] Error message from allEffects(model) / effect(model)"
> ‘range’ not meaningful for factors"
> 
> Hi
> 
> I cannot figure out why the effects package throws me error messages
> with the following simple code:
> 
> 
> rm(list=ls(all=TRUE)); set.seed(1); library(effects)
> # set up data
> x <- factor(rep(letters[1:3], each=100))
> y <- c(rnorm(100, 3, 3), rnorm(100, 4, 3), rnorm(100, 5, 3))
> 
> 
> # fit linear model
> m <- summary(lm(y~x)) # no problem
> 
> # now the problem
> plot(allEffects(m))
> # Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
> :
> #   ‘range’ not meaningful for factors
> plot(effect("x", m))
> # Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
> :
> #   ‘range’ not meaningful for factors
> 
> 
> Any ideas? It's go to be something superobvious, but I don't get it.
> Thanks,
> RZ
> 
> __
> 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] Error message from allEffects(model) / effect(model)" ‘range’ not meaningful for factors"

2015-08-19 Thread Robert Zimbardo
Hi

I cannot figure out why the effects package throws me error messages
with the following simple code:


rm(list=ls(all=TRUE)); set.seed(1); library(effects)
# set up data
x <- factor(rep(letters[1:3], each=100))
y <- c(rnorm(100, 3, 3), rnorm(100, 4, 3), rnorm(100, 5, 3))


# fit linear model
m <- summary(lm(y~x)) # no problem

# now the problem
plot(allEffects(m))
# Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,  :
#   ‘range’ not meaningful for factors
plot(effect("x", m))
# Error in Summary.factor(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,  :
#   ‘range’ not meaningful for factors


Any ideas? It's go to be something superobvious, but I don't get it. Thanks,
RZ

__
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 package "FD", function dbFD ()

2015-07-15 Thread William Dunlap
Try doing
rownames(x) <- x["Species"]
before running dbFD.  The function is probably using the row and column
names of its inputs as species names, not a certain row or column of the
data.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Wed, Jul 15, 2015 at 6:47 AM, lauraRIG  wrote:

> Dear R community,
>
> I  have some trouble with the dbFD function in the FD package.
> > str(a)
> 'data.frame':150 obs. of  48 variables:
> > str(x)
> 'data.frame':48 obs. of  9 variables:
>
> ex1 <- dbFD(x,a)
> Error in dbFD(x, a) :
>   Species labels in 'x' and 'a' need to be identical and ordered
> alphabetically (or simply in the same order).
>
> I have checked multiple time the data set but this message keeps on
> appearing. The names of the species are identical in both data.frames.
>
> I was wondering if you could help me by giving me an example of an excel
> trait and species matrix table to upload for this package. Below is a
> snapshop of my data. I have also checked that there are no NA’s problems
> and
> that there is no species abundance = 0 or no community with 0 species.
>
> Thank you for any advice!
> Best
> Laura
>
> Species table (a)
> Agonum_assimile Agonum_dorsale  Agonum_gracile  Agonum_gracilipes
> 2   3   0   0
> 0   6   0   0
> 1   10  0   0
> 1   5   0   0
> 0   8   0   0
> 2   7   0   0
> 1   6   0   0
>
>
> Trait table(x)
>
> Species  SizeCategoy EcologyReproductionDietWing
> Agonum_assimile C   nocturnal   spring  Carnivorous
>  Brachypterous
> Agonum_dorsale  B   nocturnal   spring  Carnivorous
>  Macropterous
> Agonum_gracile Bdiurnal spring  Carnivorous
>  Macropterous
> Agonum_gracilipes   B   bothspring  Carnivorous
>  Macropterous
>
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/error-message-in-package-FD-function-dbFD-tp4709896.html
> Sent from the R help mailing list archive at Nabble.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.

[[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 package "FD", function dbFD ()

2015-07-15 Thread Jeff Newmiller
Thank you for making an effort, but your example is still not reproducible. 
Study something like [1] for more clarity on how to communicate online. 
Problems that you encounter in getting your data into R are different than 
problems with the functions in base R or contributed packages, and a 
reproducible example using dput to give us the data allows us to distinguish 
the two.

Regarding your request for an Excel example, that is unlikely to occur given 
that this is an R help mailing list. There are many example data sets in base R 
and contributed packages. Have you read the examples on the help page for the 
FD package? Try

?FD-package

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---
Jeff NewmillerThe .   .  Go Live...
DCN:Basics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On July 15, 2015 6:47:22 AM PDT, lauraRIG  wrote:
>Dear R community,
>
>I  have some trouble with the dbFD function in the FD package. 
>> str(a)
>'data.frame':150 obs. of  48 variables:
>> str(x)
>'data.frame':48 obs. of  9 variables:
>
>ex1 <- dbFD(x,a)
>Error in dbFD(x, a) : 
>  Species labels in 'x' and 'a' need to be identical and ordered
>alphabetically (or simply in the same order).
>
>I have checked multiple time the data set but this message keeps on
>appearing. The names of the species are identical in both data.frames. 
>
>I was wondering if you could help me by giving me an example of an
>excel
>trait and species matrix table to upload for this package. Below is a
>snapshop of my data. I have also checked that there are no NA’s
>problems and
>that there is no species abundance = 0 or no community with 0 species.
>
>Thank you for any advice!
>Best
>Laura 
>
>Species table (a)
>Agonum_assimileAgonum_dorsale  Agonum_gracile  Agonum_gracilipes
>2  3   0   0
>0  6   0   0
>1  10  0   0
>1  5   0   0
>0  8   0   0
>2  7   0   0
>1  6   0   0
>
>
>Trait table(x)
>
>Species SizeCategoy EcologyReproductionDietWing
>Agonum_assimileC   nocturnal   spring  Carnivorous 
>Brachypterous
>Agonum_dorsale B   nocturnal   spring  Carnivorous 
>Macropterous
>Agonum_gracileBdiurnal spring  Carnivorous Macropterous
>Agonum_gracilipes  B   bothspring  Carnivorous 
>Macropterous
>
>
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/error-message-in-package-FD-function-dbFD-tp4709896.html
>Sent from the R help mailing list archive at Nabble.com.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

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

[R] error message in package "FD", function dbFD ()

2015-07-15 Thread lauraRIG
Dear R community,

I  have some trouble with the dbFD function in the FD package. 
> str(a)
'data.frame':150 obs. of  48 variables:
> str(x)
'data.frame':48 obs. of  9 variables:

ex1 <- dbFD(x,a)
Error in dbFD(x, a) : 
  Species labels in 'x' and 'a' need to be identical and ordered
alphabetically (or simply in the same order).

I have checked multiple time the data set but this message keeps on
appearing. The names of the species are identical in both data.frames. 

I was wondering if you could help me by giving me an example of an excel
trait and species matrix table to upload for this package. Below is a
snapshop of my data. I have also checked that there are no NA’s problems and
that there is no species abundance = 0 or no community with 0 species.

Thank you for any advice!
Best
Laura 

Species table (a)
Agonum_assimile Agonum_dorsale  Agonum_gracile  Agonum_gracilipes
2   3   0   0
0   6   0   0
1   10  0   0
1   5   0   0
0   8   0   0
2   7   0   0
1   6   0   0


Trait table(x)

Species  SizeCategoy EcologyReproductionDietWing
Agonum_assimile C   nocturnal   spring  Carnivorous Brachypterous
Agonum_dorsale  B   nocturnal   spring  Carnivorous 
Macropterous
Agonum_gracile Bdiurnal spring  Carnivorous Macropterous
Agonum_gracilipes   B   bothspring  Carnivorous 
Macropterous





--
View this message in context: 
http://r.789695.n4.nabble.com/error-message-in-package-FD-function-dbFD-tp4709896.html
Sent from the R help mailing list archive at Nabble.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] ERROR Message

2015-05-22 Thread Jim Lemon
Hi Ivone,
This does look a bit like homework as someone else sent a help request
with a strikingly similar problem. However, I would first do something
like this:

is.array(datalist[[1]])

as this is what the error message is saying.

Jim


On Sat, May 23, 2015 at 2:57 AM, Ivone Figueiredo  wrote:
> Hi
>
> Could you please help me
>
> I am trying to fit a Multilevel Poisson regression with the following code
>
> ## BUGS CODE
>
> ## Multilevel Poisson regression
>
> model {
>
>   for (i in 1:n){
>
> y[i] ~ dpois (lambda[i])
>
> log(lambda[i]) <- mu +
>
>   b.species[Species[i]] + b.quarter[Quarter[i]] + epsilon[i]
>
> epsilon[i] ~ dnorm (0, tau.epsilon)
>
>   }
>
>   mu ~ dnorm (0, .0001)
>
>   mu.adj <- mu +  mean(b.species[]) + mean(b.quarter[])
>
>   tau.epsilon <- pow(sigma.epsilon, -2)
>
>   sigma.epsilon ~ dunif (0, 100)
>
>
>
>   for (j in 1:n.species){
>
> b.species[j] ~ dnorm (0, tau.species)
>
> b.species.adj[j] <-  b.species[j] - mean( b.species[])
>
>   }
>
>   tau.species <- pow(sigma.species, -2)
>
>   sigma.species ~ dunif (0, 100)
>
>
>
>   for (j in 1:n.quarters){
>
> b.quarter[j] ~ dnorm (0, tau.quarter)
>
> b.quarter.adj[j] <- b.quarter[j] - mean(b.quarter[])
>
>   }
>
>   tau.quarter <- pow(sigma.quarter, -2)
>
>   sigma.quarter ~ dunif (0, 100)
>
> }
>
>
>
> ##
>
>
>
> skate.data <- list ("Species", "n.species", "Quarter", "n.quarters", "y")
>
>
>
> #radon.inits <- function (){
>
> #  list (a=rnorm(J), b=rnorm(1), g.0=rnorm(1), g.1=rnorm(1),
>
> #sigma.y=runif(1), sigma.a=runif(1))
>
> #}
>
>
>
> skate.parameters <- c ("mu", "b.quarter", "b.species", "sigma.species",
> "sigma.quarter", "sigma.epsilon")
>
>
>
> skate.3 <- bugs (skate.data, inits=NULL, skate.parameters, "skates.bug",
>
>  n.chains=3, n.iter=500,
>
> bugs.directory="c:/ProgramFiles(x86)/OpenBUGS/OpenBUGS323",
>
> program=c("OpenBUGS"))
>
>
>
>
>
> But I always receive this message error
>
>
>
> Loading required package: BRugs
>
> Welcome to BRugs connected to OpenBUGS version 3.2.3
>
> model is syntactically correct
>
> Error in aperm.default(datalist[[i]]) :
>
>   invalid first argument, must be an array
>
> In addition: Warning messages:
>
> 1: package 'BRugs' was built under R version 3.0.3
>
> 2: In FUN(X[[5L]], ...) : class of 'x' was discarded
>
>
>
>
>
>
>
>
> [[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] error message

2015-05-22 Thread John Kane
I think we need a couple of things. First we need your post in text not hmtl.  
R-help removes the html as a security feature and it turns your post into a 
complete mess. See below.

Second we probably need more information and some data.  Please read one or 
both of these 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 and http://adv-r.had.co.nz/Reproducibility.html

Welcome to the R-help list

John Kane
Kingston ON Canada


> -Original Message-
> From: catarinaramosm...@gmail.com
> Sent: Fri, 22 May 2015 18:08:13 +0100
> To: r-help@r-project.org
> Subject: [R] error message
> 
> Hi
> Can you please help me :(
> 
> I am trying to fit a multilevel model but I have received the following
> message
> 
> skate.3 <- bugs (skate.data, inits=NULL, skate.parameters,
> "skates.bug",+  n.chains=2, n.iter=500, +
> bugs.directory="c:/ProgramFiles(x86)/OpenBUGS/OpenBUGS323",+
>   program=c("OpenBUGS"))model is syntactically correctexpected
> variable name error pos 5 (error on line 1)variable n is not
> definedmodel must be compiled before generating initial valuesSampling
> has been started ...model must be initialized before updatingmodel
> must be initialized before DIC can be monitoredError in
> BRugs::samplesSet(parametersToSave) :
>   model must be initialized before monitors used
> 
>   [[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.


Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.

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


[R] ERROR Message

2015-05-22 Thread Ivone Figueiredo
Hi 

Could you please help me 

I am trying to fit a Multilevel Poisson regression with the following code 

## BUGS CODE

## Multilevel Poisson regression 

model {

  for (i in 1:n){

y[i] ~ dpois (lambda[i])

log(lambda[i]) <- mu + 

  b.species[Species[i]] + b.quarter[Quarter[i]] + epsilon[i]

epsilon[i] ~ dnorm (0, tau.epsilon)

  }

  mu ~ dnorm (0, .0001)

  mu.adj <- mu +  mean(b.species[]) + mean(b.quarter[])

  tau.epsilon <- pow(sigma.epsilon, -2)

  sigma.epsilon ~ dunif (0, 100)

  

  for (j in 1:n.species){

b.species[j] ~ dnorm (0, tau.species)

b.species.adj[j] <-  b.species[j] - mean( b.species[])

  }

  tau.species <- pow(sigma.species, -2)

  sigma.species ~ dunif (0, 100)

  

  for (j in 1:n.quarters){

b.quarter[j] ~ dnorm (0, tau.quarter)

b.quarter.adj[j] <- b.quarter[j] - mean(b.quarter[])

  }

  tau.quarter <- pow(sigma.quarter, -2)

  sigma.quarter ~ dunif (0, 100)

}

 

##

 

skate.data <- list ("Species", "n.species", "Quarter", "n.quarters", "y")



#radon.inits <- function (){

#  list (a=rnorm(J), b=rnorm(1), g.0=rnorm(1), g.1=rnorm(1),

#sigma.y=runif(1), sigma.a=runif(1))

#}

 

skate.parameters <- c ("mu", "b.quarter", "b.species", "sigma.species",
"sigma.quarter", "sigma.epsilon")

 

skate.3 <- bugs (skate.data, inits=NULL, skate.parameters, "skates.bug",

 n.chains=3, n.iter=500, 

bugs.directory="c:/ProgramFiles(x86)/OpenBUGS/OpenBUGS323",

program=c("OpenBUGS"))

 

 

But I always receive this message error 

 

Loading required package: BRugs

Welcome to BRugs connected to OpenBUGS version 3.2.3

model is syntactically correct

Error in aperm.default(datalist[[i]]) : 

  invalid first argument, must be an array

In addition: Warning messages:

1: package 'BRugs' was built under R version 3.0.3 

2: In FUN(X[[5L]], ...) : class of 'x' was discarded

 

 

 


[[alternative HTML version deleted]]

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


[R] error message

2015-05-22 Thread Catarina Maia
Hi
Can you please help me :(

I am trying to fit a multilevel model but I have received the following
message

skate.3 <- bugs (skate.data, inits=NULL, skate.parameters,
"skates.bug",+  n.chains=2, n.iter=500, +
bugs.directory="c:/ProgramFiles(x86)/OpenBUGS/OpenBUGS323",+
  program=c("OpenBUGS"))model is syntactically correctexpected
variable name error pos 5 (error on line 1)variable n is not
definedmodel must be compiled before generating initial valuesSampling
has been started ...model must be initialized before updatingmodel
must be initialized before DIC can be monitoredError in
BRugs::samplesSet(parametersToSave) :
  model must be initialized before monitors used

[[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: ReadItem: unknown type 64, perhaps written by later version of R

2015-03-06 Thread Franckx Laurent


> -Original Message-
> From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk]
> Sent: vrijdag 6 maart 2015 10:23
> To: Franckx Laurent; r-help@r-project.org
> Subject: Re: [R] error message: ReadItem: unknown type 64, perhaps written
> by later version of R
>
> On 05/03/2015 20:34, Franckx Laurent wrote:
> > Dear all
> >
> > I get the following error message when I try to load one  specific RData
> object in R:
> >
> >  Error: ReadItem: unknown type 64, perhaps written by later
> > version of R
> >
> >
> > The error message is odd because (a) this RData object was created just
> one hour berfore in a  previous script (in a series of R scripts called in 
> batch
> mode), so it would seem to me that it has been created by the same version
> of R that is now calling it (b) this script is "looping" over several 
> scenarios and
> years, and the error only occurs for one very specific combination of
> scenarios and years. This object is about 6 Gb large, which is the same  size 
> as
> the other objects that were called in previous instances.
>
> What is 'odd' is that you missed the 'perhaps'.
>
> The most likely explanation is an I/O error when the file was written:
> it is 'perhaps' corrupted.
>
>

Dear Professor Riply,

Thank you for your suggestion.

The possibility of an I/O error in the writing of the file is actually 
something I had anticipated. The saving of the file is immediately followed by 
a test - see the code below.

save(list = skimlistname, file = 
file.path(pathsony[[rdata]],skimlistnamerdata))
if(file.exists(file.path(pathsony[[rdata]],skimlistnamerdata))) {
cat(skimlistnamerdata, " has been created. \n ", file = 
warningfile, sep = "", append = TRUE)
} else {
stop(skimlistnamerdata, " has not been created correctly. \n ")
}

My understanding was that this test code would stop the execution of the 
program if the file had not been saved correctly.
Moreover, each of my script starts with a verification whether any error 
message is contained in the Rout of the preceding scripts, and stops execution 
immediately if this is indeed the case.
Therefore, I should not even have reached the point where R tries to load the 
file in memory.
Is there any alternative to verifying whether a file has been created correctly 
without actually loading it?
Sincerely,
Laurent Franckx



> > I load the RData with the following command (where pathsony[[rdata]] is
> the folder with the RData and skimlistrdata is the file I try to load):
> >
> >  load( file.path(pathsony[[rdata]],skimlistrdata))
> >
> >
> > The problem occurs both when I run the script in batch mode or when I run
> it interactively.
> >
> > I use a  "x86_64-pc-linux-gnu" and  "R version 3.1.2 (2014-10-31)".
> >
> >
> > Laurent Franckx, PhD
> > Senior researcher sustainable mobility VITO NV | Boeretang 200 | 2400
> > Mol Tel. ++ 32 14 33 58 22| mob. +32 479 25 59 07 | Skype:
> > laurent.franckx | laurent.fran...@vito.be | Twitter @LaurentFranckx
>
>
> --
> Brian D. Ripley,  rip...@stats.ox.ac.uk
> Emeritus Professor of Applied Statistics, University of Oxford
> 1 South Parks Road, Oxford OX1 3TG, UK
VITO Disclaimer: http://www.vito.be/e-maildisclaimer
__
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: ReadItem: unknown type 64, perhaps written by later version of R

2015-03-06 Thread Prof Brian Ripley

On 05/03/2015 20:34, Franckx Laurent wrote:

Dear all

I get the following error message when I try to load one  specific RData object 
in R:

 Error: ReadItem: unknown type 64, perhaps written by later version of R


The error message is odd because (a) this RData object was created just one hour berfore 
in a  previous script (in a series of R scripts called in batch mode), so it would seem 
to me that it has been created by the same version of R that is now calling it (b) this 
script is "looping" over several scenarios and years, and the error only occurs 
for one very specific combination of scenarios and years. This object is about 6 Gb 
large, which is the same  size as the other objects that were called in previous 
instances.


What is 'odd' is that you missed the 'perhaps'.

The most likely explanation is an I/O error when the file was written: 
it is 'perhaps' corrupted.




I load the RData with the following command (where pathsony[[rdata]] is the 
folder with the RData and skimlistrdata is the file I try to load):

 load( file.path(pathsony[[rdata]],skimlistrdata))


The problem occurs both when I run the script in batch mode or when I run it 
interactively.

I use a  "x86_64-pc-linux-gnu" and  "R version 3.1.2 (2014-10-31)".


Laurent Franckx, PhD
Senior researcher sustainable mobility
VITO NV | Boeretang 200 | 2400 Mol
Tel. ++ 32 14 33 58 22| mob. +32 479 25 59 07 | Skype: laurent.franckx | 
laurent.fran...@vito.be | Twitter @LaurentFranckx



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

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


[R] error message: ReadItem: unknown type 64, perhaps written by later version of R

2015-03-05 Thread Franckx Laurent
Dear all

I get the following error message when I try to load one  specific RData object 
in R:

Error: ReadItem: unknown type 64, perhaps written by later version of R


The error message is odd because (a) this RData object was created just one 
hour berfore in a  previous script (in a series of R scripts called in batch 
mode), so it would seem to me that it has been created by the same version of R 
that is now calling it (b) this script is "looping" over several scenarios and 
years, and the error only occurs for one very specific combination of scenarios 
and years. This object is about 6 Gb large, which is the same  size as the 
other objects that were called in previous instances.

I load the RData with the following command (where pathsony[[rdata]] is the 
folder with the RData and skimlistrdata is the file I try to load):

load( file.path(pathsony[[rdata]],skimlistrdata))


The problem occurs both when I run the script in batch mode or when I run it 
interactively.

I use a  "x86_64-pc-linux-gnu" and  "R version 3.1.2 (2014-10-31)".


Laurent Franckx, PhD
Senior researcher sustainable mobility
VITO NV | Boeretang 200 | 2400 Mol
Tel. ++ 32 14 33 58 22| mob. +32 479 25 59 07 | Skype: laurent.franckx | 
laurent.fran...@vito.be | Twitter @LaurentFranckx




VITO Disclaimer: http://www.vito.be/e-maildisclaimer

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


[R] Error message for corAR1()

2014-07-21 Thread Wilson, Jenny
Hi,


I am trying to answer the see if density.km (response) is affected by Direction 
(continuous, integer), Layer (nominal with 12 levels) and direction (nominal 
with 8 levels). There is an interaction between Layer and Direction. 
Platform.field is a list of 9 different platforms and is being treated as a 
random effect.


I had previously ran this model without the correlation argument and checked 
the residuals in an acf plot which showed a high level of autocorrelation.


I am having issues applying the correlation argument into my model but keep 
getting an error message and am not sure what else to try. I should mention 
that Direction is being applied as the time covariate because each distance has 
an associated time stamp.


G2<-gamm(density.km~f.Layer+direction+s(Distance.A,by=f.Layer),
random=list(Platform.field=~1),corr=corAR1(form=~Distance.A|Platform.field/f.Layer),
family=poisson,data=fish1)


 Maximum number of PQL iterations:  20
iteration 1
Error in Initialize.corAR1(X[[2L]], ...) :
  covariate must have unique values within groups for "corAR1" objects?


Any help would be appreciated.


Thanks



[[alternative HTML version deleted]]

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


[R] Error message in varimp function: "Party" package

2014-06-13 Thread Roxanne Snook

Dear R community,

I’m trying to use the “party” package to view variables that are 
important in my data frame (FIM_RS4). My data has a combination of ordinal, 
nominal, categorical, and continuous data. I’ve written my code below, with 
my predictor variables being 2:36, and my response is 37 (Mussel). If anyone 
could point me in the direction of how to get rid of this error message, I 
would very much appreciate the guidance.

FIM_RS4<-read.csv("FIM_RS_4.csv", header=TRUE, stringsAsFactors=T) 

#all ordinal variables have been ordered in my complete code as well

mycontrols <- cforest_control(ntree=5000,mtry=4, minsplit=5)

cforest.rf <- cforest(as.factor(Mussel)~., data=FIM_RS4[,c(37,2:36)], 
controls=mycontrols)

# indata=FIM_RS4[,2:36]

# rf.model=cforest.rf

temp <- varimp.function(indata=FIM_RS4[,2:6], 
rf.model=cforest.rf,num.iterations=5, seedset = 2000,condition.varimp = 
T,write_csv=F)

Ø  Error in model@fit(data, ...) : error code 1 from Lapack routine 'dgesdd'

 #The reason I’m assigning a varimp.function to temp is to run iterations in 
the next piece of code.

#Same error occurs if I do not assign the iteration function varimp.function to 
temp, and simply do:

varimp(cforest.rf, conditional = TRUE)



Ø  Error in model@fit(data, ...) : error code 1 from Lapack routine 'dgesdd'



Many thanks in advance,

Rox
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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 when fitting a binomial response model using glm

2014-05-24 Thread David Winsemius

On May 23, 2014, at 2:04 PM, Adams, Jean wrote:

> Roland,
> 
> I did a google search for
> R Error: inner loop 2; cannot correct step size
> and found an old R-help message that suggests the glm() algorithm cannot
> converge.
> https://stat.ethz.ch/pipermail/r-help/2009-December/223142.html
> 
> I get the same error message as you when I fit
> glm(cbind(resp,nresp)~d+I(d^2)+I(d^3),data=test,family=
> binomial(clog()))

Six redictor factor levels?  With zeros at the extremes. Fitting to three 
parameters?

> but no error message if I get rid of the last parameter
> glm(cbind(resp,nresp)~d+I(d^2),data=test,family=binomial(clog()))

I thought perhaps removing the correlation of d^2 and d^3 might help, but even 
using:  ~ poly(d, 3) fails. If you remove the `clog()` call and use the 
canonical link, you get estimates with a warning (as one might expect with this 
data:

Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred 



-- 
David.

> 
> Hope this helps
> 
> Jean
> 
> 
> On Fri, May 23, 2014 at 7:13 AM, Roland Deutsch > wrote:
> 
>> Dear R-help,
>> 
>> during a simulation study using glm, I got the following error message
>> for which I cannot determine the cause:
>> 
>> Error: inner loop 2; cannot correct step size
>> 
>> Below is the code for which this error occurred is
>> 
>> clog<-function(){
>>   linkfun<-function(mu) qexp(mu)
>>   linkinv<-function(eta) pmax(.Machine$double.eps,pexp(eta))
>>   mu.eta<-function(eta) pmax(dexp(eta),.Machine$double.eps)
>>   valideta<-function(eta) all(eta>0)
>>   link<-"clog"
>> 
>> 
>> structure(list(linkfun=linkfun,linkinv=linkinv,mu.eta=mu.eta,valideta=valideta,name="link"),class="link-glm")
>> }
>> 
>> test<-data.frame(d=c(0,0.04,0.2,0.6,2,4),resp=c(0,1,3,4,24,28),nresp=c(18,21,19,17,1,0))
>> glm(cbind(resp,nresp)~d+I(d^2)+I(d^3),data=test,family=binomial(clog()))
>> 
>> Any help on why this error occurs and, more importantly, how I can
>> filter data producing this error would be highly appreciated.
>> 
>> Sincerely,
>> Roland Deutsch


David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list
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 when fitting a binomial response model using glm

2014-05-23 Thread Adams, Jean
Roland,

I did a google search for
 R Error: inner loop 2; cannot correct step size
and found an old R-help message that suggests the glm() algorithm cannot
converge.
 https://stat.ethz.ch/pipermail/r-help/2009-December/223142.html

I get the same error message as you when I fit
 glm(cbind(resp,nresp)~d+I(d^2)+I(d^3),data=test,family=
binomial(clog()))
but no error message if I get rid of the last parameter
 glm(cbind(resp,nresp)~d+I(d^2),data=test,family=binomial(clog()))

Hope this helps

Jean


On Fri, May 23, 2014 at 7:13 AM, Roland Deutsch  wrote:

> Dear R-help,
>
> during a simulation study using glm, I got the following error message
> for which I cannot determine the cause:
>
> Error: inner loop 2; cannot correct step size
>
> Below is the code for which this error occurred is
>
> clog<-function(){
>linkfun<-function(mu) qexp(mu)
>linkinv<-function(eta) pmax(.Machine$double.eps,pexp(eta))
>mu.eta<-function(eta) pmax(dexp(eta),.Machine$double.eps)
>valideta<-function(eta) all(eta>0)
>link<-"clog"
>
>
> structure(list(linkfun=linkfun,linkinv=linkinv,mu.eta=mu.eta,valideta=valideta,name="link"),class="link-glm")
> }
>
> test<-data.frame(d=c(0,0.04,0.2,0.6,2,4),resp=c(0,1,3,4,24,28),nresp=c(18,21,19,17,1,0))
> glm(cbind(resp,nresp)~d+I(d^2)+I(d^3),data=test,family=binomial(clog()))
>
> Any help on why this error occurs and, more importantly, how I can
> filter data producing this error would be highly appreciated.
>
> Sincerely,
> Roland Deutsch
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> 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
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error message when fitting a binomial response model using glm

2014-05-23 Thread Roland Deutsch
Dear R-help,

during a simulation study using glm, I got the following error message 
for which I cannot determine the cause:

Error: inner loop 2; cannot correct step size

Below is the code for which this error occurred is

clog<-function(){
   linkfun<-function(mu) qexp(mu)
   linkinv<-function(eta) pmax(.Machine$double.eps,pexp(eta))
   mu.eta<-function(eta) pmax(dexp(eta),.Machine$double.eps)
   valideta<-function(eta) all(eta>0)
   link<-"clog"
   
structure(list(linkfun=linkfun,linkinv=linkinv,mu.eta=mu.eta,valideta=valideta,name="link"),class="link-glm")
}
test<-data.frame(d=c(0,0.04,0.2,0.6,2,4),resp=c(0,1,3,4,24,28),nresp=c(18,21,19,17,1,0))
glm(cbind(resp,nresp)~d+I(d^2)+I(d^3),data=test,family=binomial(clog()))

Any help on why this error occurs and, more importantly, how I can 
filter data producing this error would be highly appreciated.

Sincerely,
Roland Deutsch

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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 R

2014-04-15 Thread Uwe Ligges



On 15.04.2014 14:03, mark.l...@hauck-aufhaeuser.de wrote:

Hello,

we get at a users individual following error: java.lang.OutOfMemoryError: 
unable to create new native thread

Can you please tell me how I can fix this?


You are using the xlsx package?
Increase the java heap size, I find a solution once I Google for it

Best,
Uwe Ligges




Thank you very much

Sincerely yours

Mark Link
Applikationsmanagement

Hauck & Aufhäuser Privatbankiers KGaA
Kaiserstraße 24
60311 Frankfurt am Main
Telefon +49 69 2161-1581
Fax +49 69 2161-1730

mark.l...@hauck-aufhaeuser.de
www.hauck-aufhaeuser.de





Der Inhalt dieser eMail ist ausschließlich für den bezeichneten Adressaten 
bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser eMail oder dessen 
Vertreter sein sollten, beachten Sie bitte, dass jede Form der Veröffentlichung, 
Vervielfältigung oder Weitergabe des Inhaltes dieser eMail unzulässig ist. Der 
Austausch von Nachrichten mit Hauck & Aufhäuser Privatbankiers KGaA via eMail 
dient ausschließlich Informationszwecken. Bitte beachten Sie, dass wir Aufträge 
oder Weisungen per E-Mail nicht entgegen nehmen können. Verfälschungen des 
ursprünglichen Inhaltes dieser Nachricht bei der Datenübertragung können nicht 
ausgeschlossen werden.

Hauck & Aufhäuser Privatbankiers KGaA
Persönlich haftende Gesellschafter: Jochen Lucht, Hauck & Aufhäuser 
Geschäftsleitungs GmbH
Vorsitzender des Aufsichtsrates: Wolfgang Deml
Kommanditgesellschaft auf Aktien mit Sitz in Frankfurt am Main, Amtsgericht 
Frankfurt HRB 20065
Umsatzsteuer-Identifikations-Nummer: DE114104118

___

The information contained in this e-mail is intended solely for the addressee. 
Access to this e-mail by anyone else is unauthorized. If you are not the intended 
recipient, any form of disclosure, reproduction, distribution or any action taken 
or refrained from in reliance on it, is prohibited and may be unlawful. 
Correspondence with Hauck & Aufhaeuser Privatbankiers KGaA via e-mail is only 
for information purposes. Please note that we cannot accept any orders or 
instructions by e-mail. The falsification of the original content of this message 
in the course of data transmission cannot be excluded.

Hauck & Aufhaeuser Privatbankiers KGaA
Managing partners: Jochen Lucht, Hauck & Aufhaeuser Geschaeftsleitungs GmbH
Chairman of the supervisory board: Wolfgang Deml
Partnership limited by shares domiciled in Frankfurt/Main, commercial register 
at local court Frankfurt HRB 20065
VAT-identification number: DE114104118



__
R-help@r-project.org mailing list
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
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error message in R

2014-04-15 Thread mark.link
Hello, 

we get at a users individual following error: java.lang.OutOfMemoryError: 
unable to create new native thread 

Can you please tell me how I can fix this? 

Thank you very much 

Sincerely yours

Mark Link
Applikationsmanagement

Hauck & Aufhäuser Privatbankiers KGaA
Kaiserstraße 24
60311 Frankfurt am Main
Telefon +49 69 2161-1581
Fax +49 69 2161-1730

mark.l...@hauck-aufhaeuser.de
www.hauck-aufhaeuser.de





Der Inhalt dieser eMail ist ausschließlich für den bezeichneten Adressaten 
bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser eMail oder dessen 
Vertreter sein sollten, beachten Sie bitte, dass jede Form der 
Veröffentlichung, Vervielfältigung oder Weitergabe des Inhaltes dieser eMail 
unzulässig ist. Der Austausch von Nachrichten mit Hauck & Aufhäuser 
Privatbankiers KGaA via eMail dient ausschließlich Informationszwecken. Bitte 
beachten Sie, dass wir Aufträge oder Weisungen per E-Mail nicht entgegen nehmen 
können. Verfälschungen des ursprünglichen Inhaltes dieser Nachricht bei der 
Datenübertragung können nicht ausgeschlossen werden.

Hauck & Aufhäuser Privatbankiers KGaA
Persönlich haftende Gesellschafter: Jochen Lucht, Hauck & Aufhäuser 
Geschäftsleitungs GmbH
Vorsitzender des Aufsichtsrates: Wolfgang Deml
Kommanditgesellschaft auf Aktien mit Sitz in Frankfurt am Main, Amtsgericht 
Frankfurt HRB 20065
Umsatzsteuer-Identifikations-Nummer: DE114104118

___

The information contained in this e-mail is intended solely for the addressee. 
Access to this e-mail by anyone else is unauthorized. If you are not the 
intended recipient, any form of disclosure, reproduction, distribution or any 
action taken or refrained from in reliance on it, is prohibited and may be 
unlawful. Correspondence with Hauck & Aufhaeuser Privatbankiers KGaA via e-mail 
is only for information purposes. Please note that we cannot accept any orders 
or instructions by e-mail. The falsification of the original content of this 
message in the course of data transmission cannot be excluded.

Hauck & Aufhaeuser Privatbankiers KGaA
Managing partners: Jochen Lucht, Hauck & Aufhaeuser Geschaeftsleitungs GmbH
Chairman of the supervisory board: Wolfgang Deml
Partnership limited by shares domiciled in Frankfurt/Main, commercial register 
at local court Frankfurt HRB 20065
VAT-identification number: DE114104118
__
R-help@r-project.org mailing list
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 using xyplot of lattice

2014-04-06 Thread arun
HI,
Check the output of:
datM <- melt(DataSeries,id.var="Date")
head(datM,2)# 3 columns
# Date variable value 

#1 2001-01-01 A 4
#2 2001-01-02 A 1
datM1 <- setNames(datM,LETTERS[c(24,26,25)])
library(lattice)
xyplot(Y~as.numeric(X),data=datM1,groups=Z,type="l") 


A.K.

hi, thank you for the help. doing this looks good, however I tried to adapt to 
code in order to be able to plot more than just 2 time series and I again get 
some Errors. using this: DataSeriesM <- 
setNames(melt(DataSeries,id.var="Date"),LETTERS[c(24,18,19,20,21,22,23,26,25)]) 
where DataSeries has 5000 observations of 9 variables, I get the error message: 
"Error in setNames(melt(DataSeries, id.var = "Date"), LETTERS[c(24, 18,  : 
'names' attribute [9] must be the same length as the vector [3]" If I run this: 
length(LETTERS[c(24,18,19,20,21,22,23,26,25)])
length(DataSeries) I get 9 for both. I don't really understand why it is not 
working, is there anything you see? Using your example, I tried this: 
set.seed(495)
DataSeries <- data.frame(Date=seq(as.Date("2001-01-01"),by="1 day", 
length.out=20), A= sample(10,20,replace=TRUE), B= rnorm(20),C= rnorm(20)-1) 
DataSeriesM <- setNames(melt(DataSeries,id.var="Date"),LETTERS[c(24,26,25,22)]) 
which dives me the same error message. How do I Need to adapt this part as well 
as the code below to plot more than 2 lines? # with legends
xyplot(Y~as.numeric(X),xlab="X",data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development
 over time",auto.key=list(x=.85, y=.95, border=TRUE,lines=TRUE)) 


On Sunday, April 6, 2014 2:14 AM, arun  wrote:
Hi,
You didn't provide a reproducible example.  If your dataset is something like 
this:
set.seed(495)
DataSeries <- data.frame(Date=seq(as.Date("2001-01-01"),by="1 day", 
length.out=20), A= sample(10,20,replace=TRUE), B= rnorm(20))


###Using your codes:

Matrix_New1 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"A"]),colnames(DataSeries)[2])

Matrix_New2 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"B"]),colnames(DataSeries)[3])

str(Matrix_New1)
#List of 60
str(Matrix_New2) 

#List of 60 

Matrix_Complete<- rbind(Matrix_New1,Matrix_New2)
str(Matrix_Complete)
#List of 120
Col_Names_MC<-c("X","Y", "Z")
colnames(Matrix_Complete)<-Col_Names_MC 

library(lattice) 

Plot_AB<-xyplot(Y~ X, data =Matrix_Complete, type =c("l"), groups=Z, 
as.table=TRUE, main="Development over time")
#Error in eval(expr, envir, enclos) : object 'Z' not found 

#You could try:
library(reshape2)
 DataSeriesM <- setNames(melt(DataSeries,id.var="Date"),LETTERS[c(24,26,25)])
xyplot(Y~X,data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development 
over time")
 #for a numeric X axis
xyplot(Y~as.numeric(X),data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development
 over time") 
# with legends
xyplot(Y~as.numeric(X),xlab="X",data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development
 over time",auto.key=list(x=.85, y=.95, border=TRUE,lines=TRUE)) 


Hope it helps.

A.K.


Hi everbody, I have the following error message occuring when I run my code:
"Error in eval(expr, envir, enclos) : object 'Series' not found" The code I am 
using is the following: Matrix_New1 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"A"]),colnames(DataSeries)[2]
 )
Matrix_New2 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"B"]),colnames(DataSeries)[3]
 ) #whereas first and second columns should be numbers, third column is "A" and 
"B" respectively Matrix_Complete<- rbind(Matrix_New1,Matrix_New2) 
Col_Names_MC<-c("X","Y", "Z")
colnames(Matrix_Complete)<-Col_Names_MC Plot_AB<-xyplot(Y~ X, data 
=Matrix_Complete, type =c("l"), groups=Z, as.table=TRUE, main="Development over 
time") print(Plot_AB) Can you explain me why this way of creating a plot is not 
working and what I Need to Change in order to be able to plot it? 


__
R-help@r-project.org mailing list
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 using xyplot of lattice

2014-04-05 Thread arun
Hi,
You didn't provide a reproducible example.  If your dataset is something like 
this:
set.seed(495)
DataSeries <- data.frame(Date=seq(as.Date("2001-01-01"),by="1 day", 
length.out=20), A= sample(10,20,replace=TRUE), B= rnorm(20))


###Using your codes:

Matrix_New1 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"A"]),colnames(DataSeries)[2])

Matrix_New2 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"B"]),colnames(DataSeries)[3])

str(Matrix_New1)
#List of 60
str(Matrix_New2) 

#List of 60 

Matrix_Complete<- rbind(Matrix_New1,Matrix_New2)
str(Matrix_Complete)
#List of 120
Col_Names_MC<-c("X","Y", "Z")
colnames(Matrix_Complete)<-Col_Names_MC 

library(lattice) 

Plot_AB<-xyplot(Y~ X, data =Matrix_Complete, type =c("l"), groups=Z, 
as.table=TRUE, main="Development over time")
#Error in eval(expr, envir, enclos) : object 'Z' not found 

#You could try:
library(reshape2)
 DataSeriesM <- setNames(melt(DataSeries,id.var="Date"),LETTERS[c(24,26,25)])
 xyplot(Y~X,data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development 
over time")
 #for a numeric X axis
 
xyplot(Y~as.numeric(X),data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development
 over time") 
# with legends
 
xyplot(Y~as.numeric(X),xlab="X",data=DataSeriesM,type="l",groups=Z,as.table=TRUE,main="Development
 over time",auto.key=list(x=.85, y=.95, border=TRUE,lines=TRUE)) 


Hope it helps.

A.K.


Hi everbody, I have the following error message occuring when I run my code:
"Error in eval(expr, envir, enclos) : object 'Series' not found" The code I am 
using is the following: Matrix_New1 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"A"]),colnames(DataSeries)[2]
 )
Matrix_New2 <- 
cbind(as.list(DataSeries[,"Date"]),as.list(DataSeries[,"B"]),colnames(DataSeries)[3]
 ) #whereas first and second columns should be numbers, third column is "A" and 
"B" respectively Matrix_Complete<- rbind(Matrix_New1,Matrix_New2) 
Col_Names_MC<-c("X","Y", "Z")
colnames(Matrix_Complete)<-Col_Names_MC Plot_AB<-xyplot(Y~ X, data 
=Matrix_Complete, type =c("l"), groups=Z, as.table=TRUE, main="Development over 
time") print(Plot_AB) Can you explain me why this way of creating a plot is not 
working and what I Need to Change in order to be able to plot it? 


__
R-help@r-project.org mailing list
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.


  1   2   3   4   5   >