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.


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

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

__

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 

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


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.


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.


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.


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-18 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-
> >>> 25    splines_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
>

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

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


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


Michael

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

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

Thank you very much.

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

Kobby

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


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

metafor::forest(result.md)

it should work.

Best,
Wolfgang


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

=""


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


  sessionInfo()

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

Matrix products: default

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

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

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

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





class(result.md)

[1] "rma.uni" "rma"




Thank you
Kobby

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

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

Best,
Wolfgang


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

=""


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

tried

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

forest(result.md)

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

Thank you in advance for your support

regards
Kobby

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

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

Best,
Wolfgang

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


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

Amoatwi

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

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

and

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

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

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

library(reshape2) # Load package for data reshaping

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

id

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

1,

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

"tneg",

1, 0)

##sample of the data, the first 6 rows
head(bcg.long)
  trial variable value pos group
1 1  

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

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

Thank you very much.

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

Kobby

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

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

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

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

metafor::forest(result.md)

it should work.

Best,
Wolfgang

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

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

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

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

Matrix products: default

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

[5] LC_TIME=English_United States.1252

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

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

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

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

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

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

[17] CompQuadForm_1.4.3 compiler_4.0.1
>

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

Thank you
Kobby

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

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

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.


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

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.


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
 > 

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.


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.


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        

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

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 

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.


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.


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 University
3143 TAMU, Room 401A
College Station, TX 77843
aku...@stat.tamu.edu
+1 779 777 3428


From: David Winsemius <dwinsem...@comcast.net>
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 <aku...@stat.tamu.edu> 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 University
> 3143 TAMU, Room 401A
> College Station, TX 77843
> aku...@stat.tamu.edu<mailto:arnabkrma...@stat.tamu.edu>
> +1 779 777 3428<tel:%2B1%20779%20777%203428>
>
>   [[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 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 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.


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=CwIC-g=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI=prT9XxFuaRugndr7R7tjdw=HVCyKiQWRxny54BBUQ0nDk5GMBt-Tqu5QKL9lPLHz68=q4D_wqmRhBJGJthwMhvTyghlur-p0y7tvRFFyQzEKrY=
>> PLEASE do read the posting guide
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html=CwIC-g=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI=prT9XxFuaRugndr7R7tjdw=HVCyKiQWRxny54BBUQ0nDk5GMBt-Tqu5QKL9lPLHz68=Q6yO2ncF0da0PoI6_hWTYJpGUERfu3iQB1Uvl_-rr_I=
>> 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=CwIC-g=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI=prT9XxFuaRugndr7R7tjdw=HVCyKiQWRxny54BBUQ0nDk5GMBt-Tqu5QKL9lPLHz68=dg8BMn7W326f_R6GuQUhbH3-QoXSzP40qHbv_wLeNkI=

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


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.


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.

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 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 laura.ri...@slu.se 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:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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 laura.ri...@slu.se 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.

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 ifigueir...@ipma.pt 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.


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.


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 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 roland.deut...@tuwien.ac.at
 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(eta0)
   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 roland.deut...@tuwien.ac.at
 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(eta0)
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.


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.


Re: [R] Error Message using xyplot of lattice

2014-04-06 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.


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 smartpink...@yahoo.com 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

2014-03-18 Thread Jeff Newmiller
We cannot help you. You claim to have set the working directory but cannot find 
the file you expect to be there. Either you have failed to set the directory 
correctly, or the file is not where you think it is... and since we do not have 
access to your computer we have no way to tell you which case is true.

You can, though. Use the getwd() function to confirm your working directory, 
and use the list.files function to confirm whether your file is there.

Please follow the guidance in the Posting Guide next time you post, including 
using plain text email and a reproducible example.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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 March 18, 2014 7:09:31 AM PDT, anisha honey anisha.ku...@gmail.com wrote:
Hello
When i run this command i get the error as shown below.I also changed
my
working directory and set it where ever i want but still its
hopeless.please help me
counts - read.table(NewBrain.tab, header=TRUE, row.names=1)
Error in file(file, rt) : cannot open the connection
In addition: Warning message:
In file(file, rt) :
  cannot open file 'NewBrain.tab': No such file or directory

   [[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-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 running Linear regression

2014-03-03 Thread sportsguy
Never mind, the excel csv export had commas in the formatting, which caused  
 around the values, and R didn't find any regression values. . . .   thanks
for reading

sportsguy



--
View this message in context: 
http://r.789695.n4.nabble.com/Error-Message-when-running-Linear-regression-tp4686161p4686162.html
Sent from the R help mailing list archive at Nabble.com.

__
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 system is computationally singular under mlogit

2014-01-29 Thread Bert Gunter
Advice: I would guess that  you are overfitting. Simplify your model.
Drop some of the variables.You probably have (near) linear
dependencies in your design matrix.

-- Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom.
H. Gilbert Welch




On Wed, Jan 29, 2014 at 7:33 AM, Franckx Laurent
laurent.fran...@vito.be wrote:
 Dear all,

 I am trying to estimate a multinomial logit model with mlogit.

 The data I use for the estimation have the following format (in the full data 
 set, there are many more explanatory variables, but I omit them here for the 
 sake of simplicity):

 head(sample)
 choice  cl_vint_com gezinsid pr_tot
 10   1  411060112   2176.015
 2   0   2   411060112   2240.531
 3   0   3   411060112   3649.945
 4   0   4   411060112   3255.782
 5   0   5   411060112   5391.076
 6   0   6   411060112   3740.085

 choice is 1 if the alternative is chosen and 0 otherwise
  cl_vint_com   is the ID of the alternative
 gezinsid   is the ID of the individuals
 pr_tot is the price of each alternative.

 I use the following steps for the estimation:

 two_carmodel_data - mlogit.data(sample, choice = choice, shape = long, 
 alt.var = cl_vint_com, chid.var = gezinsid )
 formula_2cars - mFormula(choice  ~ pr_tot  )
 mod_res - mlogit(formula_2cars, two_carmodel_data)

 This leads to the following error messages:

   Error in solve.default(H, g[!fixed]) :  system is computationally 
 singular: reciprocal condition number = 5.17802e-25


 From the documentation of the mlogit package, I do not see any mistake in my 
 formulation of mFormula()   (pr_tot is an alternative specific variable).

 I have found some internet discussions of users facing a similar problem, and 
 I understand that in some cases, this may be due to some alternatives that 
 are never chosen in the sample (leading to separation problems).

 However, I have eliminated all alternatives that are never chosen, and the 
 problem persists. The output of the following table confirms that no 
 quasi-separation occurs):

 table(sample $pr_tot , sample $choice)

 I have probably made a very trivial mistake leading to collinerarity, but I 
 do not see where (after all, mlogit takes care of setting the 
 alternative-specific constant for the 1st alternative to zero, doesn't it?)

 Please advice.


 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









 #verify whether all cl_vint are chosen to avoid strict separation
 test_for_separ - table(input_for_NLOGIT_all_alt_joined$cl_vint_com 
 ,input_for_NLOGIT_all_alt_joined$choice)
 test_for_separ_sel - test_for_separ[test_for_separ$1 == 0, ]















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

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


Re: [R] error message system is computationally singular under mlogit

2014-01-29 Thread Franckx Laurent
Dear Bert

In the example below, I use just one variable (apparently I mixed up the 
formatting in the original mail) :

two_carmodel_data - mlogit.data(sample, choice = choice, shape = long, 
alt.var = cl_vint_com, chid.var = gezinsid )

formula_2cars  - mFormula(choice  ~ pr_tot  )

mod_res - mlogit(formula_2cars,  two_carmodel_data)



Thus, the only source of colinearity I can imagine is between  pr_tot   and 
the dummies for alternative-specific constant, but I thought mlogit 
automatically took care of setting one of them equal to zero.

Cheers

Laurent



-Original Message-
From: Bert Gunter [mailto:gunter.ber...@gene.com]
Sent: woensdag 29 januari 2014 16:43
To: Franckx Laurent
Cc: r-help@r-project.org
Subject: Re: [R] error message system is computationally singular under mlogit

Advice: I would guess that  you are overfitting. Simplify your model.
Drop some of the variables.You probably have (near) linear dependencies in your 
design matrix.

-- Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

Data is not information. Information is not knowledge. And knowledge is 
certainly not wisdom.
H. Gilbert Welch




On Wed, Jan 29, 2014 at 7:33 AM, Franckx Laurent laurent.fran...@vito.be 
wrote:
 Dear all,

 I am trying to estimate a multinomial logit model with mlogit.

 The data I use for the estimation have the following format (in the full data 
 set, there are many more explanatory variables, but I omit them here for the 
 sake of simplicity):

 head(sample)
 choice  cl_vint_com gezinsid pr_tot
 10   1  411060112   2176.015
 2   0   2   411060112   2240.531
 3   0   3   411060112   3649.945
 4   0   4   411060112   3255.782
 5   0   5   411060112   5391.076
 6   0   6   411060112   3740.085

 choice is 1 if the alternative is chosen and 0 otherwise
 cl_vint_com   is the ID of the alternative gezinsid   is the ID of
 the individuals pr_tot is the price of each alternative.

 I use the following steps for the estimation:

 two_carmodel_data - mlogit.data(sample, choice = choice, shape =
 long, alt.var = cl_vint_com, chid.var = gezinsid ) formula_2cars
 - mFormula(choice  ~ pr_tot  ) mod_res - mlogit(formula_2cars,
 two_carmodel_data)

 This leads to the following error messages:

   Error in solve.default(H, g[!fixed]) :  system is
 computationally singular: reciprocal condition number = 5.17802e-25


 From the documentation of the mlogit package, I do not see any mistake in my 
 formulation of mFormula()   (pr_tot is an alternative specific variable).

 I have found some internet discussions of users facing a similar problem, and 
 I understand that in some cases, this may be due to some alternatives that 
 are never chosen in the sample (leading to separation problems).

 However, I have eliminated all alternatives that are never chosen, and the 
 problem persists. The output of the following table confirms that no 
 quasi-separation occurs):

 table(sample $pr_tot , sample $choice)

 I have probably made a very trivial mistake leading to collinerarity,
 but I do not see where (after all, mlogit takes care of setting the
 alternative-specific constant for the 1st alternative to zero, doesn't
 it?)

 Please advice.


 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









 #verify whether all cl_vint are chosen to avoid strict separation
 test_for_separ - table(input_for_NLOGIT_all_alt_joined$cl_vint_com
 ,input_for_NLOGIT_all_alt_joined$choice)
 test_for_separ_sel - test_for_separ[test_for_separ$1 == 0, ]















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

 __
 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.
VITO Disclaimer: http://www.vito.be/e-maildisclaimer
__
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 glmer using R: “ 'what' must be a character string or a function”

2013-11-06 Thread William Dunlap
You can reproduce the problem by having a data.frame (or anything else) in your
environment:

new - data.frame(ï..VAR1 = rep(c(TRUE,NA,FALSE), c(10,2,8)), 
random=rep(1:3,len=20), clustno=rep(c(1:5),len=20), 
validatedRS6=rep(0:1,len=20))
model1- glmer(validatedRS6 ~ random + (1|clustno), data=new, 
family=binomial(), nAGQ=3)
# Error in do.call(new, c(list(Class = glmResp, family = family), 
ll[setdiff(names(ll),  : 
#  'what' must be a character string or a function

The problem is in the call
   do.call(new, list())
It finds your dataset 'new' (in .GlobalEnv), which is not a function or the 
name of a function,
not the function 'new' from the 'methods' package.  Rename your dataset, so you 
do not
have anything called 'new' masking the one in package:methods, and things 
should work.

Write to the maintainer of the package (use maintainer(lme4) for the address) 
about the
problem.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of EmmaB
 Sent: Tuesday, November 05, 2013 4:48 PM
 To: r-help@r-project.org
 Subject: Re: [R] Error message glmer using R: “ 'what' must be a character 
 string or a
 function”
 
  str(new)
 'data.frame':   1214 obs. of  4 variables:
  $ ï..VAR1 : logi  NA NA NA NA NA NA ...
  $ random  : int  1 1 1 1 1 1 1 1 1 1 ...
  $ clustno : int  1 1 1 1 1 1 1 1 1 1 ...
  $ validatedRS6: int  0 0 0 0 0 0 0 0 0 0 ...
 
 
 
 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Error-message-glmer-
 using-R-what-must-be-a-character-string-or-a-function-tp4679829p4679836.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 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.


Re: [R] Error message glmer using R: “ 'what' must be a character string or a function”

2013-11-06 Thread William Dunlap
 You can reproduce the problem by having a data.frame (or anything else) in 
 your
 environment:

I left out called 'new' in the above statement.  The example is correct.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com

 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of William Dunlap
 Sent: Wednesday, November 06, 2013 8:04 AM
 To: EmmaB; r-help@r-project.org
 Subject: Re: [R] Error message glmer using R: “ 'what' must be a character 
 string or a
 function”
 
 You can reproduce the problem by having a data.frame (or anything else) in 
 your
 environment:
 
 new - data.frame(ï..VAR1 = rep(c(TRUE,NA,FALSE), c(10,2,8)),
 random=rep(1:3,len=20), clustno=rep(c(1:5),len=20), 
 validatedRS6=rep(0:1,len=20))
 model1- glmer(validatedRS6 ~ random + (1|clustno), data=new, 
 family=binomial(),
 nAGQ=3)
 # Error in do.call(new, c(list(Class = glmResp, family = family), 
 ll[setdiff(names(ll),  :
 #  'what' must be a character string or a function
 
 The problem is in the call
do.call(new, list())
 It finds your dataset 'new' (in .GlobalEnv), which is not a function or the 
 name of a
 function,
 not the function 'new' from the 'methods' package.  Rename your dataset, so 
 you do not
 have anything called 'new' masking the one in package:methods, and things 
 should work.
 
 Write to the maintainer of the package (use maintainer(lme4) for the 
 address) about
 the
 problem.
 
 Bill Dunlap
 Spotfire, TIBCO Software
 wdunlap tibco.com
 
 
  -Original Message-
  From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
  Behalf
  Of EmmaB
  Sent: Tuesday, November 05, 2013 4:48 PM
  To: r-help@r-project.org
  Subject: Re: [R] Error message glmer using R: “ 'what' must be a character 
  string or a
  function”
 
   str(new)
  'data.frame':   1214 obs. of  4 variables:
   $ ï..VAR1 : logi  NA NA NA NA NA NA ...
   $ random  : int  1 1 1 1 1 1 1 1 1 1 ...
   $ clustno : int  1 1 1 1 1 1 1 1 1 1 ...
   $ validatedRS6: int  0 0 0 0 0 0 0 0 0 0 ...
 
 
 
  --
  View this message in context: 
  http://r.789695.n4.nabble.com/Error-message-glmer-
  using-R-what-must-be-a-character-string-or-a-function-tp4679829p4679836.html
  Sent from the R help mailing list archive at Nabble.com.
 
  __
  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-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 glmer using R: “ 'what' must be a character string or a function”

2013-11-06 Thread Ben Bolker
William Dunlap wdunlap at tibco.com writes:

 
  You can reproduce the problem by having a data.frame (or anything
  else) in your environment:   I left out called 'new' in the
  above statement.  The example is correct.
 
 Bill Dunlap
 Spotfire, TIBCO Software
 wdunlap tibco.com
 
  -Original Message-

[snip]

  You can reproduce the problem by having a data.frame (or anything
  else) in your environment: new - data.frame(ï..VAR1 =
  rep(c(TRUE,NA,FALSE), c(10,2,8)), random=rep(1:3,len=20),
  clustno=rep(c(1:5),len=20), validatedRS6=rep(0:1,len=20)) model1-
  glmer(validatedRS6 ~ random + (1|clustno), data=new,
  family=binomial(), nAGQ=3) # Error in do.call(new, c(list(Class =
  glmResp, family = family), ll[setdiff(names(ll), : # 'what' must
  be a character string or a function The problem is in the call
  do.call(new, list()) It finds your dataset 'new' (in .GlobalEnv),
  which is not a function or the name of a function, not the
  function 'new' from the 'methods' package.  Rename your dataset,
  so you do not have anything called 'new' masking the one in
  package:methods, and things should work.  Write to the maintainer
  of the package (use maintainer(lme4) for the address) about the
  problem.

For what it's worth, I saw this on StackOverflow:

[broken URL]
http://stackoverflow.com/questions/19801070/
  error-message-glmer-using-r-what-must-be-a-character-string-or-a-function

answered it there, and have fixed it on Github: 

https://github.com/lme4/lme4/commit/9c12f002821f9567d5454e2ce3b78076dabffb54

While it is not officially forbidden in 
http://www.r-project.org/posting-guide.html (to my surprise, I can't
even find any proscription against cross-posting to R mailing lists,
although there is a section about which list to post to), posting
to both r-help and Stack Overflow tends to lead to duplicated effort/
frustration.  Please choose one or the other (in my opinion it's
OK to cross-post after a few days if you don't get any responses
in one place, provided that you say that you've cross-posted and
ideally provide a reference link to the cross-post).

  Ben Bolker

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

2013-11-05 Thread PIKAL Petr
Hi

Although I do not know about SPACECAP here are few hints.

Usually attachment does not go through, use dput instead.
Copy output of

dput(head(yourdata))

to the mail.

str(yourdata)

Gives you (and us if you show the output) some info about your data mode.

My opinion is that some column is not the correct type for used function.

Regards
Petr


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of Miroslav Kutal
 Sent: Monday, November 04, 2013 12:11 PM
 To: r-help@r-project.org
 Subject: [R] Error message in SPACECAP package
 
 Dear all
 
 I've tried a spatial capture-recapture in SPACECAP package but got
 stuck after uploading the input data files:
 
 Error in animal capture details file - non-integer or missing values
 Error in if (locso[loc, so + 3] == 0) { :
 missing value where TRUE/FALSE needed
 
 I prepared the input capture file according to the manual and the file
 should consist from three columns: LOC_ID, ANIMAL_ID, SO (sampling
 occasion) so actually no TRUE/FALSE type of data..
 
 I am attaching also the input capture file. Because I am not familiar
 with all R functions I would appreciate any suggestion for solving this
 problem.
 
 Thank you,
 
 Miroslav Kutal

__
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 glmer using R: “ 'what' must be a character string or a function”

2013-11-05 Thread David Winsemius

On Nov 5, 2013, at 3:36 PM, EmmaB wrote:

 I am running a multi-level model. I use the following commands with
 validatedRS6 as the outcome, random as the predictor and clustno as the
 random effects variable.
 
 new-as.data.frame(read.delim(BABEX.dat, header=TRUE))
 install.packages(lme4)
 library(lme4)
 model1- glmer(validatedRS6 ~ random + (1|clustno), data=new,
 family=binomial(logit), nAGQ)
 
 However, I get the following error
 
 Error in do.call(new, c(list(Class = glmResp, family = family),
 ll[setdiff(names(ll), : 'what' must be a character string or a function
 
 I have absolutely no idea what has gone wrong and have searched the
 internet. I am sorry but I cannot provide the data as it is from an
 intervention which has yet to be published.

You at least need to post the output of str(new).


 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Error-message-glmer-using-R-what-must-be-a-character-string-or-a-function-tp4679829.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 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.

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 glmer using R: “ 'what' must be a character string or a function”

2013-11-05 Thread EmmaB
 str(new)
'data.frame':   1214 obs. of  4 variables:
 $ ï..VAR1 : logi  NA NA NA NA NA NA ...
 $ random  : int  1 1 1 1 1 1 1 1 1 1 ...
 $ clustno : int  1 1 1 1 1 1 1 1 1 1 ...
 $ validatedRS6: int  0 0 0 0 0 0 0 0 0 0 ...



--
View this message in context: 
http://r.789695.n4.nabble.com/Error-message-glmer-using-R-what-must-be-a-character-string-or-a-function-tp4679829p4679836.html
Sent from the R help mailing list archive at Nabble.com.

__
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 after following Appendix A R-intro

2013-10-16 Thread Ben Tupper
Hi,

On Oct 16, 2013, at 7:03 PM, timscharlton tcharl...@aquafirma.com.au wrote:

 I am new to R and tried to go through the commands shown at App. A of
 R-intro (p.78).  
 
 I get the following error message.
 
 fm-1m(y~x,data=dummy)
 Error: unexpected symbol in fm-1m


I think the example shows the function 'lm', which is an acronym for 'linear 
model', not '1m', which is an acronym 'one melon'. 
  
Cheers,
Ben

 
 I suspect it might be related to the tilda.  All the commands in R-intro for
 the tilda show it in a superscript postion. From my keyboard I only have the
 option as shown above.  
 
 Any help would be much appreciated.
 
 Tim
 
 
 
 --
 View this message in context: 
 http://r.789695.n4.nabble.com/Error-message-after-following-Appendix-A-R-intro-tp4678394.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 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.

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

__
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 after following Appendix A R-intro

2013-10-16 Thread David Winsemius

On Oct 16, 2013, at 4:03 PM, timscharlton wrote:

 I am new to R and tried to go through the commands shown at App. A of
 R-intro (p.78).  
 
 I get the following error message.
 
 fm-1m(y~x,data=dummy)
 Error: unexpected symbol in fm-1m

In some screen fonts it's difficult to tell the difference between a 1 and an 
l. You have type 1m thinking it was lm.


 
 I suspect it might be related to the tilda.

No.

  All the commands in R-intro for
 the tilda show it in a superscript postion. From my keyboard I only have the
 option as shown above.  
 
 Any help would be much appreciated.
 
 Tim
 
 
-- 
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 in gev

2013-07-17 Thread Rui Barradas

Hello,

You should say which package is gev() coming from. I believe it's from 
evir, and what follows assumes that.
The problem is that 'dat' is a data.frame, a special type of list. It is 
a list of vectors and gev is expecting just one vector. You could try 
instead, to fit generalized extreme value distributions to each of the 
vectors in the data.frame,


out.list - lapply(dat, gev, block = 20)


to get a list of 10 objects of class gev, like the help page says.

Hope this helps,

Rui Barradas

Em 17-07-2013 10:33, Roslina Zakaria escreveu:


Hi r-users,

I would like to use gev and my data (annual rainfall ) is as follows:


head(dat,20)  ABCDEFGHI J

1  45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8  54.0
2  50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4  58.3
3  41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5  45.6
4  50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7  38.3
5  39.3 30.6 46.9 23.8 25.8 17.1 37.9 40.1 35.4  30.1
6  50.2 43.6 55.5 26.7 36.6 20.6 35.2 46.0 52.2  30.5
7  46.0 37.0 55.3 36.3 51.9 50.6 43.2 44.9 38.2  45.4
8  46.0 15.4 35.7 27.3 40.2 21.2 41.1 65.7 35.7  28.7
9  52.0 36.5 49.6 55.0 38.3 32.0 43.8 43.8 50.3  36.5
10 57.5 51.0 47.0 63.0 43.0 46.5 41.5 82.8 50.5  38.5
11 71.0 48.0 59.5 48.5 47.0 57.5 55.8 64.5 60.0  43.4
12 57.5 52.5 58.5 42.0 62.0 44.0 47.5 59.5 45.0  51.5
13 47.0 38.0 49.9 50.5 55.0 57.5 51.5 54.5 45.0  49.7
14 66.5 44.4 60.0 99.5 54.5 41.3 57.0 69.5 33.0  58.4
15 61.5 43.6 68.5 50.7 48.0 50.5 50.5 58.8 53.2  47.0
16 55.5 58.5 55.5 45.8 48.0 57.0 52.0 48.5 58.5 437.5
17 96.7 96.7 96.7 45.5 65.1 46.5 51.0 96.7 61.3 310.5
18 71.5 55.5 63.0 52.5 59.0 55.5 55.5 51.1 47.0  49.5
19 71.5 42.5 64.0 56.5 61.0 54.0 46.5 53.7 43.0  44.0
20 57.5 51.5 51.3 34.0 55.0 61.0 55.5 51.3 51.3  44.5

When I apply the gev function, I have the following error message:

out - gev(dat, 20) Error in gev(dat, 20) : (list) object cannot be coerced to 
type 'double'

Can anybody explain to me what does it means.  I tried to read the package 
manual but could not understand about the block.

Thank you so much for any help given.
[[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-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 gev

2013-07-17 Thread Rui Barradas

Hello,

It's better if you Cc the list, the odds of getting more and better 
answers are greater.


Have you tried with different block values?

Rui Barradas

Em 17-07-2013 13:33, Roslina Zakaria escreveu:

Hi Rui,
Yes, I am using gev from 'evir'
install.packages(evir)
library(evir)
I have tried your suggestion and follow are what I got.


out.list - lapply(dat, gev, block = 20)

Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) :
   non-finite finite-difference value [1]
In addition:Warning messages:
1: In FUN(X[[7L]], ...) : optimization may not have succeeded
2: In FUN(X[[7L]], ...) : optimization may not have succeeded
3: In sqrt(diag(varcov)) : NaNs produced
4: In FUN(X[[7L]], ...) : optimization may not have succeeded
5: In FUN(X[[7L]], ...) : optimization may not have succeeded
6: In FUN(X[[7L]], ...) : optimization may not have succeeded
7: In FUN(X[[7L]], ...) : optimization may not have succeeded



Thank you.


*From:* Rui Barradas ruipbarra...@sapo.pt
*To:* Roslina Zakaria zrosl...@yahoo.com
*Cc:* r-help@r-project.org r-help@r-project.org
*Sent:* Wednesday, July 17, 2013 5:51 PM
*Subject:* Re: [R] error message in gev

Hello,

You should say which package is gev() coming from. I believe it's from
evir, and what follows assumes that.
The problem is that 'dat' is a data.frame, a special type of list. It is
a list of vectors and gev is expecting just one vector. You could try
instead, to fit generalized extreme value distributions to each of the
vectors in the data.frame,

out.list - lapply(dat, gev, block = 20)


to get a list of 10 objects of class gev, like the help page says.

Hope this helps,

Rui Barradas

Em 17-07-2013 10:33, Roslina Zakaria escreveu:
 
  Hi r-users,
 
  I would like to use gev and my data (annual rainfall ) is as follows:
 
  head(dat,20)  ABCDEFGHIJ
  1  45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0
  2  50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4  58.3
  3  41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5  45.6
  4  50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7  38.3
  5  39.3 30.6 46.9 23.8 25.8 17.1 37.9 40.1 35.4  30.1
  6  50.2 43.6 55.5 26.7 36.6 20.6 35.2 46.0 52.2  30.5
  7  46.0 37.0 55.3 36.3 51.9 50.6 43.2 44.9 38.2  45.4
  8  46.0 15.4 35.7 27.3 40.2 21.2 41.1 65.7 35.7  28.7
  9  52.0 36.5 49.6 55.0 38.3 32.0 43.8 43.8 50.3  36.5
  10 57.5 51.0 47.0 63.0 43.0 46.5 41.5 82.8 50.5  38.5
  11 71.0 48.0 59.5 48.5 47.0 57.5 55.8 64.5 60.0  43.4
  12 57.5 52.5 58.5 42.0 62.0 44.0 47.5 59.5 45.0  51.5
  13 47.0 38.0 49.9 50.5 55.0 57.5 51.5 54.5 45.0  49.7
  14 66.5 44.4 60.0 99.5 54.5 41.3 57.0 69.5 33.0  58.4
  15 61.5 43.6 68.5 50.7 48.0 50.5 50.5 58.8 53.2  47.0
  16 55.5 58.5 55.5 45.8 48.0 57.0 52.0 48.5 58.5 437.5
  17 96.7 96.7 96.7 45.5 65.1 46.5 51.0 96.7 61.3 310.5
  18 71.5 55.5 63.0 52.5 59.0 55.5 55.5 51.1 47.0  49.5
  19 71.5 42.5 64.0 56.5 61.0 54.0 46.5 53.7 43.0  44.0
  20 57.5 51.5 51.3 34.0 55.0 61.0 55.5 51.3 51.3  44.5
 
  When I apply the gev function, I have the following error message:
 
  out - gev(dat, 20) Error in gev(dat, 20) : (list) object cannot be
coerced to type 'double'
 
  Can anybody explain to me what does it means.  I tried to read the
package manual but could not understand about the block.
 
  Thank you so much for any help given.
  [[alternative HTML version deleted]]
 
 
 
  __
  R-help@r-project.org mailto: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.


Re: [R] error message in gev

2013-07-17 Thread Roslina Zakaria
Hi Rui,
 
I have tried different block values and below are the error message I got:
  out - gev(dat, A) Error in as.POSIXlt.default(attributes(data)$times) : 
do not know how to convert 'attributes(data)$times' to class “POSIXlt”
 
out.list - lapply(dat, gev, block = 10) Error in optim(theta, negloglik, 
hessian = TRUE, ..., tmp = data) :  non-finite finite-difference value [2]
 


 From: Rui Barradas ruipbarra...@sapo.pt

Cc: 'r-help' r-help@r-project.org 
Sent: Wednesday, July 17, 2013 8:49 PM
Subject: Re: [R] error message in gev
  

Hello,

It's better if you Cc the list, the odds of getting more and better 
answers are greater.

Have you tried with different block values?

Rui Barradas

Em 17-07-2013 13:33, Roslina Zakaria escreveu:
 Hi Rui,
 Yes, I am using gev from 'evir'
 install.packages(evir)
 library(evir)
 I have tried your suggestion and follow are what I got.

out.list - lapply(dat, gev, block = 20)
 Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) :
    non-finite finite-difference value [1]
 In addition:Warning messages:
 1: In FUN(X[[7L]], ...) : optimization may not have succeeded
 2: In FUN(X[[7L]], ...) : optimization may not have succeeded
 3: In sqrt(diag(varcov)) : NaNs produced
 4: In FUN(X[[7L]], ...) : optimization may not have succeeded
 5: In FUN(X[[7L]], ...) : optimization may not have succeeded
 6: In FUN(X[[7L]], ...) : optimization may not have succeeded
 7: In FUN(X[[7L]], ...) : optimization may not have succeeded



 Thank you.


 *From:* Rui Barradas ruipbarra...@sapo.pt

 *Cc:* r-help@r-project.org r-help@r-project.org
 *Sent:* Wednesday, July 17, 2013 5:51 PM
 *Subject:* Re: [R] error message in gev

 Hello,

 You should say which package is gev() coming from. I believe it's from
 evir, and what follows assumes that.
 The problem is that 'dat' is a data.frame, a special type of list. It is
 a list of vectors and gev is expecting just one vector. You could try
 instead, to fit generalized extreme value distributions to each of the
 vectors in the data.frame,

 out.list - lapply(dat, gev, block = 20)


 to get a list of 10 objects of class gev, like the help page says.

 Hope this helps,

 Rui Barradas

 Em 17-07-2013 10:33, Roslina Zakaria escreveu:
  
   Hi r-users,
  
   I would like to use gev and my data (annual rainfall ) is as follows:
  
   head(dat,20)  A    B    C    D    E    F    G    H    
I    J
   1  45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0
   2  50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4  58.3
   3  41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5  45.6
   4  50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7  38.3
   5  39.3 30.6 46.9 23.8 25.8 17.1 37.9 40.1 35.4  30.1
   6  50.2 43.6 55.5 26.7 36.6 20.6 35.2 46.0 52.2  30.5
   7  46.0 37.0 55.3 36.3 51.9 50.6 43.2 44.9 38.2  45.4
   8  46.0 15.4 35.7 27.3 40.2 21.2 41.1 65.7 35.7  28.7
   9  52.0 36.5 49.6 55.0 38.3 32.0 43.8 43.8 50.3  36.5
   10 57.5 51.0 47.0 63.0 43.0 46.5 41.5 82.8 50.5  38.5
   11 71.0 48.0 59.5 48.5 47.0 57.5 55.8 64.5 60.0  43.4
   12 57.5 52.5 58.5 42.0 62.0 44.0 47.5 59.5 45.0  51.5
   13 47.0 38.0 49.9 50.5 55.0 57.5 51.5 54.5 45.0  49.7
   14 66.5 44.4 60.0 99.5 54.5 41.3 57.0 69.5 33.0  58.4
   15 61.5 43.6 68.5 50.7 48.0 50.5 50.5 58.8 53.2  47.0
   16 55.5 58.5 55.5 45.8 48.0 57.0 52.0 48.5 58.5 437.5
   17 96.7 96.7 96.7 45.5 65.1 46.5 51.0 96.7 61.3 310.5
   18 71.5 55.5 63.0 52.5 59.0 55.5 55.5 51.1 47.0  49.5
   19 71.5 42.5 64.0 56.5 61.0 54.0 46.5 53.7 43.0  44.0
   20 57.5 51.5 51.3 34.0 55.0 61.0 55.5 51.3 51.3  44.5
  
   When I apply the gev function, I have the following error message:
  
   out - gev(dat, 20) Error in gev(dat, 20) : (list) object cannot be
 coerced to type 'double'
  
   Can anybody explain to me what does it means.  I tried to read the
 package manual but could not understand about the block.
  
   Thank you so much for any help given.
       [[alternative HTML version deleted]]
  
  
  
   __
   R-help@r-project.org mailto: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.


Re: [R] error message in gev

2013-07-17 Thread Rui Barradas

Hello,

And what if you try it without a block value?

out.list - lapply(dat, gev)

Rui Barradas

Em 17-07-2013 14:53, Roslina Zakaria escreveu:

Hi Rui,
I have tried different block values and below are the error message I got:


out - gev(dat, A)

Error in as.POSIXlt.default(attributes(data)$times) :

   do not know how to convert 'attributes(data)$times' to class “POSIXlt”



out.list - lapply(dat, gev, block = 10)
Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) :
   non-finite finite-difference value [2]


*From:* Rui Barradas ruipbarra...@sapo.pt
*To:* Roslina Zakaria zrosl...@yahoo.com
*Cc:* 'r-help' r-help@r-project.org
*Sent:* Wednesday, July 17, 2013 8:49 PM
*Subject:* Re: [R] error message in gev

Hello,

It's better if you Cc the list, the odds of getting more and better
answers are greater.

Have you tried with different block values?

Rui Barradas

Em 17-07-2013 13:33, Roslina Zakaria escreveu:
  Hi Rui,
  Yes, I am using gev from 'evir'
  install.packages(evir)
  library(evir)
  I have tried your suggestion and follow are what I got.
 
 out.list - lapply(dat, gev, block = 20)
  Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) :
 non-finite finite-difference value [1]
  In addition:Warning messages:
  1: In FUN(X[[7L]], ...) : optimization may not have succeeded
  2: In FUN(X[[7L]], ...) : optimization may not have succeeded
  3: In sqrt(diag(varcov)) : NaNs produced
  4: In FUN(X[[7L]], ...) : optimization may not have succeeded
  5: In FUN(X[[7L]], ...) : optimization may not have succeeded
  6: In FUN(X[[7L]], ...) : optimization may not have succeeded
  7: In FUN(X[[7L]], ...) : optimization may not have succeeded
 
 
 
  Thank you.
 
 
  *From:* Rui Barradas ruipbarra...@sapo.pt mailto:ruipbarra...@sapo.pt
  *To:* Roslina Zakaria zrosl...@yahoo.com mailto:zrosl...@yahoo.com
  *Cc:* r-help@r-project.org mailto:r-help@r-project.org
r-help@r-project.org mailto:r-help@r-project.org
  *Sent:* Wednesday, July 17, 2013 5:51 PM
  *Subject:* Re: [R] error message in gev
 
  Hello,
 
  You should say which package is gev() coming from. I believe it's from
  evir, and what follows assumes that.
  The problem is that 'dat' is a data.frame, a special type of list. It is
  a list of vectors and gev is expecting just one vector. You could try
  instead, to fit generalized extreme value distributions to each of the
  vectors in the data.frame,
 
  out.list - lapply(dat, gev, block = 20)
 
 
  to get a list of 10 objects of class gev, like the help page says.
 
  Hope this helps,
 
  Rui Barradas
 
  Em 17-07-2013 10:33, Roslina Zakaria escreveu:
   
Hi r-users,
   
I would like to use gev and my data (annual rainfall ) is as follows:
   
head(dat,20)  ABCDEFGHI J
1  45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0
2  50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4  58.3
3  41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5  45.6
4  50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7  38.3
5  39.3 30.6 46.9 23.8 25.8 17.1 37.9 40.1 35.4  30.1
6  50.2 43.6 55.5 26.7 36.6 20.6 35.2 46.0 52.2  30.5
7  46.0 37.0 55.3 36.3 51.9 50.6 43.2 44.9 38.2  45.4
8  46.0 15.4 35.7 27.3 40.2 21.2 41.1 65.7 35.7  28.7
9  52.0 36.5 49.6 55.0 38.3 32.0 43.8 43.8 50.3  36.5
10 57.5 51.0 47.0 63.0 43.0 46.5 41.5 82.8 50.5  38.5
11 71.0 48.0 59.5 48.5 47.0 57.5 55.8 64.5 60.0  43.4
12 57.5 52.5 58.5 42.0 62.0 44.0 47.5 59.5 45.0  51.5
13 47.0 38.0 49.9 50.5 55.0 57.5 51.5 54.5 45.0  49.7
14 66.5 44.4 60.0 99.5 54.5 41.3 57.0 69.5 33.0  58.4
15 61.5 43.6 68.5 50.7 48.0 50.5 50.5 58.8 53.2  47.0
16 55.5 58.5 55.5 45.8 48.0 57.0 52.0 48.5 58.5 437.5
17 96.7 96.7 96.7 45.5 65.1 46.5 51.0 96.7 61.3 310.5
18 71.5 55.5 63.0 52.5 59.0 55.5 55.5 51.1 47.0  49.5
19 71.5 42.5 64.0 56.5 61.0 54.0 46.5 53.7 43.0  44.0
20 57.5 51.5 51.3 34.0 55.0 61.0 55.5 51.3 51.3  44.5
   
When I apply the gev function, I have the following error message:
   
out - gev(dat, 20) Error in gev(dat, 20) : (list) object cannot be
  coerced to type 'double'
   
Can anybody explain to me what does it means. I tried to read the
  package manual but could not understand about the block.
   
Thank you so much for any help given.
   [[alternative HTML version deleted]]
   
   
   
__
R-help@r-project.org mailto:R-help@r-project.org
mailto:R-help@r-project.org mailto: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
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

Re: [R] error message in gev

2013-07-17 Thread Roslina Zakaria
Hi Rui,
 
Yes, it works beatifully this time.
  
Thank you so much for your help.
 


 From: Rui Barradas ruipbarra...@sapo.pt

Cc: R help forum R-help@r-project.org 
Sent: Wednesday, July 17, 2013 11:28 PM
Subject: Re: [R] error message in gev
  

Hello,

And what if you try it without a block value?

out.list - lapply(dat, gev)

Rui Barradas

Em 17-07-2013 14:53, Roslina Zakaria escreveu:
 Hi Rui,
 I have tried different block values and below are the error message I got:

out - gev(dat, A)
 Error in as.POSIXlt.default(attributes(data)$times) :

    do not know how to convert 'attributes(data)$times' to class 
“POSIXlt”



 out.list - lapply(dat, gev, block = 10)
 Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) :
    non-finite finite-difference value [2]


 *From:* Rui Barradas ruipbarra...@sapo.pt

 *Cc:* 'r-help' r-help@r-project.org
 *Sent:* Wednesday, July 17, 2013 8:49 PM
 *Subject:* Re: [R] error message in gev

 Hello,

 It's better if you Cc the list, the odds of getting more and better
 answers are greater.

 Have you tried with different block values?

 Rui Barradas

 Em 17-07-2013 13:33, Roslina Zakaria escreveu:
   Hi Rui,
   Yes, I am using gev from 'evir'
   install.packages(evir)
   library(evir)
   I have tried your suggestion and follow are what I got.
  
  out.list - lapply(dat, gev, block = 20)
   Error in optim(theta, negloglik, hessian = TRUE, ..., tmp = data) :
      non-finite finite-difference value [1]
   In addition:Warning messages:
   1: In FUN(X[[7L]], ...) : optimization may not have succeeded
   2: In FUN(X[[7L]], ...) : optimization may not have succeeded
   3: In sqrt(diag(varcov)) : NaNs produced
   4: In FUN(X[[7L]], ...) : optimization may not have succeeded
   5: In FUN(X[[7L]], ...) : optimization may not have succeeded
   6: In FUN(X[[7L]], ...) : optimization may not have succeeded
   7: In FUN(X[[7L]], ...) : optimization may not have succeeded
  
  
  
   Thank you.
  
  
   *From:* Rui Barradas ruipbarra...@sapo.pt mailto:ruipbarra...@sapo.pt

com
   *Cc:* r-help@r-project.org mailto:r-help@r-project.org
 r-help@r-project.org mailto:r-help@r-project.org
   *Sent:* Wednesday, July 17, 2013 5:51 PM
   *Subject:* Re: [R] error message in gev
  
   Hello,
  
   You should say which package is gev() coming from. I believe it's from
   evir, and what follows assumes that.
   The problem is that 'dat' is a data.frame, a special type of list. It is
   a list of vectors and gev is expecting just one vector. You could try
   instead, to fit generalized extreme value distributions to each of the
   vectors in the data.frame,
  
   out.list - lapply(dat, gev, block = 20)
  
  
   to get a list of 10 objects of class gev, like the help page says.
  
   Hope this helps,
  
   Rui Barradas
  
   Em 17-07-2013 10:33, Roslina Zakaria escreveu:
    
     Hi r-users,
    
     I would like to use gev and my data (annual rainfall ) is as follows:
    
     head(dat,20)  A    B    C    D    E    F    G    H  
  I J
     1  45.1 41.5 58.5 50.1 46.0 49.1 37.7 49.1 59.8 54.0
     2  50.3 39.8 49.4 56.4 49.4 48.8 42.1 49.8 49.4  58.3
     3  41.7 39.3 44.6 39.1 35.7 41.5 40.8 40.8 38.5  45.6
     4  50.7 33.9 48.4 28.2 35.5 39.1 61.4 17.0 30.7  38.3
     5  39.3 30.6 46.9 23.8 25.8 17.1 37.9 40.1 35.4  30.1
     6  50.2 43.6 55.5 26.7 36.6 20.6 35.2 46.0 52.2  30.5
     7  46.0 37.0 55.3 36.3 51.9 50.6 43.2 44.9 38.2  45.4
     8  46.0 15.4 35.7 27.3 40.2 21.2 41.1 65.7 35.7  28.7
     9  52.0 36.5 49.6 55.0 38.3 32.0 43.8 43.8 50.3  36.5
     10 57.5 51.0 47.0 63.0 43.0 46.5 41.5 82.8 50.5  38.5
     11 71.0 48.0 59.5 48.5 47.0 57.5 55.8 64.5 60.0  43.4
     12 57.5 52.5 58.5 42.0 62.0 44.0 47.5 59.5 45.0  51.5
     13 47.0 38.0 49.9 50.5 55.0 57.5 51.5 54.5 45.0  49.7
     14 66.5 44.4 60.0 99.5 54.5 41.3 57.0 69.5 33.0  58.4
     15 61.5 43.6 68.5 50.7 48.0 50.5 50.5 58.8 53.2  47.0
     16 55.5 58.5 55.5 45.8 48.0 57.0 52.0 48.5 58.5 437.5
     17 96.7 96.7 96.7 45.5 65.1 46.5 51.0 96.7 61.3 310.5
     18 71.5 55.5 63.0 52.5 59.0 55.5 55.5 51.1 47.0  49.5
     19 71.5 42.5 64.0 56.5 61.0 54.0 46.5 53.7 43.0  44.0
     20 57.5 51.5 51.3 34.0 55.0 61.0 55.5 51.3 51.3  44.5
    
     When I apply the gev function, I have the following error message:
    
     out - gev(dat, 20) Error in gev(dat, 20) : (list) object cannot be
   coerced to type 'double'
    
     Can anybody explain to me what does it means. I tried to read the
   package manual but could not understand about the block.
    
     Thank you so much for any help given.
        [[alternative HTML version deleted]]
    
    
    
     __
     R-help@r-project.org mailto:R-help@r-project.org
 mailto:R-help@r-project.org mailto:R-help@r-project.org

Re: [R] Error message

2013-07-10 Thread Prof Brian Ripley

On 10/07/2013 15:04, Emanuele Belli wrote:

Hello,
I'm an italian student, I've got some problems using R:
After calculating a dbinom() function, my  help.start() started not to work.
If I type on the console Help.start, it says me starting httpd help server 
...Errore in stats::runif(10) :
   .Random.seed is not an integer vector but of type 'double'

I tried to upgrade, unistall, but anything, it was impossible to solve this 
problem.
Can you help me?


Try

rm(.Random.seed)

Looks like you saved an object of the wrong type under than name.


Thank you in advance,

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




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
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 solution: cannot allocate vector of size 200Mb

2013-05-23 Thread Gyanendra Pokharel
Try in R 64 bit.
Thanks

Gyanendra Pokharel
University of Guelph
Guelph, ON


On Thu, May 23, 2013 at 10:53 AM, Ray Cheung ray1...@gmail.com wrote:

 Dear All,

 I wrote a program using R 2.15.2 but this error message cannot allocate
 vector of size 200Mb appeared. I want to ask in general how to handle this
 situation. I try to run the same program on other computers. It is
 perfectly fine. Can anybody help? Thank you very much in advance.

 Best Regards,
 Ray

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


Re: [R] Error message after R-3.0.0 upgrade installation

2013-04-30 Thread Prof Brian Ripley

On 30/04/2013 07:44, Anupam Tyagi wrote:

R-3.0.0 prints an error message at startup. I uninstalled a previous
version and installed this on Windows 8. Uninstall of previous version
deleted all previously installed packages and I forgot to keep a list
of them. How do I correct this error?


Error: requested primitive type is not consistent with catched value
Error: requested primitive type is not consistent with catched value



Really?  That is not the message from R 3.0.0 (it says 'cached').

So you are not telling us the whole story, and we cannot help until you do.

If you have not already, try starting R with --vanilla.  If that works, 
the issue is a saved workspace file (a .RData file) that needs to be 
moved out of the way.



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
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

2013-04-30 Thread Jeff Newmiller
That is unlikely in the absence of a reproducible example [1].

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

Havenga, BS, Mnr 15264...@sun.ac.za 15264...@sun.ac.za wrote:

Hi there

I am a Masters student at the University of Stellenbosch. I have been
using R to analyze the data, using the GLS model, of one of my
experiments.
The problem that I am having is that whenever I run my model using:
fit.glsmodel1-gls(Number~as.factor(Season)+as.factor(Depth)+as.factor(Orientation),
data=Number, weights=varPower(), method=ML)

I get the error:
Error in glsEstimate(object, control = control) :computed gls fit
is singular, rank 8

I would like to know if anyone can tell me what is causing this error.
Any advice will be much appreciated.

Kind regards
Brendan

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

2013-04-30 Thread Bert Gunter
Actually, Jeff, it may not be.

The OP has likely overfit -- as a guess,  Depth is essentially
continuous and as.factor() produces too many levels. I would recommend
that the OP find a local statistical consultant to help him, as he
seems out of his depth, statistically. Failing that, he should
probably post to a statistical list like stats.stackexchange.com and
ask for statistical counsel there.

-- Bert

On Tue, Apr 30, 2013 at 8:59 AM, Jeff Newmiller
jdnew...@dcn.davis.ca.us wrote:
 That is unlikely in the absence of a reproducible example [1].

 [1] 
 http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

 Havenga, BS, Mnr 15264...@sun.ac.za 15264...@sun.ac.za wrote:

Hi there

I am a Masters student at the University of Stellenbosch. I have been
using R to analyze the data, using the GLS model, of one of my
experiments.
The problem that I am having is that whenever I run my model using:
fit.glsmodel1-gls(Number~as.factor(Season)+as.factor(Depth)+as.factor(Orientation),
data=Number, weights=varPower(), method=ML)

I get the error:
Error in glsEstimate(object, control = control) :computed gls fit
is singular, rank 8

I would like to know if anyone can tell me what is causing this error.
Any advice will be much appreciated.

Kind regards
Brendan

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



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
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

2013-04-30 Thread Bert Gunter
Another alternative might be to post the the r-sig-mixed-models list
gls() is part of nlme.

-- Bert

On Tue, Apr 30, 2013 at 11:12 AM, Bert Gunter bgun...@gene.com wrote:
 Actually, Jeff, it may not be.

 The OP has likely overfit -- as a guess,  Depth is essentially
 continuous and as.factor() produces too many levels. I would recommend
 that the OP find a local statistical consultant to help him, as he
 seems out of his depth, statistically. Failing that, he should
 probably post to a statistical list like stats.stackexchange.com and
 ask for statistical counsel there.

 -- Bert

 On Tue, Apr 30, 2013 at 8:59 AM, Jeff Newmiller
 jdnew...@dcn.davis.ca.us wrote:
 That is unlikely in the absence of a reproducible example [1].

 [1] 
 http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

 Havenga, BS, Mnr 15264...@sun.ac.za 15264...@sun.ac.za wrote:

Hi there

I am a Masters student at the University of Stellenbosch. I have been
using R to analyze the data, using the GLS model, of one of my
experiments.
The problem that I am having is that whenever I run my model using:
fit.glsmodel1-gls(Number~as.factor(Season)+as.factor(Depth)+as.factor(Orientation),
data=Number, weights=varPower(), method=ML)

I get the error:
Error in glsEstimate(object, control = control) :computed gls fit
is singular, rank 8

I would like to know if anyone can tell me what is causing this error.
Any advice will be much appreciated.

Kind regards
Brendan

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



 --

 Bert Gunter
 Genentech Nonclinical Biostatistics

 Internal Contact Info:
 Phone: 467-7374
 Website:
 http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
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 sending question to the list

2013-04-06 Thread Jeff Newmiller
There is much wisdom in the Posting Guide mentioned in the footer of every 
email on this list. One pearl is the request to send your email in text format, 
not HTML. How you do this is specific to your email program, so we cannot help 
you, but Google is your friend.

As to your message, requests for help debugging long complicated algorithms is 
frowned upon here and are likely to be ignored. Don't ask us to do your work 
for you... isolate your problem to at most two dozen lines of code and include 
10-50 rows of sample data, and be specific about what is working and what is 
not.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  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.

Stat Tistician statisticiangerm...@gmail.com wrote:

Hi,
I tried to send several questions to the lists (both normal R and
R-Sig-Finance), but everytime I look them up in the archives my
messages
end up with the following

An embedded and charset-unspecified text was scrubbed...

for example see my post here:

https://stat.ethz.ch/pipermail/r-sig-finance/2013q2/011496.html


This one was a real important for me. Can subscribers still read it?
Shall
I repost, how can I post correctly?

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

2013-04-04 Thread Sarah Goslee
Hi,

 I have the same question as Harriet to sent it almost a year ago but could 
 not find a response.I want to run exploratory factor analysis and after 
 turning my data into a matrix I want to look at the stats. However I get this 
 error message One of your variables is a constant. Constants are disallowed 
 as part of a scale when using paf function.Any idea why?

Probably one of your variables is a constant.

You should probably check
summary(yourdata)
to find out what's wrong.

We can't provide much more help because of the lack of reproducible
example (or even context from the previous question). In particular,
turning my data into a matrix sounds potentially problematic. You
should also specify what the paf() function is, including where you
got it, as it doesn't seem to be part of base R.

Sarah


--
Sarah Goslee
http://www.functionaldiversity.org

__
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 dredge function (MuMIn package) with binary GLM

2013-04-01 Thread Cat Cowie
Hi all,

My replies within the forum aren't getting approved, though my emails
always go through, so here is my reply to a question I previously
posted (all questions and answers shown). Thanks, Cat


I'm having trouble with the model generating 'dredge' function in the MuMIn
'Multi-model Inference' package.

Here's the script:

globalmodel- glm(TB~lat+protocol+tested+
streams+goats+hay+cattle+deer,
family=binomial)
chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in
this global model.
models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
chat=chat, fixed=NULL, trace=FALSE)

And the error message is:

Error in UseMethod(logLik) :
  no applicable method for 'logLik' applied to an object of class logical

I have trawled the literature and it seems to be ok to use a binary GLM as
the global model - could this be the problem? The variables are a mix of
binary and continuous data.

Any thoughts?
Thanks,
Cat

__
[hidden email] 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.
Kamil Barton
Reply | Threaded | More
Mar 30, 2013; 9:48am

Re: Error message in dredge function (MuMIn package) used with binary GLM

2 posts
'rank' should be QAICc.
AICc does not have argument 'chat', hence the error.

kamil



CatCowie
Reply | Threaded | More
Mar 30, 2013; 10:35am

Re: Error message in dredge function (MuMIn package) used with binary GLM


Hi Kamil,

Thanks for your help. I do want to use rank=QAICc, but I when I try
it I get the following error message:

Error in get(as.character(FUN), mode = function, envir = envir) :
  object 'QAICc' of mode 'function' was not found

Do I need to install another package that would recognise this?

When I leave the script with rank=AICc (to see if it will run), and
having removed chat (which I put in after previously recieving an
error message about it being missing from the formula), I still get my
original error message:

Error in UseMethod(logLik) :
  no applicable method for 'logLik' applied to an object of class logical

Any further thoughts?
Thanks, Cat

__
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 dredge function (MuMIn package) used with binary GLM

2013-04-01 Thread Kamil Bartoń

Hi Cat,
are you using some very old version of MuMIn? That would explain the
missing 'QAICc'.
As for the error message about 'logLik', it usually occurs when there
are some misspelled arguments (that go into ... and are passed to the
rank function, 'AICc' in your case). Check if there is some argument (of
type logical) in your call to 'dredge' that is not its formal argument.

kamil

On 2013-03-30 03:13, cat.e.co...@gmail.com wrote:

Hi Kamil,

Thanks for your help. I do want to use rank=QAICc, but I when I try it I get 
the following error message:

Error in get(as.character(FUN), mode = function, envir = envir) :
   object 'QAICc' of mode 'function' was not found

Do I need to install another package that would recognise this?

When I leave the script with rank=AICc (to see if it will run), and having removed 
chat (which I put in after previously recieving an error message about it being missing 
from the formula), I still get my original error message:

Error in UseMethod(logLik) :
   no applicable method for 'logLik' applied to an object of class logical

Any further thoughts?
Thanks, Cat


quote author='Kamil Barton'
'rank' should be QAICc.
AICc does not have argument 'chat', hence the error.

kamil



Hi all,

I'm having trouble with the model generating 'dredge' function in the MuMIn
'Multi-model Inference' package.

Here's the script:

globalmodel- glm(TB~lat+protocol+tested+
streams+goats+hay+cattle+deer,
family=binomial)
chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in
this global model.
models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
chat=chat, fixed=NULL, trace=FALSE)

And the error message is:

Error in UseMethod(logLik) :
   no applicable method for 'logLik' applied to an object of class logical

I have trawled the literature and it seems to be ok to use a binary GLM as
the global model - could this be the problem? The variables are a mix of
binary and continuous data.

Any thoughts?
Thanks,
Cat


/quote
Quoted from:
http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html





The University of Aberdeen is a charity registered in Scotland, No SC013683.

__
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 dredge function (MuMIn package) used with binary GLM

2013-04-01 Thread CatCowie
Hi Kamil,

(I have replied to the forum but my posts as replies never seem to get
accepted, so here is the text in an email also. Apologies if it comes
through twice.)

Thanks so much for the prompt reply. You've solved it! Actually I had the
latest version of the package, but an older version of R that wasn't
supporting the package evidently... when I updated it everything ran with
the AICc rank. However, when I run it with QAICc (which i think Iwant
to use), R returns the error Error in chat  1 : 'chat' is missing and
does not conduct the dredge. My chat (variance inflation factor) is 0.597.
As this is 1, should I just rank by AICc? I still have a small sample size
necessitating AICc.

For interest, I can make the dredge run with rank=QAICc, but I need to
include the chat, and a error message then tells me In rank(x, chat =
0.597604265592854) : 'chat' given is  1, increased to 1. The script for
this is below:

##Information Theoretic Approach
globalmodel- glm(TB~lat+protocol+tested+streams+goats+hay+cattle+deer,
family=binomial)
chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in
this model.
models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=QAICc,
chat=chat, fixed=NULL, trace=FALSE)
models
warnings()

I think I will use just AICc, but do let me know if you think this is
wrong! Many thanks again for your help,
Cat


On 1 April 2013 22:19, Kamil Barton [via R] 
ml-node+s789695n4662958...@n4.nabble.com wrote:

 Hi Cat,
 are you using some very old version of MuMIn? That would explain the
 missing 'QAICc'.
 As for the error message about 'logLik', it usually occurs when there
 are some misspelled arguments (that go into ... and are passed to the
 rank function, 'AICc' in your case). Check if there is some argument (of
 type logical) in your call to 'dredge' that is not its formal argument.

 kamil

 On 2013-03-30 03:13, [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4662958i=0wrote:

  Hi Kamil,
 
  Thanks for your help. I do want to use rank=QAICc, but I when I try it
 I get the following error message:
 
  Error in get(as.character(FUN), mode = function, envir = envir) :
 object 'QAICc' of mode 'function' was not found
 
  Do I need to install another package that would recognise this?
 
  When I leave the script with rank=AICc (to see if it will run), and
 having removed chat (which I put in after previously recieving an error
 message about it being missing from the formula), I still get my original
 error message:
 
  Error in UseMethod(logLik) :
 no applicable method for 'logLik' applied to an object of class
 logical
 
  Any further thoughts?
  Thanks, Cat
 
 
  quote author='Kamil Barton'
  'rank' should be QAICc.
  AICc does not have argument 'chat', hence the error.
 
  kamil
 
 
 
  Hi all,
 
  I'm having trouble with the model generating 'dredge' function in the
 MuMIn
  'Multi-model Inference' package.
 
  Here's the script:
 
  globalmodel- glm(TB~lat+protocol+tested+
  streams+goats+hay+cattle+deer,
  family=binomial)
  chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom
 in
  this global model.
  models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
  chat=chat, fixed=NULL, trace=FALSE)
 
  And the error message is:
 
  Error in UseMethod(logLik) :
 no applicable method for 'logLik' applied to an object of class
 logical
 
  I have trawled the literature and it seems to be ok to use a binary GLM
 as
  the global model - could this be the problem? The variables are a mix of
  binary and continuous data.
 
  Any thoughts?
  Thanks,
  Cat
 
 
  /quote
  Quoted from:
 
 http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html
 



 The University of Aberdeen is a charity registered in Scotland, No
 SC013683.

 __
 [hidden email] http://user/SendEmail.jtp?type=nodenode=4662958i=1mailing 
 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.


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662958.html
  To unsubscribe from Error message in dredge function (MuMIn package) used
 with binary GLM, click 
 herehttp://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4662842code=Y2F0LmUuY293aWVAZ21haWwuY29tfDQ2NjI4NDJ8MTMyMDc2OTMxNw==
 .
 

Re: [R] Error message in dredge function (MuMIn package) used with binary GLM

2013-03-29 Thread Kamil Barton
'rank' should be QAICc. 
AICc does not have argument 'chat', hence the error.

kamil



CatCowie wrote
 Hi all,
 
 I'm having trouble with the model generating 'dredge' function in the
 MuMIn
 'Multi-model Inference' package.
 
 Here's the script:
 
 globalmodel- glm(TB~lat+protocol+tested+
 streams+goats+hay+cattle+deer,
 family=binomial)
 chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom
 in
 this global model.
 models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
 chat=chat, fixed=NULL, trace=FALSE)
 
 And the error message is:
 
 Error in UseMethod(logLik) :
   no applicable method for 'logLik' applied to an object of class
 logical
 
 I have trawled the literature and it seems to be ok to use a binary GLM as
 the global model - could this be the problem? The variables are a mix of
 binary and continuous data.
 
 Any thoughts?
 Thanks,
 Cat





--
View this message in context: 
http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html
Sent from the R help mailing list archive at Nabble.com.

__
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 installing package R package

2013-03-21 Thread Pramod Anugu
I am getting error messages while installing R package lme4. Please advice

thanks

Pramod

 

trying URL 'http://cran.mtu.edu/src/contrib/lme4_0.99-0.tar.gz'

Content type 'application/x-gzip' length 1074142 bytes (1.0 Mb)

opened URL

==

downloaded 1.0 Mb

 

* installing *source* package 'lme4' ...

** package 'lme4' successfully unpacked and MD5 sums checked

** libs

/share/apps/R-2.15.3/share/make/shlib.mk:6: warning: overriding commands for
target `lme4.so'

Makevars:7: warning: ignoring old commands for target `lme4.so'

gcc -std=gnu99 -I/share/apps/R-2.15.3/include -DNDEBUG  -I/usr/local/include
-I/share/apps/R-2.15.3/library/Matrix/include
-I/share/apps/R-2.15.3/library/stats/include   -fpic  -g -O2  -c init.c -o
init.o

gcc -std=gnu99 -I/share/apps/R-2.15.3/include -DNDEBUG  -I/usr/local/include
-I/share/apps/R-2.15.3/library/Matrix/include
-I/share/apps/R-2.15.3/library/stats/include   -fpic  -g -O2  -c lmer.c -o
lmer.o

gcc -std=gnu99 -I/share/apps/R-2.15.3/include -DNDEBUG  -I/usr/local/include
-I/share/apps/R-2.15.3/library/Matrix/include
-I/share/apps/R-2.15.3/library/stats/include   -fpic  -g -O2  -c
local_stubs.c -o local_stubs.o

gcc -std=gnu99 -shared -L/usr/local/lib64 -o lme4.so init.o lmer.o
local_stubs.o -L/share/apps/R-2.15.3/lib -lRlapack
-L/share/apps/R-2.15.3/lib -lRblas -lgfortran -lm

/usr/bin/ld: cannot find -lgfortran

collect2: ld returned 1 exit status

make: *** [lme4.so] Error 1

ERROR: compilation failed for package 'lme4'

* removing '/share/apps/R-2.15.3/library/lme4'

 

The downloaded source packages are in

'/tmp/RtmpcTIcHw/downloaded_packages'

Updating HTML index of packages in '.Library'

Making packages.html  ... done

Warning message:

In install.packages(lme4) :

  installation of package 'lme4' had non-zero exit status


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


  1   2   3   >