Re: [R] (no subject)

2023-01-26 Thread Hasan Diwan
Upananda.
On Mon, 16 Jan 2023 at 12:55, Upananda Pani  wrote:

> Greetings! I would like to know how to create the lag variable for my data.
>

Kindly provide a link to your data, on a publicly accessible page or a
means to generate fake data that illustrates your issue. -- H

-- 
OpenPGP: https://hasan.d8u.us/openpgp.asc
If you wish to request my time, please do so using
*bit.ly/hd1AppointmentRequest
*.
Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest
*.

Sent
from my mobile device
Envoye de mon portable

[[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] (no subject)

2023-01-16 Thread Upananda Pani
Dear Members,



Greetings! I would like to know how to create the lag variable for my data.



# Load data and create time series object 

oil <- read_xlsx("crudefinal.xlsx")



pricet=ts(oil$price, start = c(2020, 22), frequency = 365)

roilt=ts(diff(log(oil$price))*100,start=c(2020,22),freq=365)



# Fit MSW model 

roilt.lag0 = window(roilt,start=c(2020,23),end=c(2021,215),freq=365) # get
al the lags right

roilt.lag1 = window(roilt,start=c(2020,22),end=c(2021,214),freq=365)

roilt.lag2 = window(roilt,start=c(2020,20),end=c(2021,213),freq=365)

roilt.lag3 = window(roilt,start=c(2020,20),end=c(2021,212),freq=365)

roilt.lag4 = window(roilt,start=c(2020,19),end=c(2021,211),freq=365)



I am getting error (length is not matching), while creating lag. I will
grateful to you if you can tell me where  I am making mistakes.



Regards,

Upananda Pani

[[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] (no subject)

2022-11-25 Thread Ebert,Timothy Aaron
1) Any HTML content you intended to share did not make it past the filters. All 
I get is [[alternative HTML version deleted]
2) AIC is for comparing models where lower AIC indicates a better model, though 
please see a statistics reference for additional details. No models were 
presented.
3) Distributions have quantiles. Quantiles can be calculated from data. There 
is no quantile distribution. It would not be possible to calculate quantiles 
from a function that lacked other statistical attributes (mean, median, mode, 
variance, etc...). I cannot interpret "distribution have only quantile 
function."

Please clarify the question.
Tim

-Original Message-
From: R-help  On Behalf Of ASHLIN VARKEY
Sent: Friday, November 25, 2022 1:34 AM
To: r-help@r-project.org
Subject: [R] (no subject)

[External Email]

How to calculate AIC , when the distribution have only quantile function

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-helpdata=05%7C01%7Ctebert%40ufl.edu%7C1412d0c214ca47b72c3a08dacf42af21%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638050182572115235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=C26VbfYv6B8DJTUbgR2%2BvmlBZswHWYkDC50bG%2Bf0j5s%3Dreserved=0
PLEASE do read the posting guide 
https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.htmldata=05%7C01%7Ctebert%40ufl.edu%7C1412d0c214ca47b72c3a08dacf42af21%7C0d4da0f84a314d76ace60a62331e1b84%7C0%7C0%7C638050182572115235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7Csdata=zD4yMbhpaLGO8p4KUHSH8quKHFmkmtwSLptF55KLeWY%3Dreserved=0
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] (no subject)

2022-11-25 Thread ASHLIN VARKEY
How to calculate AIC , when the distribution have only quantile function

[[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] (no subject)

2022-11-07 Thread Ivan Krylov
On Sun, 6 Nov 2022 23:34:46 +
Nick Wray  wrote:

> Most of the sets work fine with MICE but with a few I get an error
> message:
> 
> This data set, which generated the error message has five columns
> 
> iter imp variable
>   1   1  986Error in terms.formula(tmp, simplify = TRUE) :
>   invalid term in model formula

Currently, there doesn't seem to be any issues [*] related to your
problem, so you could be the first to report it. (This does look like a
bug in mice; at the very least, the error message could be improved.)
How could the maintainer reproduce your problem in order to debug it?
[**]

traceback() and options(error = recover) are invaluable when trying to
find out what is going on before a crash (see ?traceback, ?recover and
?browser for more information; also the free book R Inferno [***]).

For example, if you set options(error = recover) and then reproduce the
crash, you'll be able to print(tmp) at the time of the crash and see
the term that terms.formula is having a problem with. The next step
would be finding out how this formula came to be, and so on.

>   [[alternative HTML version deleted]]

Please post in plain text to R mailing lists. This particular message
came through mostly fine, but in many cases, the plain text version
automatically generated by the sender's mailer from the user-composed
HTML version makes for very unpleasant reading.

-- 
Best regards,
Ivan

[*]
https://github.com/amices/mice/issues?q=invalid+term+in+model+formula

[**]
See also: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

[***]
https://www.burns-stat.com/documents/books/the-r-inferno/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2022-11-06 Thread Nick Wray
Hello - I am using the MICE package to impute missing values - the input
data are up to six vectors of parallel hourly temperature measurements for
Scottish weather stations across a calendar year. None of the vectors have
more than 5% NAs as I have filtered ones with more out.  Most of the sets
work fine with MICE but with a few I get an error message:

This data set, which generated the error message has five columns

iter imp variable
  1   1  986Error in terms.formula(tmp, simplify = TRUE) :
  invalid term in model formula


986 is the station number which is the column name here for the first
column.  The third to fifth columns don't have any NAs and the first and
second have fewer than 1% - but they do have the NAs concentrated as
strings of 20 or so near the beginning of the data set.

I am puzzled as to why certain datasets, which don't seem very different
from the others provoke the error message - the only thing which I am
wondering is whether MICE has a problem with a too large concentration of
the NAs in particular regions but I can't find any reference to this in the
literature.  Has anyone else come across this as a problem, and if so, what
did they do about it?  Thanks Nick Wray

[[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] (no subject)

2022-10-06 Thread Ivan Krylov
Hi Julie,

В Thu, 6 Oct 2022 10:58:51 -0400
Julie Coughlin  пишет:

> Can you send me a later version of r programming to use on my macos
> version 10.12.6? The newest r program is not compatible with my
> macbook.

Since R 4.0.0, the official builds of R require macOS ≥ 10.13. The
Homebrew project doesn't seem to have any binaries for 10.12 either,
but it should be able to build R for you:
https://formulae.brew.sh/formula/r#default

Alternatively, you can follow the guide at
https://cran.r-project.org/doc/manuals/r-release/R-admin.html and build
the source code yourself.

We have a special mailing list dedicated to Mac-related questions:
r-sig-...@r-project.org

-- 
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] (no subject)

2022-10-06 Thread Rui Barradas

Hello,

I am not a Mac user but have you tried the official R downloads web 
site, The Comprehensive R Archive Network - CRAN?

Here is the link:

https://cran.r-project.org/

Hope this helps,

Rui Barradas

Às 15:58 de 06/10/2022, Julie Coughlin escreveu:

Hi ,
Can you send me a later version of r programming to use on my macos version
10.12.6? The newest r program is not compatible with my macbook.
Thank you, Julie :)

[[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] (no subject)

2022-10-06 Thread Julie Coughlin
Hi ,
Can you send me a later version of r programming to use on my macos version
10.12.6? The newest r program is not compatible with my macbook.
Thank you, Julie :)

[[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] (no subject)

2022-05-05 Thread Avi Gross via R-help
I get suspicious about patterns. A similar request from a gmail account with 
another username was made just a day ago on a Python mailing list asking about 
learning that language. That user has not responded so far to anything people 
replied. 
Hopefully this is not yet another person getting their jollies by having others 
waste their time.
I now refuse to answer overly general requests that tell us nothing about the 
background of the person and are not really about more specific aspects of the 
language. As noted, there are plenty of free resources on the Internet in text 
form and even classes as well as free library books if you live in an area  
that has them and of course books and classes you can pay for. But what works 
for a person with zero programming experience is not what someone who knows 
multiple languages already needs and so on. 
I apologize if I am wrong and see patterns where there may be none. But unless 
a new semester is starting somewhere, why would we get such requests in early 
May?
I also note the request is not limited to R but programming in general. I don't 
volunteer.


-Original Message-
From: Jeff Newmiller 
To: r-help@r-project.org; Ariyan Khayer 
Sent: Thu, May 5, 2022 7:28 pm
Subject: Re: [R] (no subject)

Sigh. You _do_ have a source... the Internet.

But to get off the dime, try https://rstudio-education.github.io/hopr. Once you 
have some familiarity with basic programming concepts in R, do read the manuals 
that come with R when you install it... and for contributed packages, vignettes 
are particularly useful.

On May 4, 2022 11:30:20 AM PDT, Ariyan Khayer  wrote:
>Hello.i was interested in learning about programming.(Especially R) but I
>do not have any source to study and learn from.can you help me with that?
>
>    [[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.

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

[[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] (no subject)

2022-05-05 Thread Jeff Newmiller
Sigh. You _do_ have a source... the Internet.

But to get off the dime, try https://rstudio-education.github.io/hopr. Once you 
have some familiarity with basic programming concepts in R, do read the manuals 
that come with R when you install it... and for contributed packages, vignettes 
are particularly useful.

On May 4, 2022 11:30:20 AM PDT, Ariyan Khayer  wrote:
>Hello.i was interested in learning about programming.(Especially R) but I
>do not have any source to study and learn from.can you help me with that?
>
>   [[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.

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


[R] (no subject)

2022-05-05 Thread Ariyan Khayer
Hello.i was interested in learning about programming.(Especially R) but I
do not have any source to study and learn from.can you help me with that?

[[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] (no subject)

2021-11-09 Thread Arnaud FELD
Thanks for your answer. That is helpful even if that is disappointing
for me ;) I can see now that, as R (base and recommended packages) has
had contributions from a lot of people, it's not like a package, you
just can't have a punctual "okay do what you want". I'll have to stick
with a slow window call, I guess.

I was right to ask anyway, and thanks for your advices.

Le mar. 9 nov. 2021 à 22:51, Duncan Murdoch  a écrit :
>
> On 09/11/2021 3:52 p.m., Jeff Newmiller wrote:
> > I understand that, but the reason he gives for copying code from the stats 
> > package is to change the license. That decision seems like something that 
> > requires a very direct communication with/permission from the maintainer.
>
> The stats package doesn't give a valid maintainer() address.  It gives a
> vague reference to the r-project.org website, but that website doesn't
> give a contact address.
>
> In fact, the authorship of R is very widely distributed among at least
> dozens of contributors.  Identifying and contacting them all would be a
> nightmare but probably isn't necessary.  However, identifying and
> contacting the necessary ones (the ones who hold copyright on the parts
> he wants to copy) would be very difficult.  Not contacting the relevant
> ones would mean Arnaud's work would be potentially in violation of their
> copyright.
>
> Even if he did manage to contact all the copyright holders, some of them
> would probably not agree to more permissive licenses.  For example, I am
> a copyright holder on some parts of the source, and I wouldn't agree to
> relicensing.
>
> Duncan Murdoch
>
>
>
> >
> > On November 9, 2021 12:21:18 PM PST, Duncan Murdoch 
> >  wrote:
> >> On 09/11/2021 2:45 p.m., Jeff Newmiller wrote:
> >>> This question isn't a "how to do package development" question... this is 
> >>> about a specific package so you should send email to the package 
> >>> developer identified by the maintainer() function.
> >>
> >> I think Arnaud is the package developer; his question is whether he can
> >> copy R source into his package.
> >>
> >> Duncan Murdoch
> >>
> >>>
> >>> I can't foresee this request finding a positive response from R Core, but 
> >>> email seems the most correct approach.
> >>>
> >>> On November 9, 2021 11:34:12 AM PST, Bert Gunter  
> >>> wrote:
>  Questions about package development should be posted to
>  R-package-devel (**not R-devel**).
>  See https://www.r-project.org/mail.html  for details.
> 
>  (I am not sure that they get into legal weeds there, but it seems like
>  the right place to try).
> 
>  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 9, 2021 at 11:17 AM Arnaud FELD  
>  wrote:
> >
> > Hi,
> >
> > I use that mailing list because I’ve tried to send a message to the
> > r-core address and received :
> >
> >> "Non-members are typically *NOT* allowed to post messages to this
> >> private developers' list. Please use an appropriate mailing list (from
> >> http://www.r-project.org/mail.html). For R packages, use
> >> maintainer("") in R (and if that is R-core@.., use the R-help
> >> address).
> >
> >I would like to borrow most of the code of stats :: window within my
> > package disaggR, which has an uncompatible license as it is MIT not
> > GPL2. window has some extra overhead because of the calling of time()
> > at the beginning of the function (that is only used for extend =
> > FALSE). Copying the function and modifying it would allow me a bit of
> > optimization, but I need some agreement as my package is MIT.
> > Is it possible ?
> >
> > Thanks,
> >
> > Arnaud FELDMANN
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2021-11-09 Thread Duncan Murdoch

On 09/11/2021 3:52 p.m., Jeff Newmiller wrote:

I understand that, but the reason he gives for copying code from the stats 
package is to change the license. That decision seems like something that 
requires a very direct communication with/permission from the maintainer.


The stats package doesn't give a valid maintainer() address.  It gives a 
vague reference to the r-project.org website, but that website doesn't 
give a contact address.


In fact, the authorship of R is very widely distributed among at least 
dozens of contributors.  Identifying and contacting them all would be a 
nightmare but probably isn't necessary.  However, identifying and 
contacting the necessary ones (the ones who hold copyright on the parts 
he wants to copy) would be very difficult.  Not contacting the relevant 
ones would mean Arnaud's work would be potentially in violation of their 
copyright.


Even if he did manage to contact all the copyright holders, some of them 
would probably not agree to more permissive licenses.  For example, I am 
a copyright holder on some parts of the source, and I wouldn't agree to 
relicensing.


Duncan Murdoch





On November 9, 2021 12:21:18 PM PST, Duncan Murdoch  
wrote:

On 09/11/2021 2:45 p.m., Jeff Newmiller wrote:

This question isn't a "how to do package development" question... this is about 
a specific package so you should send email to the package developer identified by the 
maintainer() function.


I think Arnaud is the package developer; his question is whether he can
copy R source into his package.

Duncan Murdoch



I can't foresee this request finding a positive response from R Core, but email 
seems the most correct approach.

On November 9, 2021 11:34:12 AM PST, Bert Gunter  wrote:

Questions about package development should be posted to
R-package-devel (**not R-devel**).
See https://www.r-project.org/mail.html  for details.

(I am not sure that they get into legal weeds there, but it seems like
the right place to try).

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 9, 2021 at 11:17 AM Arnaud FELD  wrote:


Hi,

I use that mailing list because I’ve tried to send a message to the
r-core address and received :


"Non-members are typically *NOT* allowed to post messages to this
private developers' list. Please use an appropriate mailing list (from
http://www.r-project.org/mail.html). For R packages, use
maintainer("") in R (and if that is R-core@.., use the R-help
address).


   I would like to borrow most of the code of stats :: window within my
package disaggR, which has an uncompatible license as it is MIT not
GPL2. window has some extra overhead because of the calling of time()
at the beginning of the function (that is only used for extend =
FALSE). Copying the function and modifying it would allow me a bit of
optimization, but I need some agreement as my package is MIT.
Is it possible ?

Thanks,

Arnaud FELDMANN

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2021-11-09 Thread Jeff Newmiller
I understand that, but the reason he gives for copying code from the stats 
package is to change the license. That decision seems like something that 
requires a very direct communication with/permission from the maintainer.

On November 9, 2021 12:21:18 PM PST, Duncan Murdoch  
wrote:
>On 09/11/2021 2:45 p.m., Jeff Newmiller wrote:
>> This question isn't a "how to do package development" question... this is 
>> about a specific package so you should send email to the package developer 
>> identified by the maintainer() function.
>
>I think Arnaud is the package developer; his question is whether he can 
>copy R source into his package.
>
>Duncan Murdoch
>
>> 
>> I can't foresee this request finding a positive response from R Core, but 
>> email seems the most correct approach.
>> 
>> On November 9, 2021 11:34:12 AM PST, Bert Gunter  
>> wrote:
>>> Questions about package development should be posted to
>>> R-package-devel (**not R-devel**).
>>> See https://www.r-project.org/mail.html  for details.
>>>
>>> (I am not sure that they get into legal weeds there, but it seems like
>>> the right place to try).
>>>
>>> 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 9, 2021 at 11:17 AM Arnaud FELD  
>>> wrote:

 Hi,

 I use that mailing list because I’ve tried to send a message to the
 r-core address and received :

> "Non-members are typically *NOT* allowed to post messages to this
> private developers' list. Please use an appropriate mailing list (from
> http://www.r-project.org/mail.html). For R packages, use
> maintainer("") in R (and if that is R-core@.., use the R-help
> address).

   I would like to borrow most of the code of stats :: window within my
 package disaggR, which has an uncompatible license as it is MIT not
 GPL2. window has some extra overhead because of the calling of time()
 at the beginning of the function (that is only used for extend =
 FALSE). Copying the function and modifying it would allow me a bit of
 optimization, but I need some agreement as my package is MIT.
 Is it possible ?

 Thanks,

 Arnaud FELDMANN

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/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.
>> 
>

-- 
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] (no subject)

2021-11-09 Thread Duncan Murdoch

On 09/11/2021 2:45 p.m., Jeff Newmiller wrote:

This question isn't a "how to do package development" question... this is about 
a specific package so you should send email to the package developer identified by the 
maintainer() function.


I think Arnaud is the package developer; his question is whether he can 
copy R source into his package.


Duncan Murdoch



I can't foresee this request finding a positive response from R Core, but email 
seems the most correct approach.

On November 9, 2021 11:34:12 AM PST, Bert Gunter  wrote:

Questions about package development should be posted to
R-package-devel (**not R-devel**).
See https://www.r-project.org/mail.html  for details.

(I am not sure that they get into legal weeds there, but it seems like
the right place to try).

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 9, 2021 at 11:17 AM Arnaud FELD  wrote:


Hi,

I use that mailing list because I’ve tried to send a message to the
r-core address and received :


"Non-members are typically *NOT* allowed to post messages to this
private developers' list. Please use an appropriate mailing list (from
http://www.r-project.org/mail.html). For R packages, use
maintainer("") in R (and if that is R-core@.., use the R-help
address).


  I would like to borrow most of the code of stats :: window within my
package disaggR, which has an uncompatible license as it is MIT not
GPL2. window has some extra overhead because of the calling of time()
at the beginning of the function (that is only used for extend =
FALSE). Copying the function and modifying it would allow me a bit of
optimization, but I need some agreement as my package is MIT.
Is it possible ?

Thanks,

Arnaud FELDMANN

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2021-11-09 Thread Duncan Murdoch

On 09/11/2021 8:27 a.m., Arnaud FELD wrote:

Hi,

I use that mailing list because I’ve tried to send a message to the
r-core address and received :


"Non-members are typically *NOT* allowed to post messages to this
private developers' list. Please use an appropriate mailing list (from
http://www.r-project.org/mail.html). For R packages, use
maintainer("") in R (and if that is R-core@.., use the R-help
address).


  I would like to borrow most of the code of stats :: window within my
package disaggR, which has an uncompatible license as it is MIT not
GPL2. window has some extra overhead because of the calling of time()
at the beginning of the function (that is only used for extend =
FALSE). Copying the function and modifying it would allow me a bit of
optimization, but I need some agreement as my package is MIT.
Is it possible ?


I would assume not.  Most of R has many, many authors, and some of us 
will not agree to changing the license to a more permissive form.


Duncan Murdoch

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


Re: [R] (no subject)

2021-11-09 Thread Jeff Newmiller
This question isn't a "how to do package development" question... this is about 
a specific package so you should send email to the package developer identified 
by the maintainer() function.

I can't foresee this request finding a positive response from R Core, but email 
seems the most correct approach.

On November 9, 2021 11:34:12 AM PST, Bert Gunter  wrote:
>Questions about package development should be posted to
>R-package-devel (**not R-devel**).
>See https://www.r-project.org/mail.html  for details.
>
>(I am not sure that they get into legal weeds there, but it seems like
>the right place to try).
>
>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 9, 2021 at 11:17 AM Arnaud FELD  wrote:
>>
>> Hi,
>>
>> I use that mailing list because I’ve tried to send a message to the
>> r-core address and received :
>>
>> >"Non-members are typically *NOT* allowed to post messages to this
>> >private developers' list. Please use an appropriate mailing list (from
>> >http://www.r-project.org/mail.html). For R packages, use
>> >maintainer("") in R (and if that is R-core@.., use the R-help
>> >address).
>>
>>  I would like to borrow most of the code of stats :: window within my
>> package disaggR, which has an uncompatible license as it is MIT not
>> GPL2. window has some extra overhead because of the calling of time()
>> at the beginning of the function (that is only used for extend =
>> FALSE). Copying the function and modifying it would allow me a bit of
>> optimization, but I need some agreement as my package is MIT.
>> Is it possible ?
>>
>> Thanks,
>>
>> Arnaud FELDMANN
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/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.

-- 
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] (no subject)

2021-11-09 Thread Bert Gunter
Questions about package development should be posted to
R-package-devel (**not R-devel**).
See https://www.r-project.org/mail.html  for details.

(I am not sure that they get into legal weeds there, but it seems like
the right place to try).

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 9, 2021 at 11:17 AM Arnaud FELD  wrote:
>
> Hi,
>
> I use that mailing list because I’ve tried to send a message to the
> r-core address and received :
>
> >"Non-members are typically *NOT* allowed to post messages to this
> >private developers' list. Please use an appropriate mailing list (from
> >http://www.r-project.org/mail.html). For R packages, use
> >maintainer("") in R (and if that is R-core@.., use the R-help
> >address).
>
>  I would like to borrow most of the code of stats :: window within my
> package disaggR, which has an uncompatible license as it is MIT not
> GPL2. window has some extra overhead because of the calling of time()
> at the beginning of the function (that is only used for extend =
> FALSE). Copying the function and modifying it would allow me a bit of
> optimization, but I need some agreement as my package is MIT.
> Is it possible ?
>
> Thanks,
>
> Arnaud FELDMANN
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2021-11-09 Thread Arnaud FELD
Hi,

I use that mailing list because I’ve tried to send a message to the
r-core address and received :

>"Non-members are typically *NOT* allowed to post messages to this
>private developers' list. Please use an appropriate mailing list (from
>http://www.r-project.org/mail.html). For R packages, use
>maintainer("") in R (and if that is R-core@.., use the R-help
>address).

 I would like to borrow most of the code of stats :: window within my
package disaggR, which has an uncompatible license as it is MIT not
GPL2. window has some extra overhead because of the calling of time()
at the beginning of the function (that is only used for extend =
FALSE). Copying the function and modifying it would allow me a bit of
optimization, but I need some agreement as my package is MIT.
Is it possible ?

Thanks,

Arnaud FELDMANN

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2021-10-06 Thread Bert Gunter
Perhaps it's R packages and the security policies -- checks for malicious
software, etc. -- of the repositories on which they reside that Thomas
should be concerned with. R, itself, is fine(checksums are provided), but,
as you say, can be programmed to do anything. So R packages can certainly
do damage. For CRAN, at least, I believe it's download at your own risk.
Presumably, virus checking capabilities at the local level could check all
such downloads, as per usual.

Correction and clarification of any of the above welcome of course.

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, Oct 6, 2021 at 2:53 AM Ivan Krylov  wrote:

> On Tue, 5 Oct 2021 22:20:33 +
> Thomas Subia  wrote:
>
> > Some co-workers are wondering about how secure R software is.
>
> I'm afraid that this question is too hard to answer without their
> threat model. Secure against what, specifically?
>
> > Is there any documentation on this which I can forward to them?
>
> Well, R is a programming language. It's Turing-complete (see halting
> problem), will happily run machine code from shared objects (see
> dyn.load, .C, .Call), and install.packages() is there to download
> third-party code from the Internet. But that's the case with all
> programming languages I know that are used for statistics, which aren't
> supposed to run untrusted code.
>
> Maybe you're concerned about data input/output instead. Functions are
> first-class objects, so it's possible to save and load them from data
> files. Not sure if there's a way to run code on data load, but you can
> do it on print() (e.g. print.nls(x) calling x$m$getAllPars()), so don't
> load()/readRDS() untrusted data files. There are known bugs in the
> deserialiser, too: https://bugs.r-project.org/show_bug.cgi?id=16034
>
> Don't know if it's documented anywhere, though. What are your
> co-workers concerned about?
>
> --
> 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.
>

[[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] (no subject)

2021-10-06 Thread Ivan Krylov
On Tue, 5 Oct 2021 22:20:33 +
Thomas Subia  wrote:

> Some co-workers are wondering about how secure R software is.

I'm afraid that this question is too hard to answer without their
threat model. Secure against what, specifically?

> Is there any documentation on this which I can forward to them?

Well, R is a programming language. It's Turing-complete (see halting
problem), will happily run machine code from shared objects (see
dyn.load, .C, .Call), and install.packages() is there to download
third-party code from the Internet. But that's the case with all
programming languages I know that are used for statistics, which aren't
supposed to run untrusted code.

Maybe you're concerned about data input/output instead. Functions are
first-class objects, so it's possible to save and load them from data
files. Not sure if there's a way to run code on data load, but you can
do it on print() (e.g. print.nls(x) calling x$m$getAllPars()), so don't
load()/readRDS() untrusted data files. There are known bugs in the
deserialiser, too: https://bugs.r-project.org/show_bug.cgi?id=16034

Don't know if it's documented anywhere, though. What are your
co-workers concerned about?

-- 
Best regards,
Ivan

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


[R] (no subject)

2021-10-06 Thread Thomas Subia
Colleagues,

Some co-workers are wondering about how secure R software is. 
Is there any documentation on this which I can forward to them?


All the best,
Thomas Subia
Quality Engineer

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-12 01:14 +0500, Anas Jamshed wrote:
> On Sat, Dec 12, 2020 at 1:12 AM Rasmus Liland wrote:
> >
> > Anas Jamshed,
> >
> > I do not need to explain why I am tired
> > at all.  Not at all.
> 
> but plz try to help me

Once upon a midnight dreary, while I pondered, weak and weary,
Over many a quaint and curious volume of forgotten lore—
While I nodded, nearly napping, suddenly there came a tapping,
As of some one gently rapping, rapping at my chamber door.
“’Tis some visitor,” I muttered, “tapping at my chamber door—
Only this and nothing more.”

Ah, distinctly I remember it was in the bleak December;
And each separate dying ember wrought its ghost upon the floor.
Eagerly I wished the morrow;—vainly I had sought to borrow
From my books surcease of sorrow—sorrow for the lost Lenore—
For the rare and radiant maiden whom the angels name Lenore—
Nameless here for evermore.

And the silken, sad, uncertain rustling of each purple curtain
Thrilled me—filled me with fantastic terrors never felt before;
So that now, to still the beating of my heart, I stood repeating
“’Tis some visitor entreating entrance at my chamber door—
Some late visitor entreating entrance at my chamber door;—
This it is and nothing more.”

Presently my soul grew stronger; hesitating then no longer,
“Sir,” said I, “or Madam, truly your forgiveness I implore;
But the fact is I was napping, and so gently you came rapping,
And so faintly you came tapping, tapping at my chamber door,
That I scarce was sure I heard you”—here I opened wide the door;—
Darkness there and nothing more.

Deep into that darkness peering, long I stood there wondering, fearing,
Doubting, dreaming dreams no mortal ever dared to dream before;
But the silence was unbroken, and the stillness gave no token,
And the only word there spoken was the whispered word, “Lenore?”
This I whispered, and an echo murmured back the word, “Lenore!”—
Merely this and nothing more.

Back into the chamber turning, all my soul within me burning,
Soon again I heard a tapping somewhat louder than before.
“Surely,” said I, “surely that is something at my window lattice;
  Let me see, then, what thereat is, and this mystery explore—
Let my heart be still a moment and this mystery explore;—
’Tis the wind and nothing more!”

Open here I flung the shutter, when, with many a flirt and flutter,
In there stepped a stately Raven of the saintly days of yore;
Not the least obeisance made he; not a minute stopped or stayed he;
But, with mien of lord or lady, perched above my chamber door—
Perched upon a bust of Pallas just above my chamber door—
Perched, and sat, and nothing more.

Then this ebony bird beguiling my sad fancy into smiling,
By the grave and stern decorum of the countenance it wore,
“Though thy crest be shorn and shaven, thou,” I said, “art sure no craven,
Ghastly grim and ancient Raven wandering from the Nightly shore—
Tell me what thy lordly name is on the Night’s Plutonian shore!”
Quoth the Raven “Nevermore.”

Much I marvelled this ungainly fowl to hear discourse so plainly,
Though its answer little meaning—little relevancy bore;
For we cannot help agreeing that no living human being
Ever yet was blessed with seeing bird above his chamber door—
Bird or beast upon the sculptured bust above his chamber door,
With such name as “Nevermore.”

But the Raven, sitting lonely on the placid bust, spoke only
That one word, as if his soul in that one word he did outpour.
Nothing farther then he uttered—not a feather then he fluttered—
Till I scarcely more than muttered “Other friends have flown before—
On the morrow he will leave me, as my Hopes have flown before.”
Then the bird said “Nevermore.”

Startled at the stillness broken by reply so aptly spoken,
“Doubtless,” said I, “what it utters is its only stock and store
Caught from some unhappy master whom unmerciful Disaster
Followed fast and followed faster till his songs one burden bore—
Till the dirges of his Hope that melancholy burden bore
Of ‘Never—nevermore’.”

But the Raven still beguiling all my fancy into smiling,
Straight I wheeled a cushioned seat in front of bird, and bust and door;
Then, upon the velvet sinking, I betook myself to linking
Fancy unto fancy, thinking what this ominous bird of yore—
What this grim, ungainly, ghastly, gaunt, and ominous bird of yore
Meant in croaking “Nevermore.”

This I sat engaged in guessing, but no syllable expressing
To the fowl whose fiery eyes now burned into my bosom’s core;
This and more I sat divining, with my head at ease reclining
On the cushion’s velvet lining that the lamp-light gloated o’er,
But whose velvet-violet lining with the lamp-light gloating o’er,
She shall press, ah, nevermore!

Then, 

Re: [R] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-11 22:19 +0500, Anas Jamshed wrote:
> On Fri, Dec 11, 2020 at 10:17 PM Rasmus Liland wrote:
> >
> > Sorry, I think I am too tired atm.  I
> > took this pneumonia vaccine, and it
> > really banged me up you know ...
> >
> > Maybe someone else can row this ship
> > ashore again ...
> 
> why you are tired?

Anas Jamshed,

I do not need to explain why I am tired 
at all.  Not at all.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-11 22:09 +0500, Anas Jamshed wrote:
> On Fri, Dec 11, 2020 at 9:51 PM Rasmus Liland wrote:
> >
> > Say, how do I create fit3, eset, design,
> > etc. ...
> >
> > R
> 
> library(oligo)
> if (!requireNamespace("BiocManager", quietly = TRUE))
> install.packages("BiocManager")
> BiocManager::install("pd.hg.u133.plus.2")
> list.celfiles()
> setwd("C:/Users/USER/Desktop/RNA_Seq")
> list.celfiles()
> names = list.celfiles()
> array = read.celfiles(names)
> array
> eset = rma(array)
> write.exprs(eset, file = "data_normalized.txt") #this will be your
> normalized data by rma
> eset
> targets<-read.delim(file="targets.txt", header=T)
> targets<-read.delim(file="E-MTAB-5716.sdrf.txt", header=T)
> targets
> 
> eset <- eset[[idx]]
> 
> design <- model.matrix(~0+ eset)
> design
> fit <- lmFit(eset, design)
> fit
> 
> cont.matrix <- makeContrasts(eset, levels=design)
> fit2 <- contrasts.fit(fit, cont.matrix)
> fit2
> fit3 <- eBayes(fit2, 0.01)
> fit3
> tT <- topTable(fit3, adjust="fdr", sort.by="B", number=1250)
> tT

Sorry, I think I am too tired atm.  I 
took this pneumonia vaccine, and it 
really banged me up you know ...

Maybe someone else can row this ship 
ashore again ...

R

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-11 21:04 +0500, Anas Jamshed wrote:
> On Fri, Dec 11, 2020 at 9:03 PM Anas Jamshed wrote:
> > On Fri, Dec 11, 2020 at 8:37 PM Rasmus Liland wrote:
> > >
> > > I think that's too many unspecific lines
> > > and too large files directly here on
> > > email (24MiB!).
> > >
> > > Would you please narrow down your
> > > question.
> >
> > E-MTAB is an original sample data file and another one is normalized data
> > file  but I don't know why I get just one gene(up reg) when I apply top
> > table and decide test function
> > results<-decideTests(fit3,adjust.method="fdr",p=0.05)
> > results
> > summary(results)
> > cont.matrix <- makeContrasts(eset, levels=design)
> > fit.cont <- contrasts.fit(fit, cont.matrix)
> > fit.cont
> > fit.cont<- eBayes(fit.cont)
> > fit.cont
> > results<-decideTests(fit.cont,adjust.method="fdr",p=0.001)
> 
> [image: image.png]

Say, how do I create fit3, eset, design, 
etc. ...

R

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-11 20:14 +0500, Anas Jamshed wrote:
> On Fri, Dec 11, 2020 at 7:49 PM Rasmus Liland  wrote:
> 
> > On 2020-12-11 19:16 +0500, Anas Jamshed wrote:
> > > On Fri, Dec 11, 2020 at 6:37 PM Rasmus Liland wrote:
> > > > On 2020-12-11 18:08 +0500, Anas Jamshed wrote:
> > > > >
> > > >
> > > > Anas Jamshed,
> > > >
> > > > I found this
> > > >
> > > > https://support.bioconductor.org/p/130817/
> > > >
> > > > maybe it helps ...
> > >
> > > still have the problem in 2nd error
> > >
> > > > > Also when i tried to:
> > > > >
> > > > > #Load the target files which the information about the sample and
> > > > > their corresponding group by
> > > > >
> > > > > targets<-read.delim(file="targets.txt", header=T)and create design
> > and
> > > > > fit the design by
> > > > > design <- model.matrix(~0+ conditions)
> > > > >
> > > > > It gives me the error :
> > > > >
> > > > > Error in model.frame.default(object, data, xlev = xlev) :
> > > > >   invalid type (closure) for variable 'conditions'
> >
> > Glad my suggestion helped.
> >
> > Do state how you solved that for someone
> > else to find it another time (maybe
> > yourself even ... ).
> >
> > One problem at a time ... pocito pocito
> > ...
> >
> > Read here or something
> >
> > https://stackoverflow.com/questions/33023508/why-am-i-getting-the-error-invalid-type-closure
> > ...
> >
> > > https://postimg.cc/1fKPj1xg
> >
> > Right, it says the object is not a
> > matrix ... there is a flag there called
> > «data,» perhaps look into specifying you
> > matrix there ...
> >
> > It would be more helpful for me as a
> > helper if you stated your problem in a
> > small example code snippet, instead of
> > just the error.  I might lack the
> > sufficient amount of teaching emphathy
> > there to se clearly through images and
> > error messages from a distance.  E.g.
> > use dput to paste some small dataset
> > here ...
> >
> > R
> 
> E-MTAB is an original sample data file and another one is normalized data
> file  but I don't know why I get just one gene(up reg) when I apply top
> table and decide test function
> 
> My R history file is :
> library(oligo)
> if (!requireNamespace("BiocManager", quietly = TRUE))
> install.packages("BiocManager")
> BiocManager::install("pd.hg.u133.plus.2")
> list.celfiles()
> setwd("C:/Users/USER/Desktop/RNA_Seq")
> list.celfiles()
> names = list.celfiles()
> array = read.celfiles(names)
> array
> eset = rma(array)
> write.exprs(eset, file = "data_normalized.txt") #this will be your
> normalized data by rma
> eset
> targets<-read.delim(file="targets.txt", header=T)
> targets<-read.delim(file="E-MTAB-5716.sdrf.txt", header=T)
> targets
> design <- model.matrix(~0+ conditions)
> fit <- lmFit(eset, design)
> fit <- lmFit(eset, targets)
> design <- model.matrix(~ description + 0, gset)
> design
> fit <- lmFit(eset, design)
> targets$Source.Name <-fl
> targets$Source.Name <-fl
> targets$Source.Name <-f1
> sml <- paste("G", sml, sep="")
> targets$Source.Name
> design <- model.matrix(~ description + 0, eset)
> design <- model.matrix(~ targets + 0, eset)
> design <- model.matrix(~ targets + 0, conditions())
> design <- model.matrix(~ targets + 0, conditions)
> design <- model.matrix(~0+ conditions)
> design <- model.matrix(~ description + 0 + conditions)
> design <- model.matrix(~ description + 0 , conditions)
> design <- model.matrix(~ description + 0, gset)
> design <- model.matrix(~ description + 0, eset)
> design <- model.matrix(~ targets + 0, eset)
> targets$Source.Name
> design <- model.matrix(~ Source.Name + 0, eset)
> design <- model.matrix(~ Source + 0, eset)
> gset
> gset$description
> eset <- eset[[idx]]
> eset
> design <- model.matrix(~ description + 0, eset)
> fvarLabels(eset) <- make.names(fvarLabels(eset))
> gsms <- paste0("00XXX1",
> "11XXX")
> sml <- c()
> for (i in 1:nchar(gsms)) { sml[i] <- substr(gsms,i,i) }
> make.names()
> fvarLabels(eset) <- make.names(fvarLabels(eset))
> sel <- which(sml != "X")
> sml <- sml[sel]
> gset <- eset[ ,sel]
> eset
> design <- model.matrix(~0+ conditions)
> design <- model.matrix(~0+ eset)
> design
> fit <- lmFit(eset, design)
> fit
> contrast.matrix <- makeContrasts(group1=condition1-control,
> group2=condition2-control, levels = design)
> fit
> cont.matrix <- makeContrasts(G1-G0, levels=design)
> sml <- paste("G", sml, sep="")# set group names
> fl <- as.factor(sml)
> sml
> cont.matrix <- makeContrasts(G1-G0, levels=design)
> design
> gset
> design
> cont.matrix <- makeContrasts(eset, levels=design)
> fit2 <- contrasts.fit(fit, cont.matrix)
> fit2
> fit3 <- eBayes(fit2, 0.01)
> fit3
> tT <- topTable(fit3, adjust="fdr", sort.by="B", number=1250)
> tT
> tT <- topTable(fit3, adjust="fdr", sort.by="B", number=50)
> tT
> tT <- topTable(fit3, adjust="fdr", sort.by="B", number=50,p=0.05)
> tT
> fit.cont <- contrasts.fit(fit, contrast.matrix)
> fit.cont <- contrasts.fit(fit, contrast.matrix)
> fit.cont <- contrasts.fit(fit2, 

Re: [R] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-11 19:16 +0500, Anas Jamshed wrote:
> On Fri, Dec 11, 2020 at 6:37 PM Rasmus Liland wrote:
> > On 2020-12-11 18:08 +0500, Anas Jamshed wrote:
> > >
> >
> > Anas Jamshed,
> >
> > I found this
> >
> > https://support.bioconductor.org/p/130817/
> >
> > maybe it helps ...
> 
> still have the problem in 2nd error
> 
> > > Also when i tried to:
> > >
> > > #Load the target files which the information about the sample and
> > > their corresponding group by
> > >
> > > targets<-read.delim(file="targets.txt", header=T)and create design and
> > > fit the design by
> > > design <- model.matrix(~0+ conditions)
> > >
> > > It gives me the error :
> > >
> > > Error in model.frame.default(object, data, xlev = xlev) :
> > >   invalid type (closure) for variable 'conditions'

Glad my suggestion helped.  

Do state how you solved that for someone 
else to find it another time (maybe 
yourself even ... ).

One problem at a time ... pocito pocito 
... 

Read here or something 
https://stackoverflow.com/questions/33023508/why-am-i-getting-the-error-invalid-type-closure
...

> https://postimg.cc/1fKPj1xg

Right, it says the object is not a 
matrix ... there is a flag there called 
«data,» perhaps look into specifying you 
matrix there ... 

It would be more helpful for me as a 
helper if you stated your problem in a 
small example code snippet, instead of 
just the error.  I might lack the 
sufficient amount of teaching emphathy 
there to se clearly through images and 
error messages from a distance.  E.g. 
use dput to paste some small dataset 
here ... 

R

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2020-12-11 Thread Rasmus Liland
On 2020-12-11 18:08 +0500, Anas Jamshed wrote:
> when I tried to install oligo package by
> 
> if (!requireNamespace("BiocManager", quietly = TRUE))
> 
> install.packages("BiocManager")
> 
> BiocManager::install("oligo
> 
> It gives me the following eroor:
> 
> Warning messages:
> 1: In file.copy(savedcopy, lib, recursive = TRUE) :
>   problem copying
> C:\Users\USER\Documents\R\win-library\4.0\00LOCK\bit\libs\x64\bit.dll
> to C:\Users\USER\Documents\R\win-library\4.0\bit\libs\x64\bit.dll:
> Permission denied
> 2: In file.copy(savedcopy, lib, recursive = TRUE) :
>   problem copying
> C:\Users\USER\Documents\R\win-library\4.0\00LOCK\matrixStats\libs\x64\matrixStats.dll
> to 
> C:\Users\USER\Documents\R\win-library\4.0\matrixStats\libs\x64\matrixStats.dll:
> Permission denied
> 
> Also when i tried to:
> 
> #Load the target files which the information about the sample and
> their corresponding group by
> 
> targets<-read.delim(file="targets.txt", header=T)and create design and
> fit the design by
> design <- model.matrix(~0+ conditions)
> 
> It gives me the error :
> 
> Error in model.frame.default(object, data, xlev = xlev) :
>   invalid type (closure) for variable 'conditions'

Anas Jamshed,

I found this

https://support.bioconductor.org/p/130817/

maybe it helps ...

Best,
Rasmus Liland

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2020-12-11 Thread Anas Jamshed
when I tried to install oligo package by

if (!requireNamespace("BiocManager", quietly = TRUE))

install.packages("BiocManager")

BiocManager::install("oligo

It gives me the following eroor:

Warning messages:
1: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying
C:\Users\USER\Documents\R\win-library\4.0\00LOCK\bit\libs\x64\bit.dll
to C:\Users\USER\Documents\R\win-library\4.0\bit\libs\x64\bit.dll:
Permission denied
2: In file.copy(savedcopy, lib, recursive = TRUE) :
  problem copying
C:\Users\USER\Documents\R\win-library\4.0\00LOCK\matrixStats\libs\x64\matrixStats.dll
to 
C:\Users\USER\Documents\R\win-library\4.0\matrixStats\libs\x64\matrixStats.dll:
Permission denied

Also when i tried to:

#Load the target files which the information about the sample and
their corresponding group by

targets<-read.delim(file="targets.txt", header=T)and create design and
fit the design by
design <- model.matrix(~0+ conditions)

It gives me the error :

Error in model.frame.default(object, data, xlev = xlev) :
  invalid type (closure) for variable 'conditions'

[[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] (no subject)

2020-10-01 Thread Peter Dalgaard
Then please follow the link in the footer. Other recipients can't help you.


> On 1 Oct 2020, at 09:30 , Marte Lilleeng  wrote:
> 
> I want to unsubscribe from this list.
> 
> -- 
> Mvh Marte Synnøve Lilleeng
> tlf 97 74 38 12
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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

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


[R] (no subject)

2020-10-01 Thread Marte Lilleeng
I want to unsubscribe from this list.

-- 
Mvh Marte Synnøve Lilleeng
tlf 97 74 38 12

[[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] (no subject)

2020-06-05 Thread Aimin Yan
I want the stacked bar and its legend following the order as tr from
left to right like the following:

"100.0.250ng_CellLine_0" "75.25.250ng_CellLine_0"
"50.50.250ng_CellLine_0" "10.90.250ng_CellLine_0"
"1.99.250ng_CellLine_0" "0.100.250ng_CellLine_0"
"100.0.500ng_CellLine_0" "75.25.500ng_CellLine_0"
"50.50.500ng_CellLine_0" "10.90.500ng_CellLine_0"
"1.99.500ng_CellLine_0" "0.100.500ng_CellLine_0"

However, It seems the above code does not generate the stacked bar as this order

In addition, for '0.100.500ng_CellLine_0' in df, the order for gene
and color in stacked bar is not same as the order in df:



0.100.500ng_CellLine_0   ALYREF   1.5326986   red
  0.100.500ng_CellLine_0HCG18   1.5108475   #4C00FF
  0.100.500ng_CellLine_0RNU7-146P   0.9224286   #004CFF
  0.100.500ng_CellLine_0  ST3GAL3   0.8849696   #00E5FF
  0.100.500ng_CellLine_0 HSF1   0.8116123   #00FF4D
  0.100.500ng_CellLine_0   HP1BP3   0.7928828   #4DFF00
  0.100.500ng_CellLine_0 DAOA   0.7366942   #E6FF00
  0.100.500ng_CellLine_0CDK13   0.6898705   #00
  0.100.500ng_CellLine_0   PDXDC1   0.6805057   #FFDE59
  0.100.500ng_CellLine_0CKAP5   0.6477290   #FFE0B3
  0.100.500ng_CellLine_0   Others  90.7897612 lightgrey'

library(dplyr)
library(tidyverse)
library(ggnewscale)

df <- read.csv(text='"trt","gene","freq","cols"
 "100.0.250ng_CellLine_0","ALDH16A1",100,"red"
 "100.0.250ng_CellLine_0","Others",0,"lightgrey"
 "75.25.250ng_CellLine_0","ALDH16A1",64.6638014695688,"red"
 "75.25.250ng_CellLine_0","GBE1",2.0074864827395,"#4C00FF"
 "75.25.250ng_CellLine_0","ZNF598",1.5832524608346,"#004CFF"
 "75.25.250ng_CellLine_0","CHMP6",1.35033966449466,"#00E5FF"
 "75.25.250ng_CellLine_0","C20orf27",1.2033827810897,"#00FF4D"
 "75.25.250ng_CellLine_0","NEGR1",0.967697213364758,"#4DFF00"
 "75.25.250ng_CellLine_0","TNFAIP6",0.912241785664772,"#E6FF00"
 "75.25.250ng_CellLine_0","ZSCAN25",0.737557188409816,"#00"
 "75.25.250ng_CellLine_0","BCL2",0.684874532094829,"#FFDE59"
 "75.25.250ng_CellLine_0","CBL",0.676556217939831,"#FFE0B3"
 "75.25.250ng_CellLine_0","Others",25.2128102037987,"lightgrey"
 "50.50.250ng_CellLine_0","ALDH16A1",42.4503581203051,"red"
 "50.50.250ng_CellLine_0","ATF2",2.2360682428,"#4C00FF"
 "50.50.250ng_CellLine_0","DIAPH1",1.52565073079835,"#004CFF"
 "50.50.250ng_CellLine_0","SESTD1",1.20538053921854,"#00E5FF"
 "50.50.250ng_CellLine_0","TFCP2",1.15879578407966,"#00FF4D"
 "50.50.250ng_CellLine_0","SCAPER",1.1180341214,"#4DFF00"
 "50.50.250ng_CellLine_0","CUX1",1.03068770744774,"#E6FF00"
 "50.50.250ng_CellLine_0","TEX10",0.984102952308857,"#00"
 "50.50.250ng_CellLine_0","C6orf89",0.966633669131777,"#FFDE59"
 "50.50.250ng_CellLine_0","PTTG1IP",0.925872008385256,"#FFE0B3"
 "50.50.250ng_CellLine_0","Others",46.3984161183253,"lightgrey"
 "10.90.250ng_CellLine_0","ALDH16A1",4.68952007835455,"red"
 "10.90.250ng_CellLine_0","STK11",1.93143976493634,"#4C00FF"
 "10.90.250ng_CellLine_0","ERGIC2",1.46523016650343,"#004CFF"
 "10.90.250ng_CellLine_0","EFR3A",1.1126346718903,"#00E5FF"
 "10.90.250ng_CellLine_0","TMEM235",1.03819784524976,"#00FF4D"
 "10.90.250ng_CellLine_0","NGLY1",1.01469147894221,"#4DFF00"
 "10.90.250ng_CellLine_0","CNOT10",0.991185112634672,"#E6FF00"
 "10.90.250ng_CellLine_0","NPLOC4",0.983349657198825,"#00"
 "10.90.250ng_CellLine_0","GZMB",0.928501469147894,"#FFDE59"
 "10.90.250ng_CellLine_0","KIF2C",0.924583741429971,"#FFE0B3"
 "10.90.250ng_CellLine_0","Others",84.9206660137121,"lightgrey"
 "1.99.250ng_CellLine_0","DNAH1",2.36284289276808,"red"
 "1.99.250ng_CellLine_0","ALOX5AP",2.29426433915212,"#4C00FF"
 "1.99.250ng_CellLine_0","SEPT7",1.78304239401496,"#004CFF"
 "1.99.250ng_CellLine_0","TCF20",1.35910224438903,"#00E5FF"
 "1.99.250ng_CellLine_0","USP32",1.27805486284289,"#00FF4D"
 "1.99.250ng_CellLine_0","MUS81",1.24688279301746,"#4DFF00"
 "1.99.250ng_CellLine_0","CEP44",1.22817955112219,"#E6FF00"
 "1.99.250ng_CellLine_0","TMEM164",1.20324189526185,"#00"
 "1.99.250ng_CellLine_0","RAP1B",1.18453865336658,"#FFDE59"
 "1.99.250ng_CellLine_0","GSN",1.14713216957606,"#FFE0B3"
 

Re: [R] (no subject)

2020-05-14 Thread Ivan Krylov
Dear Luigi,

These questions (and your previous one about R on Chromebook) are best
directed to the R-SIG-Debian mailing list [*], or maybe Ubuntu forums
[**]. I think that they are off-topic here on R-help.

Here is a short advice: try to make sure that you have the
r-recommended package installed from CRAN, not Ubuntu repository. If
that doesn't help, try to raise the priority [***] of packages from the
CRAN repository in order to avoid them being superseded by Ubuntu
packages. Another workaround would be removing the *.deb kernsmooth and
nnet packages from the system and installing them manually from CRAN in
the personal library by means of install.packages().

>   [[alternative HTML version deleted]]

Please don't post in HTML (see link to posting guide below).

-- 
Best regards,
Ivan

[*] https://stat.ethz.ch/mailman/listinfo/r-sig-debian
[**] https://ubuntuforums.org/
[***] https://jaqque.sbih.org/kplug/apt-pinning.html

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


[R] (no subject)

2020-05-14 Thread Luigi Marongiu
Dear all,
I am trying to upgrade from ubuntu 19 to 20 but I got some R stuff that
stop the process:
```
$ apt list --upgradable
Listing... Done
r-cran-kernsmooth/xenial 2.23-15-3xenial0 amd64 [upgradable from:
2.23-15-3build2]
r-cran-nnet/xenial 7.3-12-2xenial0 amd64 [upgradable from: 7.3-12-2build2]
$ R --version
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
```
Since I have R 3.6 how can I remove or update these r-cran things?



-- 
Best regards,
Luigi

[[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] (no subject)

2020-03-08 Thread Eric Berger
I have no experience with these packages/libraries. I did a Google search
on 'R interface for G@RCH' and there seemed to be a number of relevant
hits, such as

https://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2009/G@RCH_info.txt


HTH,
Eric


On Sun, Mar 8, 2020 at 12:42 PM Jim Lemon  wrote:

> Hi Meryem,
> It seems that OxMetrics is the underlying environment for G@RCH and
> OxConsole (command line) is free for academic use.
> (https://www.doornik.com/products.html). A quick glance didn't reveal
> any interface for R.
>
> Jim
>
> On Sun, Mar 8, 2020 at 9:27 PM meryem khanniji
>  wrote:
> >
> > Hello to all  R users' , I need to get the Ox interface in R, can anyone
> > help me to know if the garchOxfit is still working .
> > Also i want to know if there is a way to get G@RCH package.
> > Thanks in advance
> >
> > [[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.
>

[[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] (no subject)

2020-03-08 Thread Jim Lemon
Hi Meryem,
It seems that OxMetrics is the underlying environment for G@RCH and
OxConsole (command line) is free for academic use.
(https://www.doornik.com/products.html). A quick glance didn't reveal
any interface for R.

Jim

On Sun, Mar 8, 2020 at 9:27 PM meryem khanniji
 wrote:
>
> Hello to all  R users' , I need to get the Ox interface in R, can anyone
> help me to know if the garchOxfit is still working .
> Also i want to know if there is a way to get G@RCH package.
> Thanks in advance
>
> [[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] (no subject)

2020-03-08 Thread meryem khanniji
Hello to all  R users' , I need to get the Ox interface in R, can anyone
help me to know if the garchOxfit is still working .
Also i want to know if there is a way to get G@RCH package.
Thanks in advance

[[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] (no subject)

2020-01-20 Thread Jeff Newmiller
Per the Posting Guide... stop sending HTML-formatted email to this mailing 
list. The formatting gets stripped out anyway and introduces confusion. Gmail 
_has_ this option, but you must specify it before you send the email.

Also, try to use Reply-all when discussing the same topic to keep related 
emails together.

On January 20, 2020 6:40:43 AM PST, Paul Bernal  wrote:
>Example of conversion to decimal of a signed binary number in two's
>complement representation
>
>Let's convert to decimal the following signed binary number: 10110010
>10110010 = -1×27 + 0×26 + 1×25 + 1×24 + 0×23 + 0×22 + 1×21 + 0×20 =
>-128 +
>32 + 16 + 2 = -78.
>
>that operation ilvoves base 2 raised to the 7th, 6th, 5th,  and 0th
>power. Only the first one has a minus one multiplying. The  first one
>is
>multiplied by a 2 raised to the seventh power because powers goe from
>right
>to left, starting from zero, all the way to the leftmost integer.
>
>Thank you so much for your valuable help,
>
>Cheers,
>
>Paul
>
>   [[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.

-- 
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] (no subject)

2020-01-20 Thread Jeff Newmiller
Per the Posting Guide... stop sending HTML-formatted email to this mailing 
list. The formatting gets stripped out anyway and introduces confusion. Gmail 
_has_ this option, but you must specify it before you send the email.

Also, try to use Reply-all when discussing the same topic to keep related 
emails together.

On January 20, 2020 6:40:43 AM PST, Paul Bernal  wrote:
>Example of conversion to decimal of a signed binary number in two's
>complement representation
>
>Let's convert to decimal the following signed binary number: 10110010
>10110010 = -1×27 + 0×26 + 1×25 + 1×24 + 0×23 + 0×22 + 1×21 + 0×20 =
>-128 +
>32 + 16 + 2 = -78.
>
>that operation ilvoves base 2 raised to the 7th, 6th, 5th,  and 0th
>power. Only the first one has a minus one multiplying. The  first one
>is
>multiplied by a 2 raised to the seventh power because powers goe from
>right
>to left, starting from zero, all the way to the leftmost integer.
>
>Thank you so much for your valuable help,
>
>Cheers,
>
>Paul
>
>   [[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.

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


[R] (no subject)

2020-01-20 Thread Paul Bernal
Example of conversion to decimal of a signed binary number in two's
complement representation

Let's convert to decimal the following signed binary number: 10110010
10110010 = -1×27 + 0×26 + 1×25 + 1×24 + 0×23 + 0×22 + 1×21 + 0×20 = -128 +
32 + 16 + 2 = -78.

that operation ilvoves base 2 raised to the 7th, 6th, 5th,  and 0th
power. Only the first one has a minus one multiplying. The  first one is
multiplied by a 2 raised to the seventh power because powers goe from right
to left, starting from zero, all the way to the leftmost integer.

Thank you so much for your valuable help,

Cheers,

Paul

[[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] (no subject)

2019-11-16 Thread imran damkar
I want to check if boot strapping can prove helpful in improving
homogeneity of variance. If it does so, I would like to perform hypothesis
testing on same transformed data( bootstrapped data),by using
non-parametric anova . How can I store new bootstrapped data set in data
frame? Data is 5 point  *likert* based. Respondents are from three
different organizations. Sample size of each group is *unequal*.  Please
help me how it can be done in R.

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] (no subject)

2019-11-05 Thread David Winsemius
This question is off-topic for rhelp despite your use of an R package 
because it is a request for advice for statistical issues, rather than 
about R coding. You should read the Posting guide where you are advised 
of this concern. You are also asked to post in plain text and include an 
informative subject line. There are other venues for statistical advice 
such as stats.stackexchange.com and there is also the possibility that 
the package author or maintainer might respond to a polite email.



--

David.

On 11/5/19 4:23 AM, imran damkar wrote:

Greetings,
I have collected the data based on 5 point likert scale(very low, low,
neutral, high,very high) on the factor considered by individual before
making investment decision. There are five factors (D.Vs) Influencing
investment decisions. I am interested in knowing whether there is
significant difference in preference level of male and female(IVs) for the
above said factors.Number of males are 252 and females 98. I have applied
Permutational Manova in adonis function of R, since data are ordinal in
nature, and result is non significant. I have read in literature that
permutation test is non parametric in nature. Does for the permutation test
equality of variance is highly important. Also the computation of mean, S.
D and variance are discouraged by many scholars for ordinal data.
Pls through some light of permutation test and it’s assumption and
violation of it. And if in case PERMANAVO is not suitable for my data then
please suggest appropriate alternative.
Shall be highly obliged.
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.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2019-11-05 Thread imran damkar
Greetings,
I have collected the data based on 5 point likert scale(very low, low,
neutral, high,very high) on the factor considered by individual before
making investment decision. There are five factors (D.Vs) Influencing
investment decisions. I am interested in knowing whether there is
significant difference in preference level of male and female(IVs) for the
above said factors.Number of males are 252 and females 98. I have applied
Permutational Manova in adonis function of R, since data are ordinal in
nature, and result is non significant. I have read in literature that
permutation test is non parametric in nature. Does for the permutation test
equality of variance is highly important. Also the computation of mean, S.
D and variance are discouraged by many scholars for ordinal data.
Pls through some light of permutation test and it’s assumption and
violation of it. And if in case PERMANAVO is not suitable for my data then
please suggest appropriate alternative.
Shall be highly obliged.
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] (no subject)

2019-11-04 Thread Kevin Thorpe
Have you read the help pages of the two functions? That is where I would start.

-- 
Kevin E. Thorpe
Head of Biostatistics,  Applied Health Research Centre (AHRC)
Li Ka Shing Knowledge Institute of St. Michael's
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: kevin.tho...@utoronto.ca  Tel: 416.864.5776  Fax: 416.864.3016
 

On 2019-11-04, 1:47 PM, "R-help on behalf of imran damkar" 
 wrote:

Hi,
I would like to know what is the difference between function oneway_test
and independence_test of coin package.
You will highly appreciated
Regards

[[alternative HTML version deleted]]

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


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2019-11-04 Thread imran damkar
Hi,
I would like to know what is the difference between function oneway_test
and independence_test of coin package.
You will highly appreciated
Regards

[[alternative HTML version deleted]]

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


[R] (no subject)

2019-09-05 Thread pusuluri madhu
Please unsubscribe me

-- 

*Madhu Pusuluri, Ph D*
*Visiting Scientist*
*Genomics & Trait discovery- Genetic Gains*

*International Crops Research Institute for the Semi-Arid Tropics (ICRISAT)*

*Patancheru, Hyderabad,  Telangana 502324, INDIA.*

*E-mail: **m.pusul...@cgiar.org **;
madhupusul...@gmail.com
*

*Tel: +91 9912241982.*

[[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] (no subject)

2019-08-05 Thread Mangalani Makananisa
Dear all,

I have been reading some documentations including Latent variable Modeling
using R and I am confronted with some challenges.  Could you please
direction/guidance me with the following problem?

If I am given continuous time series ‘quarterly data’ with three indicators
(Y1, Y2 and Y3) and 5 causal variables (X1, X2, . . ., X5) and assuming
one latent variable (F1). The observed variables are stationary at first
difference I(1).

How do i specify the model in lavaan() given that this is a time series
 quarterly data with  continuous variables only. I would like to see a
draft model specification in lavaan.

 Looking forward to hearing from you soon and I will give feedback.

Kind regards,

Peter

[[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] (no subject)

2019-04-30 Thread Haddison Mureithi
Hello guys this problem was never answered and I happened to come across
the same problem , kindly help. This is a simple R program that I have been
trying to run. I keep running into the "singular matrix" error. I end up
with no sensible results. Can anyone suggest any changes or a way around
this?

I am a total rookie when working with R.

Thanks,
Rasika

> library(survival)
Loading required package: splines
> args(coxph)
function (formula, data, weights, subset, na.action, init, control,
method = c("efron", "breslow", "exact"), singular.ok = TRUE,
robust = FALSE, model = FALSE, x = FALSE, y = TRUE, tt, ...)
NULL
> test1<-read.table("S:/FISHDO/03_Phase_I_Field_Work/Data_6_28_2011/Working
Folder/R_files/4SondesJuly24.csv", header=T, sep=",")
> sondes<-coxph(Surv(Start, Stop, Depart)~DOLoomis + DOI55 + DODamen,
data=test1)
Warning messages:
1: In fitter(X, Y, strats, offset, init, control, weights = weights,  :
  Loglik converged before variable  1,2 ; beta may be infinite.
2: In coxph(Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 + DODamen,  :
  X matrix deemed to be singular; variable 3
> summary(sondes)
Call:
coxph(formula = Surv(Start, Stop, Depart) ~ DOLoomis + DOI55 +
DODamen, data = test1)

  n= 1737, number of events= 58
   (1 observation deleted due to missingness)

   coef  exp(coef)   se(coef)  z Pr(>|z|)
DOLoomis -2.152e+00  1.163e-01  1.161e+05  01
DOI55 4.560e-01  1.578e+00  3.755e+04  01
DODamen  NA NA  0.000e+00 NA   NA

 exp(coef) exp(-coef) lower .95 upper .95
DOLoomis0.1163 8.5995 0   Inf
DOI55   1.5777 0.6338 0   Inf
DODamen NA NANANA

Concordance= 0.5  (se = 0 )
Rsquare= 0   (max possible= 0.01 )
Likelihood ratio test= 0  on 2 df,   p=1
Wald test= 0  on 2 df,   p=1
Score (logrank) test = 0  on 2 df,   p=1

[[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] (no subject)

2019-04-29 Thread mahboobe akhlaghi
Hello.
I have a question from kamila package. I run this package on my data and
the database is on SQL server. now, I have an error that I don't know what
should I do.
kamrespresc<-kamila(conVarsPresc,catVarsFacPresc,numClust=3,numInit=10)
Error in matrix(data = log(gtools::rdirichlet(n = numClust, alpha = rep(1,
:
  length of 'dimnames' [2] not equal to array extent
In addition: Warning message:
In runif(numClust, min = xx[1], max = xx[2]) : NAs produced
thanks.



-- 
Best Regards,
Mahboobe Akhlaghi
PhD Student in Biostatistics
Isfahan University of Medical Sciences

[[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] (no subject)

2019-04-24 Thread Mahnoor Malik



[[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] (no subject)

2019-04-23 Thread Abs Spurdle
Note that your post has no subject line.
I can't find it in my emails, which may explain why no one else has replied.

> fo<-h~a+b*log(dbh)+c*(log(dbh))^2+1.3

I'm assuming that you want to fit a model with three parameters, a, b and c.
This would be a linear model (linear in the parameters).
I'm going to ignore the +1.3 (because you don't need two intercepts),
but you can modify the following script if you want.

> I want to compute a nlm for each plot

So, three models?

How about this:
> r1 = lm (h ~ log (dbh) + I ( (log (dbh) ) ^ 2), data=ah 
> [ah$plot=="Sinca",])$coef
> r2 = lm (h ~ log (dbh) + I ( (log (dbh) ) ^ 2), data=ah 
> [ah$plot=="budeni",])$coef
> r3 = lm (h ~ log (dbh) + I ( (log (dbh) ) ^ 2), data=ah 
> [ah$plot=="Ceahlau",])$coef

> params = rbind (r1, r2, r3)
> rownames (params) = c ("Sinca", "budeni", "Ceahlau")
> colnames (params) = c ("a", "b", "c")

> params
 a b  c
Sinca-13.05110  5.657927   1.606357
budeni-2.11277  3.997636   1.104683
Ceahlau -135.57911 82.836952 -10.918932

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2019-04-18 Thread Catalin Roibu
Dear R users,

I want to compute a nlm for each plot an species and after that to save the
regression coef for each species and plot.
Thanks for your help!

I tried something like this

s<-data.frame(unique(ah$sp))
pl<-data.frame(unique(ah$plot))
z<-data.frame(matrix(nrow=0, ncol=5))

for(i in 1:nrow(pl)){
  t1<-filter(ah, plot==pl[i,1])
  for(j in 1:nrow(s)){
if (t1$sp==s[j,1]) {
  fo<-h~a+b*log(dbh)+c*(log(dbh))^2+1.3
  st1<-expand.grid(a = seq(-100, 100, len = 4),b = seq(-100, 100, len =
4), c = seq(-1, 1, len = 4))
  mo<-nls2(fo, data=t1,start =st1, control = nls.control(warnOnly =
TRUE))
  sumh<-summary(mo)
} else {
  NA
}
A<-data.frame(t(coef(mo)))
A$sp<-rep(s[j,1], nrow(A))
A$plot<-rep(pl[i,1], nrow(A))
z<-rbind(z, A)
plotfit(mo, smooth = TRUE)
  }
}

My data is: ah

plot no sp dbh h
Sinca 1 Br 47.25 42
Sinca 2 Br 17 12.1
Sinca 3 Br 7.5 5.7
Sinca 6 Br 19.25 17.9
Sinca 7 Br 16 12.5
Sinca 9 Br 20.75 15.7
Sinca 11 Br 24.25 23.8
Sinca 12 Br 6 4.6
Sinca 4 Fa 66.5 42.2
Sinca 10 Fa 80 37.3
Sinca 14 Fa 87.75 43.2
Sinca 15 Fa 11.25 9.2
Sinca 18 Fa 12.75 9.5
Sinca 20 Fa 13.25 13.9
Sinca 24 Fa 96 45.3
budeni 1 Fa 92 36.6
budeni 2 Fa 69 28.5
budeni 3 Fa 58.75 29.7
budeni 4 Fa 16.75 11.6
budeni 5 Fa 42.5 35.9
budeni 6 Fa 58.5 40.8
budeni 8 Fa 4 6.9
Ceahlau 215 Mo 33.5 21.9
Ceahlau 216 Mo 32 22.7
Ceahlau 217 Mo 29.5 18.7
Ceahlau 218 Mo 36.5 20.3
Ceahlau 220 Mo 43.5 21.6
Ceahlau 221 Mo 29 18
Ceahlau 222 Mo 25 20
Ceahlau 223 Mo 25 16.4
Ceahlau 224 Mo 35 20.1

-- 

-
-
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone  +4 0230 52 29 78, ext. 531
mobile phone+4 0745 53 18 01
FAX:+4 0230 52 16 64
silvic.usv.ro 


[image: Mailtrack]

Sender
notified by
Mailtrack

18.04.19,
15:56:09

[[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] (no subject)

2019-02-11 Thread Adrian Johnson
Pardon me, I forgot to add subject line.
-Adrian.

On Sun, Feb 10, 2019 at 3:49 PM Adrian Johnson
 wrote:
>
> Dear group,
>
> I have two large matrices.
>
> Matrix one: is 24776 x 76 (example toy1 dput object given below)
>
> Matrix two: is 12913 x 76 (example toy2 dput object given below)
>
> Column names of both matrices are identical.
>
> My aim is:
>
> a. Take each row of toy2 and transform vector into UP (>0)  and DN (
> <0 ) categories. (kc)
> b  Test association between kc and every row of toy1.
>
> My code, given below, although this works but is very slow.
>
> I gave dput objects for toy1, toy2 and result matrix.
>
> Could you suggest/help me how I can make this faster.  Also, how can I
> select values in result column that are less than 0.001 (p < 0.001).
>
> Appreciate your help. Thank you.
>
> Code:
> ===
>
>
>
> result <- matrix(NA,nrow=nrow(toy1),ncol=nrow(toy2))
>
> rownames(result) <- rownames(toy1)
> colnames(result) <- rownames(toy2)
>
> for(i in 1:nrow(toy2)){
> for(j in 1:nrow(toy1)){
> kx = toy2[i,]
> kc <- rep('NC',length(kx))
> kc[ kx >0] <- 'UP'
> kc[ kx <=0 ] <- 'DN'
> xpv <- fisher.test(table(kc,toy1[j,]),simulate.p.value = TRUE)$p.value
> result[j,i] <- xpv
> }
> }
>
> ===
>
>
> ===
>
>
> > dput(toy1)
> structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1,
> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
> -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
> -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1,
> -1, -1, -1, -1, -1), .Dim = c(10L, 7L), .Dimnames = list(c("ACAP3",
> "ACTRT2", "AGRN", "ANKRD65", "ATAD3A", "ATAD3B", "ATAD3C", "AURKAIP1",
> "B3GALT6", "C1orf159"), c("a", "b", "c", "d", "e", "f", "g")))
>
>
>
> > dput(toy2)
> structure(c(-0.242891119688613, -0.0514058216682132, 0.138447212993773,
> -0.312576648033122, 0.271489918720452, -0.281196468299486, 
> -0.0407160143344565,
> -0.328353812845287, 0.151667836674511, 0.408596843743938, -0.049351944902924,
> 0.238586287349249, 0.200571558784821, -0.0737604184858411, 0.245971526254877,
> 0.24740263959845, -0.161528943131908, 0.197521973013793, 0.0402668125708444,
> 0.376323735212088, 0.0731550871764204, 0.385270176969893, 0.28953042756208,
> 0.062587289401188, -0.281187168932979, -0.0202298984561554, 
> -0.0848696970309447,
> 0.0349676726358973, -0.520484215644868, -0.481991414222996,
> -0.00698099201388211,
> 0.135503878341873, 0.156983081312087, 0.320223832092661, 0.34582193394074,
> 0.0844455960468667, -0.157825604090972, 0.204758250510969, 0.261796072978612,
> -0.19510450641405, 0.43196474472874, -0.211155577453175, -0.0921641871215187,
> 0.420950361292263, 0.390261862151936, -0.422273930504427, 0.344653684951627,
> 0.0378273248838503, 0.197782027324611, 0.0963124876309569, 0.332093167080656,
> 0.128036554821915, -0.41338065859335, -0.409470440033177, 0.371490567256253,
> -0.0912549189140141, -0.247451812684234, 0.127741739114639, 
> 0.0856254238844557,
> 0.515282940316031, -0.25675759521248, 0.333943163209869, 0.604141413840881,
> 0.0824942299510931, -0.179605710473021, -0.275604207054643, 
> -0.113251154591898,
> 0.172897837449258, -0.329808795076691, -0.239255324324506), .Dim = c(10L,
> 7L), .Dimnames = list(c("chr5q23", "chr16q24", "chr8q24", "chr13q11",
> "chr7p21", "chr10q23", "chr13q13", "chr10q21", "chr1p13", "chrxp21"
> ), c("a", "b", "c", "d", "e", "f", "g")))
> >
>
>
> > dput(result)
> structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.532733633183408,
> 0.511244377811094, 0.528235882058971, 0.526736631684158, 0.51424287856072,
> 0.530734632683658, 0.513243378310845, 0.533233383308346, 0.542228885557221,
> 0.517241379310345, 0.532733633183408, 0.521739130434783, 0.529235382308846,
> 0.530234882558721, 0.548725637181409, 0.525737131434283, 0.527236381809095,
> 0.532733633183408, 0.530234882558721, 0.520739630184908, 0.15592203898051,
> 0.142928535732134, 0.140929535232384, 0.150924537731134, 0.160419790104948,
> 0.139430284857571, 0.152923538230885, 0.146426786606697, 0.149425287356322,
> 0.145427286356822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.282358820589705,
> 0.293853073463268, 0.262868565717141, 0.290854572713643, 0.276861569215392,
> 0.288855572213893, 0.282358820589705, 0.292853573213393, 0.286356821589205,
> 0.271364317841079, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
> 1, 1, 1, 1, 1, 1), .Dim = c(10L, 10L), .Dimnames = list(c("ACAP3",
> "ACTRT2", "AGRN", "ANKRD65", "ATAD3A", "ATAD3B", "ATAD3C", "AURKAIP1",
> "B3GALT6", "C1orf159"), c("chr5q23", "chr16q24", "chr8q24", "chr13q11",
> "chr7p21", "chr10q23", "chr13q13", "chr10q21", "chr1p13", "chrxp21"
> )))
>
>
> ===


[R] (no subject)

2019-02-10 Thread Adrian Johnson
Dear group,

I have two large matrices.

Matrix one: is 24776 x 76 (example toy1 dput object given below)

Matrix two: is 12913 x 76 (example toy2 dput object given below)

Column names of both matrices are identical.

My aim is:

a. Take each row of toy2 and transform vector into UP (>0)  and DN (
<0 ) categories. (kc)
b  Test association between kc and every row of toy1.

My code, given below, although this works but is very slow.

I gave dput objects for toy1, toy2 and result matrix.

Could you suggest/help me how I can make this faster.  Also, how can I
select values in result column that are less than 0.001 (p < 0.001).

Appreciate your help. Thank you.

Code:
===



result <- matrix(NA,nrow=nrow(toy1),ncol=nrow(toy2))

rownames(result) <- rownames(toy1)
colnames(result) <- rownames(toy2)

for(i in 1:nrow(toy2)){
for(j in 1:nrow(toy1)){
kx = toy2[i,]
kc <- rep('NC',length(kx))
kc[ kx >0] <- 'UP'
kc[ kx <=0 ] <- 'DN'
xpv <- fisher.test(table(kc,toy1[j,]),simulate.p.value = TRUE)$p.value
result[j,i] <- xpv
}
}

===


===


> dput(toy1)
structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1), .Dim = c(10L, 7L), .Dimnames = list(c("ACAP3",
"ACTRT2", "AGRN", "ANKRD65", "ATAD3A", "ATAD3B", "ATAD3C", "AURKAIP1",
"B3GALT6", "C1orf159"), c("a", "b", "c", "d", "e", "f", "g")))



> dput(toy2)
structure(c(-0.242891119688613, -0.0514058216682132, 0.138447212993773,
-0.312576648033122, 0.271489918720452, -0.281196468299486, -0.0407160143344565,
-0.328353812845287, 0.151667836674511, 0.408596843743938, -0.049351944902924,
0.238586287349249, 0.200571558784821, -0.0737604184858411, 0.245971526254877,
0.24740263959845, -0.161528943131908, 0.197521973013793, 0.0402668125708444,
0.376323735212088, 0.0731550871764204, 0.385270176969893, 0.28953042756208,
0.062587289401188, -0.281187168932979, -0.0202298984561554, -0.0848696970309447,
0.0349676726358973, -0.520484215644868, -0.481991414222996,
-0.00698099201388211,
0.135503878341873, 0.156983081312087, 0.320223832092661, 0.34582193394074,
0.0844455960468667, -0.157825604090972, 0.204758250510969, 0.261796072978612,
-0.19510450641405, 0.43196474472874, -0.211155577453175, -0.0921641871215187,
0.420950361292263, 0.390261862151936, -0.422273930504427, 0.344653684951627,
0.0378273248838503, 0.197782027324611, 0.0963124876309569, 0.332093167080656,
0.128036554821915, -0.41338065859335, -0.409470440033177, 0.371490567256253,
-0.0912549189140141, -0.247451812684234, 0.127741739114639, 0.0856254238844557,
0.515282940316031, -0.25675759521248, 0.333943163209869, 0.604141413840881,
0.0824942299510931, -0.179605710473021, -0.275604207054643, -0.113251154591898,
0.172897837449258, -0.329808795076691, -0.239255324324506), .Dim = c(10L,
7L), .Dimnames = list(c("chr5q23", "chr16q24", "chr8q24", "chr13q11",
"chr7p21", "chr10q23", "chr13q13", "chr10q21", "chr1p13", "chrxp21"
), c("a", "b", "c", "d", "e", "f", "g")))
>


> dput(result)
structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.532733633183408,
0.511244377811094, 0.528235882058971, 0.526736631684158, 0.51424287856072,
0.530734632683658, 0.513243378310845, 0.533233383308346, 0.542228885557221,
0.517241379310345, 0.532733633183408, 0.521739130434783, 0.529235382308846,
0.530234882558721, 0.548725637181409, 0.525737131434283, 0.527236381809095,
0.532733633183408, 0.530234882558721, 0.520739630184908, 0.15592203898051,
0.142928535732134, 0.140929535232384, 0.150924537731134, 0.160419790104948,
0.139430284857571, 0.152923538230885, 0.146426786606697, 0.149425287356322,
0.145427286356822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.282358820589705,
0.293853073463268, 0.262868565717141, 0.290854572713643, 0.276861569215392,
0.288855572213893, 0.282358820589705, 0.292853573213393, 0.286356821589205,
0.271364317841079, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1), .Dim = c(10L, 10L), .Dimnames = list(c("ACAP3",
"ACTRT2", "AGRN", "ANKRD65", "ATAD3A", "ATAD3B", "ATAD3C", "AURKAIP1",
"B3GALT6", "C1orf159"), c("chr5q23", "chr16q24", "chr8q24", "chr13q11",
"chr7p21", "chr10q23", "chr13q13", "chr10q21", "chr1p13", "chrxp21"
)))

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2019-02-10 Thread Hasan Diwan
This is spam, right? -- H

On Sun, 10 Feb 2019 at 12:36, Diego Miro  wrote:

> 4 xxx ff
>
> [[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.
>


-- 
OpenPGP:
https://sks-keyservers.net/pks/lookup?op=get=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using
*bit.ly/hd1AppointmentRequest
*.
Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest
*.

Sent
from my mobile device
Envoye de mon portable

[[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] (no subject)

2019-02-10 Thread Diego Miro
4 xxx ff

[[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] (no subject)

2019-02-03 Thread Rui Barradas

Hello,

It is just a guess but I bet that what the OP means is


f <- function(x) {
  2 + x^2 - x^3
}

uniroot(f, lower = 1, upper = 2)


To the OP: please learn how to write math in R *before* trying to solve 
problems.


Hope this helps,

Rui Barradas


Às 16:07 de 02/02/2019, Berend Hasselman escreveu:




On 1 Feb 2019, at 12:41, malika yassa via R-help  wrote:

Please, can you help me I have a equation to solve by newton method but I can 
not do it
for example

f<-function(x) {


2+X2-X3=0}
this equation have un solution in [1,2]
is there a function in R for solve it or i have to programme it



What is the relation between the function argument x and variables X2 and X3?

As it stands this is incomprehensible. The function argument x is not used 
anywhere in the function body.

Berend Hasselman





[[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] (no subject)

2019-02-02 Thread Berend Hasselman



> On 1 Feb 2019, at 12:41, malika yassa via R-help  wrote:
> 
> Please, can you help me I have a equation to solve by newton method but I can 
> not do it
> for example
> 
> f<-function(x) {
> 
> 
> 2+X2-X3=0}
> this equation have un solution in [1,2]
> is there a function in R for solve it or i have to programme it
> 

What is the relation between the function argument x and variables X2 and X3?

As it stands this is incomprehensible. The function argument x is not used 
anywhere in the function body.

Berend Hasselman

> 
> 
> 
>   [[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] (no subject)

2019-02-02 Thread Hasan Diwan
Look at the rootSolve package[1] for what you need. Hope it helps... -- H

On Sat, 2 Feb 2019 at 06:46, malika yassa via R-help 
wrote:

> Please, can you help me I have a equation to solve by newton method but I
> can not do it
> for example
>
> f<-function(x) {
>
>
> 2+X2-X3=0}
> this equation have un solution in [1,2]
> is there a function in R for solve it or i have to programme it
>
>
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
OpenPGP:
https://sks-keyservers.net/pks/lookup?op=get=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using
*bit.ly/hd1AppointmentRequest
*.
Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest
*.

Sent
from my mobile device
Envoye de mon portable

[[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] (no subject)

2019-02-02 Thread malika yassa via R-help
Please, can you help me I have a equation to solve by newton method but I can 
not do it
for example

f<-function(x) {


2+X2-X3=0}
this equation have un solution in [1,2]
is there a function in R for solve it or i have to programme it




[[alternative HTML version deleted]]

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


Re: [R] (no subject)

2019-01-10 Thread Bert Gunter
Please post on R-package-devel, not here. That list is specifically devoted
to such issues. This list is about R programming help.

-- 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 Thu, Jan 10, 2019 at 3:06 PM Sam Albers 
wrote:

> Hello all,
>
> I am experience some issues with building a package that we are
> hosting on GitHub. The package itself is quite large.  It is a data
> package with a bunch of spatial files stored as .rds files.
>
> The repo is located here: https://github.com/bcgov/bcmaps.rdata
>
> If we clone that package to local machine via:
> git clone https://github.com/bcgov/bcmaps.rdata
>
> The first oddity is that the package installs successfully using this:
>
> $ R CMD INSTALL "./bcmaps.rdata"
>
> But fails when I try to build the package:
>
> $ R CMD build "./bcmaps.rdata"
> * checking for file './bcmaps.rdata/DESCRIPTION' ... OK
> * preparing 'bcmaps.rdata':
> * checking DESCRIPTION meta-information ... OK
> * checking for LF line-endings in source and make files and shell scripts
> * checking for empty or unneeded directories
> * looking to see if a 'data/datalist' file should be added
> Warning in gzfile(file, "rb") :
>   cannot open compressed file 'bcmaps.rdata', probable reason
> 'Permission denied'
> Error in gzfile(file, "rb") : cannot open the connection
> Execution halted
>
>
> The second oddity is that if I remove the . from the Package name in
> the DESCRIPTION file, the build proceeds smoothly:
>
> $ R CMD build "./bcmaps.rdata"
> * checking for file './bcmaps.rdata/DESCRIPTION' ... OK
> * preparing 'bcmapsrdata':
> * checking DESCRIPTION meta-information ... OK
> * checking for LF line-endings in source and make files and shell scripts
> * checking for empty or unneeded directories
> * looking to see if a 'data/datalist' file should be added
> * building 'bcmapsrdata_0.2.0.tar.gz'
>
> I am assuming that R CMD install builds the package internally so I
> find it confusing that I am not able to build it myself. Similarly
> confusing is the lack of a . in the package name indicative of
> anything?
>
> Does anyone have any idea what's going on here? Am I missing something
> obvious?
>
> Thanks in advance,
>
> Sam
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2019-01-10 Thread Sam Albers
Hello all,

I am experience some issues with building a package that we are
hosting on GitHub. The package itself is quite large.  It is a data
package with a bunch of spatial files stored as .rds files.

The repo is located here: https://github.com/bcgov/bcmaps.rdata

If we clone that package to local machine via:
git clone https://github.com/bcgov/bcmaps.rdata

The first oddity is that the package installs successfully using this:

$ R CMD INSTALL "./bcmaps.rdata"

But fails when I try to build the package:

$ R CMD build "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmaps.rdata':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
Warning in gzfile(file, "rb") :
  cannot open compressed file 'bcmaps.rdata', probable reason
'Permission denied'
Error in gzfile(file, "rb") : cannot open the connection
Execution halted


The second oddity is that if I remove the . from the Package name in
the DESCRIPTION file, the build proceeds smoothly:

$ R CMD build "./bcmaps.rdata"
* checking for file './bcmaps.rdata/DESCRIPTION' ... OK
* preparing 'bcmapsrdata':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* looking to see if a 'data/datalist' file should be added
* building 'bcmapsrdata_0.2.0.tar.gz'

I am assuming that R CMD install builds the package internally so I
find it confusing that I am not able to build it myself. Similarly
confusing is the lack of a . in the package name indicative of
anything?

Does anyone have any idea what's going on here? Am I missing something obvious?

Thanks in advance,

Sam

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-12-03 Thread Jeremie Juste
Hello,

Can you provide more information?
What is your operating system?
What is your database management system (sqlite, mySQL,...)
What package do you use to import the data in R from the database?
What is the default language on your computer?
Are the variables not in farsi fine?

My guess is that Rstudion is a front end and have nothing to do with
your problem. But to be sure you can open R directly and check from there.

Some lines of codes would be helpful.

Best regards,
Jeremie




> Hi,
> I have a question about R Studio. I have a database in SQL. now, I combined
> SQL and R Studio. the levels of a variable is in farsi. so when I want to
> read some variables, in R Studio are "???" . I want to show them in
> farsi. what should I do to have right words in R Studio?
> Thanks.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-12-02 Thread Jeff Newmiller
It is possible that this is not an RStudio-specific issue in spite of the 
initial phrasing. 

Mahboobe:
If when you use Rgui (Windows) or R.app (Mac) or plain R at the command line 
(any OS) you still have problems, then you may need to ask for help here or in 
R-sig-mac or R-sig-debian or R-sig-fedora. Follow the recommendations in the 
Posting Guide to help your helper reproduce your problem without depending on 
RStudio. You should also describe what steps you have already tried... in 
particular read about Locales  and Encoding in the R Data Import/Export  and 
Installation/Administration manuals and describe what you have done to follow 
the advice given there.

FWIW I am an English-only speaker so have very limited experience with locales 
and encodings... be sure to direct your questions to whichever mailing list is 
most specific to your operating system rather than me.

Also, if it is RStudio-specific, there is a good RStudio blog post [1] you can 
start with.

[1] https://support.rstudio.com/hc/en-us/articles/200532197-Character-Encoding


On December 2, 2018 12:45:28 PM PST, Duncan Murdoch  
wrote:
>On 02/12/2018 6:51 AM, mahboobe akhlaghi wrote:
>> Hi,
>> I have a question about R Studio. I have a database in SQL. now, I
>combined
>> SQL and R Studio. the levels of a variable is in farsi. so when I
>want to
>> read some variables, in R Studio are "???" . I want to show them
>in
>> farsi. what should I do to have right words in R Studio?
>
>You'll probably need to contact RStudio support about this.  This 
>mailing list is about R; RStudio is a separate project that provides a 
>front end to R.
>
>When you contact them, let them know details about your system:  are
>you 
>running Windows?  What version?  What locale?
>
>Duncan Murdoch
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
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] (no subject)

2018-12-02 Thread Duncan Murdoch

On 02/12/2018 6:51 AM, mahboobe akhlaghi wrote:

Hi,
I have a question about R Studio. I have a database in SQL. now, I combined
SQL and R Studio. the levels of a variable is in farsi. so when I want to
read some variables, in R Studio are "???" . I want to show them in
farsi. what should I do to have right words in R Studio?


You'll probably need to contact RStudio support about this.  This 
mailing list is about R; RStudio is a separate project that provides a 
front end to R.


When you contact them, let them know details about your system:  are you 
running Windows?  What version?  What locale?


Duncan Murdoch

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


[R] (no subject)

2018-12-02 Thread mahboobe akhlaghi
Hi,
I have a question about R Studio. I have a database in SQL. now, I combined
SQL and R Studio. the levels of a variable is in farsi. so when I want to
read some variables, in R Studio are "???" . I want to show them in
farsi. what should I do to have right words in R Studio?
Thanks.

-- 
Best Regards,
Mahboobe Akhlaghi
PhD Student in Biostatistics
Isfahan University of Medical Sciences

[[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] (no subject)

2018-10-22 Thread PIKAL Petr
Hi

first of all few comments

Does your email client have subject line? If yes please use it, if not, change 
the client.
Please do not post in HTML, such emails have big chance to be scrambled.

# this gives you 10 random numbers
x<-rnorm(10,0,1)

f<-fuction(u,x)  {exp(x- u)}
# you probably ment
f<-function(u,x)  {exp(x- u)}

for(i in 1:lenght(x) integrate(f,lower=1,upper=4)
# you probably ment
for(i in 1:length(x)) integrate(f,lower=1,upper=4)
..^^...^
but this gives you an error
> for(i in 1:length(x)) integrate(f,lower=1,upper=4)
Error in f(x, ...) : argument "x" is missing, with no default

The error message comes from your f function as you did not defined u

If you changed your f function somehow
f<-function(x, u=2)  {exp(x - u)}
for(i in 1:length(x)) integrate(f,lower=1,upper=4)
the error is gone but so do results.

You need either print your results explicitly or to assign them to some object.

But if you printed your results you would find that you get same repeated 
result length(x) times.
> for(i in 1:length(x)) print(integrate(f,lower=1,upper=4))
7.021177 with absolute error < 7.8e-14
7.021177 with absolute error < 7.8e-14
7.021177 with absolute error < 7.8e-14
7.021177 with absolute error < 7.8e-14
7.021177 with absolute error < 7.8e-14

AFAIK, integrate computes area below curve defined by function f between lower 
and upper and it has nothing to do with your x definition.

So you should reconsider what do you want to achieve and if you have some time 
you should read some introduction document(s) to understand how R operates with 
objects. R Intro should be good starting point.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of malika yassa via R-
> help
> Sent: Saturday, October 20, 2018 3:04 PM
> To: r-help@r-project.org
> Subject: [R] (no subject)
>
> hello
> please you help mei have this functionx<-rnorm(10,0,1)f<-fuction(u,x)  
> {exp((x-
> u)}I want to calculate the integral of this function for each value of 
> x{for(i in
> 1:lenght(x)
> integrate(f,lower=1,upper=4)
>
> }but I can not find the vector of resulatwhere is the errorthinks
>
> [[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.
Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
partnerů PRECHEZA a.s. jsou zveřejněny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner’s personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-10-20 Thread Bert Gunter
Jeremie's suggestion of course will fail if some of the off-diagonal
elements are the same as those on the diagonals.

The request doesn't make a lot of sense to me, but if "m" is the matrix,

 m[row(z) != col(z)]

reliably extracts the vector of non-diagonal entries, which can then be
dimensioned as desired.
Or upper.tri() and lower.tri() can be used to separately extract the upper
and lower triangle entries via logical indexing.

Cheers,
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 Sat, Oct 20, 2018 at 8:48 AM Jeremie Juste 
wrote:

>
>
> Hello,
>
> Be sure to include the mailing list, when you
> reply. In this way to improve your chances of obtaining a good answer
> and everyone benefits.
>
>
> May be something like this ?
>
> aa <- matrix(1:9,3,3)
> matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],2,3)
>
>  [,1] [,2] [,3]
> [1,]247
> [2,]368
>
> Hope it helps,
>
> Jeremie
>
> malika yassa  writes:
>
> >  hellow
> > yes i want to extract the non-diagonal part
> > for exampl
> > i have this matrix  [,1] [,2] [,3]
> > [1,]147
> > [2,]258
> > [3,]369the result
> >
> >   [,1] [,2] [,3]
> > [1,]247
> > [2,]368
> >
> > Le samedi 20 octobre 2018 à 15:21:53 UTC+2, Jeremie Juste <
> jeremieju...@gmail.com> a écrit :
> >
> >  malika yassa via R-help  writes:
> >
> > Hello,
> >
> > Can you specify what you mean by deleting exactly?
> > Do you want to have zero in the diagonal or do you want to extract the
> > non-diagonal part?
> >
> > Besides your matrix is not a square matrix. Do you really want to
> > extract the non-diagonal part of a non square matrix?
> >
> > Best regards,
> >
> > Jeremie
> >
> >> hellowplease,do you help mei have this matrixm<-matrix(( 1:12, nrow = 3
> )
> >>
> >> I want to delete the diagonal values of this matrix
> >> can anyone do thisthinks
> >>
> >> [[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.
>

[[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] (no subject)

2018-10-20 Thread Jeremie Juste



Hello,

Be sure to include the mailing list, when you
reply. In this way to improve your chances of obtaining a good answer
and everyone benefits. 


May be something like this ?

aa <- matrix(1:9,3,3)
matrix(as.numeric(aa)[!as.numeric(aa) %in% diag(aa)],2,3)

 [,1] [,2] [,3]
[1,]247
[2,]368

Hope it helps,

Jeremie

malika yassa  writes:

>  hellow
> yes i want to extract the non-diagonal part 
> for exampl
> i have this matrix  [,1] [,2] [,3]
> [1,]    1    4    7
> [2,]    2    5    8
> [3,]    3    6    9the result 
>
>   [,1] [,2] [,3]
> [1,]    2    4    7
> [2,]    3    6    8
>
> Le samedi 20 octobre 2018 à 15:21:53 UTC+2, Jeremie Juste 
>  a écrit :  
>
>  malika yassa via R-help  writes:
>
> Hello,
>
> Can you specify what you mean by deleting exactly?
> Do you want to have zero in the diagonal or do you want to extract the
> non-diagonal part?
>
> Besides your matrix is not a square matrix. Do you really want to
> extract the non-diagonal part of a non square matrix?
>
> Best regards,
>
> Jeremie
>
>> hellowplease,do you help mei have this matrixm<-matrix(( 1:12, nrow = 3 )
>>
>> I want to delete the diagonal values of this matrix
>> can anyone do thisthinks 
>>
>>     [[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] (no subject)

2018-10-20 Thread Jeremie Juste
malika yassa via R-help  writes:

Hello,

Can you specify what you mean by deleting exactly?
Do you want to have zero in the diagonal or do you want to extract the
non-diagonal part?

Besides your matrix is not a square matrix. Do you really want to
extract the non-diagonal part of a non square matrix?


Best regards,

Jeremie






> hellowplease,do you help mei have this matrixm<-matrix(( 1:12, nrow = 3 )
>
> I want to delete the diagonal values of this matrix
> can anyone do thisthinks 
>
>   [[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] (no subject)

2018-10-20 Thread malika yassa via R-help
hello
please you help mei have this functionx<-rnorm(10,0,1)f<-fuction(u,x)  
{exp((x-u)}I want to calculate the integral of this function for each value of 
x{for(i in 1:lenght(x)
integrate(f,lower=1,upper=4) 

}but I can not find the vector of resulatwhere is the errorthinks

[[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] (no subject)

2018-10-20 Thread malika yassa via R-help
hellowplease,do you help mei have this matrixm<-matrix(( 1:12, nrow = 3 )

I want to delete the diagonal values of this matrix
can anyone do thisthinks 


[[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] (no subject)

2018-08-21 Thread jsebastiantello
hi R https://goo.gl/G8X41r

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-08-21 Thread Giuseppa Cefalu
Hello,

I have  a list of lists.  The lists in the list of lists are file names.  I
use lapply to read and merge the contents of each list in the list of lists
(3 merged contents in this case  which will be the content of 3 files).
Then, I  have to change the name of the 3 resulting files and finally I
have to write the contents of the files to each file.

 lc <- list("test.txt", "test.txt", "test.txt", "test.txt")
 lc1 <- list("test.txt", "test.txt", "test.txt")
 lc2 <- list("test.txt", "test.txt")
#list of lists.  The lists contain file names
 lc <- list(lc, lc1, lc2)
#new names for the three lists in the list of lists
 new_dataFns <- list("name1", "name2", "name3")
 file_paths <- NULL
 new_path <- NULL
#add the file names to the path and read and merge the contents of each
list in the list of lists
 lapply(
lc,
function(lc) {
 filenames <- file.path(dataFnsDir, lc)
 dataList= lapply(filenames, function (x) read.table(file=x,
header=TRUE))
 Reduce(function(x,y) merge(x,y), dataList)
 #   print(dataList)

}
  )

#add the new name of the file to the path total will be 3
paths/fille_newname.tsv.
 lapply(new_path, function(new_path){new_path <- file.path(getwd(),
new_dataFns)

The statements above work because lc and  new_dataFns are global and I can
pass them to the lapply function

#Finally, I need to write the merged contents to the corresponding file
(path/name.tsv).  I tried the following statement, but this does not work.
How can I write the content to each file? I was trying to use list <-
cbind(dataList, new_path) so that afterwards I can get the merged contents
and the file_name from the list and that way write each merged content to
the corresponding file, but it seems that the dataList and the newPath are
not global and the cbind() function does not work.

[[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] (no subject)

2018-08-07 Thread Jim Lemon
Hi malika,
You don't seem to have defined your functions correctly. For example:

H<-function(u,x1)

would define an empty function H if that command worked, but it doesn't

Jim


On Tue, Aug 7, 2018 at 3:51 PM, malika yassa via R-help
 wrote:
> hellothis is my programmeyou can help me, i cann't found a solution for H  
> and this  function i calculate for all value for x1thank you
>
>
> x<-rexp(N,2)
>
> z<-rnorm(0,1,n)
>
> g
> h=max(x)-min(x)
>
> n1=n^0.17
>
> h1=h/n1
>
> k=2
>
> x1<-seq(from=-2,to=2,by=0.1)
>
> s[i]=(x[i]+x[i+1])/2
>
> for(i in 1:N)
>
> fkS<-function(m,k){fkm=-m*(abs(Z-m)=k)-k*(Z-m<=-k)}
>
> k1<-function(u,x1){-1/(2*pi)exp((x1-u)/h1}
>
> for (i in 1:n)
>
> {k1(u,x1)=integrate(-1/(2*pi)exp((x1-u)/h1,lower=s[i-1],upper=s[i])}
>
>
>
>
>
> H<-function(u,x1)
>
> for (i in 1:n)
>
> {H(u,x1)=sum(g[i]*fkS*integrate(k1,lower=s[i-1],upper=s[i])
>
> }
>
>
> [[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] (no subject)

2018-08-06 Thread malika yassa via R-help
hellothis is my programmeyou can help me, i cann't found a solution for H  and 
this  function i calculate for all value for x1thank you 


x<-rexp(N,2)

z<-rnorm(0,1,n)

g=k)-k*(Z-m<=-k)}

k1<-function(u,x1){-1/(2*pi)exp((x1-u)/h1}

for (i in 1:n)

{k1(u,x1)=integrate(-1/(2*pi)exp((x1-u)/h1,lower=s[i-1],upper=s[i])}

 

 

H<-function(u,x1)

for (i in 1:n)

{H(u,x1)=sum(g[i]*fkS*integrate(k1,lower=s[i-1],upper=s[i])

}


[[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] (no subject)

2018-07-30 Thread Bert Gunter
How can one possibly answer this without knowing the structure of your
dataset?

-- 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 Mon, Jul 30, 2018 at 8:24 AM, Baojun Sun 
wrote:

> The book "Introduction to Statistical Learning" gives R scripts for its
> labs. I found a script for ridge regression that works on the dataset the
> book uses but is unusable on other datasets I own unless I clean the data.
>
>
> I'm trying to understand the syntax for I need for data cleaning and am
> stuck. I want to learn to do ridge regression. I tried using my own data
> set on this script rather than the book example but get errors. If you use
> your own data set rather than the Hitters dataset, then you'll get errors
> unless you format your code. How do I change this script or clean any
> dataset so that this script for ridge regression useable for all datasets?
>
>
> library(ISLR)
>
> fix(Hitters)
>
> names(Hitters)
>
> dim(Hitters)
>
> sum(is.na(Hitters$Salary))
>
> Hitters=na.omit(Hitters)
>
> dim(Hitters)
>
> sum(is.na(Hitters))
>
> library(leaps)
>
>
>
> x=model.matrix(Salary~.,Hitters)[,-1]
>
> y=Hitters$Salary
>
>
>
> # Ridge Regression
>
>
>
> library(glmnet)
>
> grid=10^seq(10,-2,length=100)
>
> ridge.mod=glmnet(x,y,alpha=0,lambda=grid)
>
> dim(coef(ridge.mod))
>
> ridge.mod$lambda[50]
>
> coef(ridge.mod)[,50]
>
> sqrt(sum(coef(ridge.mod)[-1,50]^2))
>
> ridge.mod$lambda[60]
>
> coef(ridge.mod)[,60]
>
> sqrt(sum(coef(ridge.mod)[-1,60]^2))
>
> predict(ridge.mod,s=50,type="coefficients")[1:20,]
>
> set.seed(1)
>
> train=sample(1:nrow(x), nrow(x)/2)
>
> test=(-train)
>
> y.test=y[test]
>
> ridge.mod=glmnet(x[train,],y[train],alpha=0,lambda=grid, thresh=1e-12)
>
> ridge.pred=predict(ridge.mod,s=4,newx=x[test,])
>
> mean((ridge.pred-y.test)^2)
>
> mean((mean(y[train])-y.test)^2)
>
> ridge.pred=predict(ridge.mod,s=1e10,newx=x[test,])
>
> mean((ridge.pred-y.test)^2)
>
> ridge.pred=predict(ridge.mod,s=0,newx=x[test,],exact=T)
>
> mean((ridge.pred-y.test)^2)
>
> lm(y~x, subset=train)
>
> predict(ridge.mod,s=0,exact=T,type="coefficients")[1:20,]
>
> set.seed(1)
>
> cv.out=cv.glmnet(x[train,],y[train],alpha=0)
>
> plot(cv.out)
>
> bestlam=cv.out$lambda.min
>
> bestlam
>
> ridge.pred=predict(ridge.mod,s=bestlam,newx=x[test,])
>
> mean((ridge.pred-y.test)^2)
>
> out=glmnet(x,y,alpha=0)
>
> predict(out,type="coefficients",s=bestlam)[1:20
>
> [[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] (no subject)

2018-07-30 Thread Baojun Sun
The book "Introduction to Statistical Learning" gives R scripts for its
labs. I found a script for ridge regression that works on the dataset the
book uses but is unusable on other datasets I own unless I clean the data.


I'm trying to understand the syntax for I need for data cleaning and am
stuck. I want to learn to do ridge regression. I tried using my own data
set on this script rather than the book example but get errors. If you use
your own data set rather than the Hitters dataset, then you'll get errors
unless you format your code. How do I change this script or clean any
dataset so that this script for ridge regression useable for all datasets?


library(ISLR)

fix(Hitters)

names(Hitters)

dim(Hitters)

sum(is.na(Hitters$Salary))

Hitters=na.omit(Hitters)

dim(Hitters)

sum(is.na(Hitters))

library(leaps)



x=model.matrix(Salary~.,Hitters)[,-1]

y=Hitters$Salary



# Ridge Regression



library(glmnet)

grid=10^seq(10,-2,length=100)

ridge.mod=glmnet(x,y,alpha=0,lambda=grid)

dim(coef(ridge.mod))

ridge.mod$lambda[50]

coef(ridge.mod)[,50]

sqrt(sum(coef(ridge.mod)[-1,50]^2))

ridge.mod$lambda[60]

coef(ridge.mod)[,60]

sqrt(sum(coef(ridge.mod)[-1,60]^2))

predict(ridge.mod,s=50,type="coefficients")[1:20,]

set.seed(1)

train=sample(1:nrow(x), nrow(x)/2)

test=(-train)

y.test=y[test]

ridge.mod=glmnet(x[train,],y[train],alpha=0,lambda=grid, thresh=1e-12)

ridge.pred=predict(ridge.mod,s=4,newx=x[test,])

mean((ridge.pred-y.test)^2)

mean((mean(y[train])-y.test)^2)

ridge.pred=predict(ridge.mod,s=1e10,newx=x[test,])

mean((ridge.pred-y.test)^2)

ridge.pred=predict(ridge.mod,s=0,newx=x[test,],exact=T)

mean((ridge.pred-y.test)^2)

lm(y~x, subset=train)

predict(ridge.mod,s=0,exact=T,type="coefficients")[1:20,]

set.seed(1)

cv.out=cv.glmnet(x[train,],y[train],alpha=0)

plot(cv.out)

bestlam=cv.out$lambda.min

bestlam

ridge.pred=predict(ridge.mod,s=bestlam,newx=x[test,])

mean((ridge.pred-y.test)^2)

out=glmnet(x,y,alpha=0)

predict(out,type="coefficients",s=bestlam)[1:20

[[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] (no subject)

2018-07-21 Thread Rui Barradas

Hello,

Please always write to r-help, not to me personally, even if I was able 
to be of assistance in the past.


As for your question, your code has several problems.

1) rowSums and colSums return vectors, not matrices. Even if they did, 
see point 3) below.


2) You define K = 0 then in

X[1]=1/(K*A[i,j]*c[1,1]+K*A[i,j]*c[1,2]+K*A[i,j]*c[1,3])

the denominator is zero because A[i,j] and c[] are multiplied by it.

3) What are the i,j in A[i,j] and P[i,j]?


Hope this helps,

Rui Barradas


Às 11:51 de 21-07-2018, Atanasio Alberto Tembe Tembe escreveu:

Dear Mr. Barradas,

Thank you for your attention.

Sorry for this personalized e-mail. I recently posted a query about 
while loop, but I did not get good feedback. I am a beginner in R and I 
wonder if you can me help again.


If I have two matrices such as: a<-matrix(1:9,nrow=3,ncol=3) and 
c<-matrix(1:9,nrow=3,ncol=3).


with defined variables:
K=0
A[i,j]=colSums(a)
P[i,j]=rowSums(a)
F[i,j]=c[i,j]^(-2 )
X[i]=A[i,j]*c[i,j]
X[j]=P[i,j]*c[i,j]

How to perform the following calculation with while loop so that it 
stops when a convergence between X and Y values is reached?.


X[1]=1/(K*A[i,j]*c[1,1]+K*A[i,j]*c[1,2]+K*A[i,j]*c[1,3])

Y[1]=1/(X[1]*P[i,j]*c[1,1]+[X1]*P[i,j]*c[1,2]+[X1]*P[i,j]*c[1,3])

X[2]=1/(Y[1]*A[i,j]*c[2,1]+Y[1]*A[i,j]*c[2,2]+Y[1]*A[i,j]*c[2,3])

Y[2]=1/(X[2]*P[i,j]*c[2,1]+X[2]*P[i,j]*c[2,2]+X[2]*P[i,j]*c[2,3])

X[3]=1/(Y[2]*A[i,j]*c[3,1]+Y[1]*A[i,j]*c[3,2]+Y[2]*A[i,j]*c[3,3])

Y[3]=1/(X[3]*P[3]*c[3,1]+X[3]*P[3]*c[3,2]+X[3]*P[3]*c[3,3])


Thank you very much.










On Mon, Jul 16, 2018 at 6:51 PM, Atanasio Alberto Tembe Tembe 
mailto:manote...@gmail.com>> wrote:


Hi Mr. Barradas,

Thank you for your kind support. I will your suggestions.

Best regards
Tembe


On Mon, Jul 16, 2018 at 6:22 PM, Rui Barradas mailto:ruipbarra...@sapo.pt>> wrote:

Hello,

Please repost in plain text, NO HTML formating.

Also, you are missing an open parenthesis right after while:

while( sum(abs(Sb-D-Sc-t(Pi))>1E-5)){


Hope this helps,

Rui Barradas


Às 14:25 de 15-07-2018, Atanasio Alberto Tembe Tembe escreveu:

Hello!

Is there anyone who can help me to this the error bellow? Ijust
started using R recently. Thank you


while sum(abs(Sb-D-Sc-t(Pi))>1E-5{Error: unexpected symbol
in "while
sum">     >     k=K+1>     >     for(i in 1:nrow(c1)){+ 
    +
     for(j in 1:ncol(c1)){+             +   
  if(Sb!=0){+

           +                 T2=D*T/Sa+                 +
}else {+                 +                 T2=0       +
   +             }+             +             Sc=sum(t(T))+
+             if(Sc!=0){+                 +
T3=Pi*T2/Sc+                 +             }else {+ 
        +

                 T3=0+                 +             }+
Sb=sum(T)+             +         }+     }>     >     K[1] 0

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




-- 
Atanasio Alberto Tembe (Mr)

Doctoral student
Graduate School of Urban Innovation
Transportation and Urban Engineering Laboratory
Yokohama National University
Tel: +81-(0)80-4605-1305 
  Mail: tembe-atanasio...@ynu.jp

manote...@gmail.com 




--
Atanasio Alberto Tembe (Mr)
Doctoral student
Graduate School of Urban Innovation
Transportation and Urban Engineering Laboratory
Yokohama National University
Tel: +81-(0)80-4605-1305 
  Mail: tembe-atanasio...@ynu.jp 
manote...@gmail.com 


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


Re: [R] (no subject)

2018-07-16 Thread Rui Barradas

Hello,

Please repost in plain text, NO HTML formating.

Also, you are missing an open parenthesis right after while:

while( sum(abs(Sb-D-Sc-t(Pi))>1E-5)){


Hope this helps,

Rui Barradas

Às 14:25 de 15-07-2018, Atanasio Alberto Tembe Tembe escreveu:

Hello!

Is there anyone who can help me to this the error bellow? Ijust
started using R recently. Thank you


while sum(abs(Sb-D-Sc-t(Pi))>1E-5{Error: unexpected symbol in "while
sum"> > k=K+1> > for(i in 1:nrow(c1)){+ +
for(j in 1:ncol(c1)){+ + if(Sb!=0){+
  + T2=D*T/Sa+ +
}else {+ + T2=0   +
  + }+ + Sc=sum(t(T))+
+ if(Sc!=0){+ +
T3=Pi*T2/Sc+ + }else {+ +
T3=0+ + }+
Sb=sum(T)+ + }+ }> > K[1] 0

[[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] (no subject)

2018-07-16 Thread Thierry Onkelinx
Dear Laura,

I came across the anipaths package
(https://cran.r-project.org/web/packages/anipaths/vignettes/anipaths.html)
It might be useful for you.

Best regards,


ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE
AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkel...@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///
To call in the statistician after the experiment is done may be no
more than asking him to perform a post-mortem examination: he may be
able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does
not ensure that a reasonable answer can be extracted from a given body
of data. ~ John Tukey
///




2018-07-09 14:13 GMT+02:00 Laura Steel :
> I am a beginner to R and I need to map some Atlantic puffin migration routes
> onto a map of the Northern Hemisphere. I have a latitude and longitude point
> per bird, per day. I would like to be able to plot the routes of all my
> birds on one map and ideally so that I can see at which date they are at
> each location.
>
> This is a shortened version of my data for one bird only.
>
> Bird Date  Latitude Longitude
> eb80976 16/07/2012  50.99   -5.85
> eb80976 17/07/2012  52.09   -4.58
> eb80976 18/07/2012  49.72   -5.56
> eb80976 19/07/2012  51.59   -3.17
> eb80976 20/07/2012  52.45   -2.03
> eb80976 21/07/2012  56.015  -10.51
>
> Any help would be much appreciated. I am not totally sure where to start!
> Many 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-07-15 Thread Jeff Newmiller
I think you are missing a parenthesis around your condition [1][2].

For future reference:
a) You should post the code you ran as well as the error message... it is 
unusual for the error message alone to be enough to figure out the problem. In 
fact, try to make a "reproducible example" [3][4][5]... you will increase your 
chances of getting an answer.
b) Your message was garbled... in some cases this can completely obscure your 
question. You can prevent that from happening by setting your email program to 
create a plain text email whenever you post here.
c) Remember to put a subject line on your email.

[1] https://stat.ethz.ch/R-manual/R-devel/library/base/html/Control.html
[2] 
https://www-r--bloggers-com.cdn.ampproject.org/v/s/www.r-bloggers.com/control-structures-loops-in-r/
[3] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

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

[5] https://cran.r-project.org/web/packages/reprex/index.html (read the 
vignette) 


On July 15, 2018 6:25:43 AM PDT, Atanasio Alberto Tembe Tembe 
 wrote:
>Hello!
>
>Is there anyone who can help me to this the error bellow? Ijust
>started using R recently. Thank you
>
>
>while sum(abs(Sb-D-Sc-t(Pi))>1E-5{Error: unexpected symbol in "while
>sum"> > k=K+1> > for(i in 1:nrow(c1)){+ +
>   for(j in 1:ncol(c1)){+ + if(Sb!=0){+
> + T2=D*T/Sa+ +
>}else {+ + T2=0   +
> + }+ + Sc=sum(t(T))+
>+ if(Sc!=0){+ +
>T3=Pi*T2/Sc+ + }else {+ +
>   T3=0+ + }+
>Sb=sum(T)+ + }+ }> > K[1] 0
>
>   [[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.

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


[R] (no subject)

2018-07-15 Thread Atanasio Alberto Tembe Tembe
Hello!

Is there anyone who can help me to this the error bellow? Ijust
started using R recently. Thank you


while sum(abs(Sb-D-Sc-t(Pi))>1E-5{Error: unexpected symbol in "while
sum"> > k=K+1> > for(i in 1:nrow(c1)){+ +
   for(j in 1:ncol(c1)){+ + if(Sb!=0){+
 + T2=D*T/Sa+ +
}else {+ + T2=0   +
 + }+ + Sc=sum(t(T))+
+ if(Sc!=0){+ +
T3=Pi*T2/Sc+ + }else {+ +
   T3=0+ + }+
Sb=sum(T)+ + }+ }> > K[1] 0

[[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] (no subject)

2018-07-15 Thread Nelson Sibanda via R-help
UNSCRIBE
[[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] (no subject)

2018-07-11 Thread MacQueen, Don via R-help
Maybe I missed it, but I didn't see anyone suggest a visit to the CRAN Spatial 
task view. This would be a good place to start learning how to work with 
spatial data in R.

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 7/9/18, 5:13 AM, "R-help on behalf of Laura Steel" 
 wrote:

I am a beginner to R and I need to map some Atlantic puffin migration routes
onto a map of the Northern Hemisphere. I have a latitude and longitude point
per bird, per day. I would like to be able to plot the routes of all my
birds on one map and ideally so that I can see at which date they are at
each location.

This is a shortened version of my data for one bird only.

Bird Date  Latitude Longitude
eb80976 16/07/2012  50.99   -5.85
eb80976 17/07/2012  52.09   -4.58
eb80976 18/07/2012  49.72   -5.56
eb80976 19/07/2012  51.59   -3.17
eb80976 20/07/2012  52.45   -2.03
eb80976 21/07/2012  56.015  -10.51

Any help would be much appreciated. I am not totally sure where to start!
Many 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.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-07-10 Thread Werning, Jan-Philipp

Hi,

thanks a lot! Now it works.

Yours

Jan

Am 10.07.2018 um 09:00 schrieb PIKAL Petr 
mailto:petr.pi...@precheza.cz>>:

Hi

see in line

-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Werning, Jan-
Philipp
Sent: Monday, July 9, 2018 9:42 PM
To: r-help@r-project.org<mailto:r-help@r-project.org>
Subject: [R] (no subject)

Dear all,


In the end I try to run a system dynamics simulation in R using the package
deSolve.
Therefore I need an auxiliary list (auxs) the model can refer to when it the
functions need an auxiliary value.

I used a manual list:

auxs <- c( aSplitSN=0.4 , aSplitLN=0.6, aSplitSR1=0 , aSplitLR1=1, aSplitSR2=0 ,
aSplitLR2=1, aSplitSR3=0 , aSplitLR3=1, aSalesNR=0.92, aSalesRR=0.08, […])

This is vector not list.
auxs <- c( aSplitSN=0.4 , aSplitLN=0.6, aSplitSR1=0 , aSplitLR1=1, aSplitSR2=0)
is.vector(auxs)
[1] TRUE
is.list(auxs)
[1] FALSE


this way everything worked well.

Now I want to use a matrix with different values for each of the auxiliaries in
order to run different scenarios. Therefore I created a csv document wich I read
in:

csv1  <- read.csv("180713_Taguchi Robust Design Test_180709_1745.csv", sep
= ";")

list_csv <- csv1[1,]

which is probably data frame

test<-vec[1,]
is.vector(test)
[1] FALSE
is.list(test)
[1] TRUE
is.data.frame(test)
[1] TRUE



namesauxs <- names(list_csv)

auxs1 <- as.numeric(list_csv)

names(auxs1) <- namesauxs

auxs <- auxs1


Looking at the global environment section in R studio, now both are the same,
in the value section as "Numed num"

I do not know rstudio but you could check two objects by
?identical


Yet, the model will not run using these values ultimately coming from the csv.

I wonder why do you use as.numeric in the first instance. You coud use

auxs1 <- unlist(csv1[1,])
and you should get named numeric vector. Maybe there are problems when reading 
numbers from csv file. You could check it e.g. by

str(auxs1)


What am I doing wrong here?

It would be great if you could help.

Thanks a lot in advance

Yours

Jan





[[alternative HTML version deleted]]

__
R-help@r-project.org<mailto:R-help@r-project.org> mailing list -- To 
UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
partnerů PRECHEZA a.s. jsou zveřejněny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner’s personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/



[[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] (no subject)

2018-07-10 Thread PIKAL Petr
Hi

see in line

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Werning, Jan-
> Philipp
> Sent: Monday, July 9, 2018 9:42 PM
> To: r-help@r-project.org
> Subject: [R] (no subject)
>
> Dear all,
>
>
> In the end I try to run a system dynamics simulation in R using the package
> deSolve.
> Therefore I need an auxiliary list (auxs) the model can refer to when it the
> functions need an auxiliary value.
>
> I used a manual list:
>
> auxs <- c( aSplitSN=0.4 , aSplitLN=0.6, aSplitSR1=0 , aSplitLR1=1, 
> aSplitSR2=0 ,
> aSplitLR2=1, aSplitSR3=0 , aSplitLR3=1, aSalesNR=0.92, aSalesRR=0.08, […])

This is vector not list.
> auxs <- c( aSplitSN=0.4 , aSplitLN=0.6, aSplitSR1=0 , aSplitLR1=1, 
> aSplitSR2=0)
> is.vector(auxs)
[1] TRUE
> is.list(auxs)
[1] FALSE
>
>
> this way everything worked well.
>
> Now I want to use a matrix with different values for each of the auxiliaries 
> in
> order to run different scenarios. Therefore I created a csv document wich I 
> read
> in:
>
> csv1  <- read.csv("180713_Taguchi Robust Design Test_180709_1745.csv", sep
> = ";")
>
> list_csv <- csv1[1,]

which is probably data frame

> test<-vec[1,]
> is.vector(test)
[1] FALSE
> is.list(test)
[1] TRUE
> is.data.frame(test)
[1] TRUE
>

>
> namesauxs <- names(list_csv)
>
>  auxs1 <- as.numeric(list_csv)
>
>  names(auxs1) <- namesauxs
>
>  auxs <- auxs1
>
>
> Looking at the global environment section in R studio, now both are the same,
> in the value section as "Numed num"

I do not know rstudio but you could check two objects by
?identical

>
> Yet, the model will not run using these values ultimately coming from the csv.

I wonder why do you use as.numeric in the first instance. You coud use

auxs1 <- unlist(csv1[1,])
and you should get named numeric vector. Maybe there are problems when reading 
numbers from csv file. You could check it e.g. by

str(auxs1)

>
> What am I doing wrong here?
>
> It would be great if you could help.
>
> Thanks a lot in advance
>
> Yours
>
> Jan
>
>
>
>
>
> [[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.
Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
partnerů PRECHEZA a.s. jsou zveřejněny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner’s personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-07-09 Thread Jim Lemon
Hi Laura,
Here's a basic method:

lsdf<-read.table(text="Bird Date Latitude Longitude
eb80976 16/07/2012  50.99   -5.85
eb80976 17/07/2012  52.09   -4.58
eb80976 18/07/2012  49.72   -5.56
eb80976 19/07/2012  51.59   -3.17
eb80976 20/07/2012  52.45   -2.03
eb80976 21/07/2012  56.015  -10.51",
header=TRUE)
library(maps)
map("world",xlim=c(-20,10),ylim=c(45,60))
mtext(side=3,cex=1.5,text="Migration of puffin eb80976",line=2)
lines(lsdf$Longitude,lsdf$Latitude)
library(plotrix)
boxed.labels(lsdf$Longitude,lsdf$Latitude,lsdf$Date,border="white",cex=0.7)
box()
axis(1)
axis(2)

Jim


On Mon, Jul 9, 2018 at 10:13 PM, Laura Steel  wrote:
> I am a beginner to R and I need to map some Atlantic puffin migration routes
> onto a map of the Northern Hemisphere. I have a latitude and longitude point
> per bird, per day. I would like to be able to plot the routes of all my
> birds on one map and ideally so that I can see at which date they are at
> each location.
>
> This is a shortened version of my data for one bird only.
>
> Bird Date  Latitude Longitude
> eb80976 16/07/2012  50.99   -5.85
> eb80976 17/07/2012  52.09   -4.58
> eb80976 18/07/2012  49.72   -5.56
> eb80976 19/07/2012  51.59   -3.17
> eb80976 20/07/2012  52.45   -2.03
> eb80976 21/07/2012  56.015  -10.51
>
> Any help would be much appreciated. I am not totally sure where to start!
> Many 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.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-07-09 Thread Jeff Newmiller
perhaps geom_path rather than geom_line?

On July 9, 2018 12:40:15 PM PDT, Hasan Diwan  wrote:
>https://imgur.com/a/0f72Fsz results from the following code:
>
>ggplot()+borders("world", colour="gray50",
>fill="gray50")+geom_line(aes(x=Longitude, y=Latitude), birds)
>
>It's ugly, but it will give you a starting point. -- H
>On Mon, 9 Jul 2018 at 10:53, Laura Steel 
>wrote:
>>
>> I am a beginner to R and I need to map some Atlantic puffin migration
>routes
>> onto a map of the Northern Hemisphere. I have a latitude and
>longitude point
>> per bird, per day. I would like to be able to plot the routes of all
>my
>> birds on one map and ideally so that I can see at which date they are
>at
>> each location.
>>
>> This is a shortened version of my data for one bird only.
>>
>> Bird Date  Latitude Longitude
>> eb80976 16/07/2012  50.99   -5.85
>> eb80976 17/07/2012  52.09   -4.58
>> eb80976 18/07/2012  49.72   -5.56
>> eb80976 19/07/2012  51.59   -3.17
>> eb80976 20/07/2012  52.45   -2.03
>> eb80976 21/07/2012  56.015  -10.51
>>
>> Any help would be much appreciated. I am not totally sure where to
>start!
>> Many 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.

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


[R] (no subject)

2018-07-09 Thread Werning, Jan-Philipp
Dear all,


In the end I try to run a system dynamics simulation in R using the package 
deSolve.
Therefore I need an auxiliary list (auxs) the model can refer to when it the 
functions need an auxiliary value.

I used a manual list:

auxs <- c( aSplitSN=0.4 , aSplitLN=0.6, aSplitSR1=0 , aSplitLR1=1, aSplitSR2=0 
, aSplitLR2=1, aSplitSR3=0 , aSplitLR3=1, aSalesNR=0.92, aSalesRR=0.08, […])

this way everything worked well.

Now I want to use a matrix with different values for each of the auxiliaries in 
order to run different scenarios. Therefore I created a csv document wich I 
read in:

csv1  <- read.csv("180713_Taguchi Robust Design Test_180709_1745.csv", sep = 
";")

list_csv <- csv1[1,]

namesauxs <- names(list_csv)

 auxs1 <- as.numeric(list_csv)

 names(auxs1) <- namesauxs

 auxs <- auxs1


Looking at the global environment section in R studio, now both are the same, 
in the value section as "Numed num"

Yet, the model will not run using these values ultimately coming from the csv.

What am I doing wrong here?

It would be great if you could help.

Thanks a lot in advance

Yours

Jan





[[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] (no subject)

2018-07-09 Thread Hasan Diwan
https://imgur.com/a/0f72Fsz results from the following code:

ggplot()+borders("world", colour="gray50",
fill="gray50")+geom_line(aes(x=Longitude, y=Latitude), birds)

It's ugly, but it will give you a starting point. -- H
On Mon, 9 Jul 2018 at 10:53, Laura Steel  wrote:
>
> I am a beginner to R and I need to map some Atlantic puffin migration routes
> onto a map of the Northern Hemisphere. I have a latitude and longitude point
> per bird, per day. I would like to be able to plot the routes of all my
> birds on one map and ideally so that I can see at which date they are at
> each location.
>
> This is a shortened version of my data for one bird only.
>
> Bird Date  Latitude Longitude
> eb80976 16/07/2012  50.99   -5.85
> eb80976 17/07/2012  52.09   -4.58
> eb80976 18/07/2012  49.72   -5.56
> eb80976 19/07/2012  51.59   -3.17
> eb80976 20/07/2012  52.45   -2.03
> eb80976 21/07/2012  56.015  -10.51
>
> Any help would be much appreciated. I am not totally sure where to start!
> Many 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.



-- 
OpenPGP: https://sks-keyservers.net/pks/lookup?op=get=0xFEBAD7FFD041BBA1
If you wish to request my time, please do so using bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a bit.ly/hd1AppointmentRequest.

Sent from my mobile device
Envoye de mon portable

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2018-07-09 Thread Bert Gunter
Laura:

1. We generally do not do code for you; we expect you to show your efforts
first.

2. You might want to post this on the r-sig-geo list instead. They
specialize in such issues, so that you are more likely to find helpful
advice there.

3. There are many good R tutorials on the web. e.g. see here:
https://www.rstudio.com/online-learning/
As a "beginner," if you have not already done so, you should avail yourself
of them before posting further.


Cheers,
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 Mon, Jul 9, 2018 at 11:03 AM, Dylan Distasio  wrote:

> You'll probably get a more detailed reply from someone with more expertise,
> but have you looked at something like what this article proposes:
>
> https://medium.com/fastah-project/a-quick-start-to-maps-in-r-b9f221f44ff3
>
> On Mon, Jul 9, 2018 at 1:53 PM Laura Steel 
> wrote:
>
> > I am a beginner to R and I need to map some Atlantic puffin migration
> > routes
> > onto a map of the Northern Hemisphere. I have a latitude and longitude
> > point
> > per bird, per day. I would like to be able to plot the routes of all my
> > birds on one map and ideally so that I can see at which date they are at
> > each location.
> >
> > This is a shortened version of my data for one bird only.
> >
> > Bird Date  Latitude Longitude
> > eb80976 16/07/2012  50.99   -5.85
> > eb80976 17/07/2012  52.09   -4.58
> > eb80976 18/07/2012  49.72   -5.56
> > eb80976 19/07/2012  51.59   -3.17
> > eb80976 20/07/2012  52.45   -2.03
> > eb80976 21/07/2012  56.015  -10.51
> >
> > Any help would be much appreciated. I am not totally sure where to start!
> > Many 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.
> >
>
> [[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] (no subject)

2018-07-09 Thread Dylan Distasio
You'll probably get a more detailed reply from someone with more expertise,
but have you looked at something like what this article proposes:

https://medium.com/fastah-project/a-quick-start-to-maps-in-r-b9f221f44ff3

On Mon, Jul 9, 2018 at 1:53 PM Laura Steel 
wrote:

> I am a beginner to R and I need to map some Atlantic puffin migration
> routes
> onto a map of the Northern Hemisphere. I have a latitude and longitude
> point
> per bird, per day. I would like to be able to plot the routes of all my
> birds on one map and ideally so that I can see at which date they are at
> each location.
>
> This is a shortened version of my data for one bird only.
>
> Bird Date  Latitude Longitude
> eb80976 16/07/2012  50.99   -5.85
> eb80976 17/07/2012  52.09   -4.58
> eb80976 18/07/2012  49.72   -5.56
> eb80976 19/07/2012  51.59   -3.17
> eb80976 20/07/2012  52.45   -2.03
> eb80976 21/07/2012  56.015  -10.51
>
> Any help would be much appreciated. I am not totally sure where to start!
> Many 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.
>

[[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] (no subject)

2018-07-09 Thread Laura Steel
I am a beginner to R and I need to map some Atlantic puffin migration routes
onto a map of the Northern Hemisphere. I have a latitude and longitude point
per bird, per day. I would like to be able to plot the routes of all my
birds on one map and ideally so that I can see at which date they are at
each location.

This is a shortened version of my data for one bird only.

Bird Date  Latitude Longitude
eb80976 16/07/2012  50.99   -5.85
eb80976 17/07/2012  52.09   -4.58
eb80976 18/07/2012  49.72   -5.56
eb80976 19/07/2012  51.59   -3.17
eb80976 20/07/2012  52.45   -2.03
eb80976 21/07/2012  56.015  -10.51

Any help would be much appreciated. I am not totally sure where to start!
Many 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.


[R] (no subject)

2018-05-14 Thread malika yassa via R-help
hello
> p(X ≤ V) diffetente zero
> look this
> Let X and V be two independent random variables with unknow
>  distribution functions (d.f.’s) F and G respectively. Under truncation from 
>the right we observe (X, Z) only if X ≤ Z
> I simulate X and Z and I use Lynden bell estimation
> I need now to calculate alpha =p(X ≤ V)but no p(X ≤ V)=0
>  

> > 
> > 
> > 
> > for exampl, i have this programme
> > # Generating data which are right truncated
> > library(DTDA)
> > library(splines)
> > library(survival)
> > n<-25
> > X<-runif(n,0,1)
> > V<-runif(n,0.75,1)
> > for (i in 1:n){
> > while (X[i]>V[i]){
> > X[i]<-runif(1,0,1)
> > V[i]<-runif(1,0.75,1)
> > }}
> > res<-lynden(X=X,U=NA, V=V, boot=TRUE)
> > attach(res)
> > temps = time
> > M_i = n.event
> > L_t = res
> > F_t=1-L_t                                    
> > par(mfrow=c(1,1))
> > plot(L_t$time,L_t$survival,type="s",lty=2:3,lwd=2,las=1,cex.lab=1.1,font.lab=2,col="red",xlab="temps",ylab="L(t)",
> 
> > main="Esitmation de la Fonction de Survie L(t)")

[[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] (no subject)

2018-05-13 Thread David Winsemius

> On May 13, 2018, at 9:35 AM, David Winsemius  wrote:
> 
> 
>> On May 12, 2018, at 9:42 AM, malika yassa via R-help  
>> wrote:
>> 
>> 
>> hello
>> for exampl, i have this programme
>> # Generating data which are right truncated
>> library(DTDA)
>> library(splines)
>> library(survival)
>> n<-25
>> X<-runif(n,0,1)
>> V<-runif(n,0.75,1)
>> for (i in 1:n){
>> while (X[i]>V[i]){
>> X[i]<-runif(1,0,1)
>> V[i]<-runif(1,0.75,1)
>> }}
>> res<-lynden(X=X,U=NA, V=V, boot=TRUE)
>> attach(res)
>> temps = time
>> M_i = n.event
>> L_t = res
>> F_t=1-L_t  
> 
>> F_t=1-L_t 
> Error in 1 - L_t : non-numeric argument to binary operator
> 
> L_t is a list. You cannot subtract a list (at least in R). I'm not sure what 
> you think F_t is supposed to be and you don't seem to use it. If you are 
> attempting to calculate the Hazard function, it's just:
> 
> str(L_t) # note the hazard component of that list.
> 
> res$hazard
> 
> [1] 0.03958 0.04121 0.04299 0.04492 0.04703 0.04935 0.05191 0.05476
> [9] 0.05793 0.06149 0.06552 0.07011 0.07540 0.08155 0.08879 0.09744
> [17] 0.10795 0.12102 0.13768 0.15966 0.19000 0.23457 0.30645 0.44186
> [25] 1.0
> 
> For some interpretations of your question, this may be what you are seeking. 
> It's the Pr( X > t )

 Wrong. It's Pr( X < t)

Sorry;
David.
> 
>> 
>> par(mfrow=c(1,1))
>> plot(L_t$time,L_t$survival,type="s",lty=2:3,lwd=2,las=1,cex.lab=1.1,font.lab=2,col="red",xlab="temps",ylab="L(t)",main="Esitmation
>>  de la Fonction de Survie L(t)")
>> 
>> 
>> i need to calculate the probability p(X>V)
> 
> As I see it the probability of X>V is:
> 
> sum(X > V)
> [1] 0
> 
> And I see this as a matter of definition. I'm guessing you wanted the 
> estimated Hazard. If I'm wrong, I wonder if you can rephrase the question so 
> it makes more sense to a general statistical audience. What is the subject 
> matter of the investigation?
> 
> 
> -- 
> David
>> 
>>   Le jeudi 10 mai 2018 à 17:15:06 UTC+2, John Kane  a 
>> écrit :  
>> 
>> We need some idea of the problem.
>> 
>> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>> 
>> 
>> http://adv-r.had.co.nz/Reproducibility.html
>> 
>> 
>> 
>>   On Thursday, May 10, 2018, 11:07:30 a.m. EDT, malika yassa via R-help 
>>  wrote:  
>> 
>> 
>> Hello 
>> 
>> Do You help me, i have the problem in the package DTDA for  find the 
>> probability of truncation  (alpha)
>> thank you
>> 
>>[[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.   
>>  [[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.

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] (no subject)

2018-05-13 Thread David Winsemius

> On May 12, 2018, at 9:42 AM, malika yassa via R-help  
> wrote:
> 
> 
> hello
> for exampl, i have this programme
> # Generating data which are right truncated
> library(DTDA)
> library(splines)
> library(survival)
> n<-25
> X<-runif(n,0,1)
> V<-runif(n,0.75,1)
> for (i in 1:n){
> while (X[i]>V[i]){
> X[i]<-runif(1,0,1)
> V[i]<-runif(1,0.75,1)
> }}
> res<-lynden(X=X,U=NA, V=V, boot=TRUE)
> attach(res)
> temps = time
> M_i = n.event
> L_t = res
> F_t=1-L_t  

> F_t=1-L_t 
Error in 1 - L_t : non-numeric argument to binary operator

L_t is a list. You cannot subtract a list (at least in R). I'm not sure what 
you think F_t is supposed to be and you don't seem to use it. If you are 
attempting to calculate the Hazard function, it's just:

str(L_t) # note the hazard component of that list.

 res$hazard

 [1] 0.03958 0.04121 0.04299 0.04492 0.04703 0.04935 0.05191 0.05476
 [9] 0.05793 0.06149 0.06552 0.07011 0.07540 0.08155 0.08879 0.09744
[17] 0.10795 0.12102 0.13768 0.15966 0.19000 0.23457 0.30645 0.44186
[25] 1.0

For some interpretations of your question, this may be what you are seeking. 
It's the Pr( X > t )

>   
> par(mfrow=c(1,1))
> plot(L_t$time,L_t$survival,type="s",lty=2:3,lwd=2,las=1,cex.lab=1.1,font.lab=2,col="red",xlab="temps",ylab="L(t)",main="Esitmation
>  de la Fonction de Survie L(t)")
> 
> 
> i need to calculate the probability p(X>V)

As I see it the probability of X>V is:

sum(X > V)
[1] 0

And I see this as a matter of definition. I'm guessing you wanted the estimated 
Hazard. If I'm wrong, I wonder if you can rephrase the question so it makes 
more sense to a general statistical audience. What is the subject matter of the 
investigation?


-- 
David
> 
>Le jeudi 10 mai 2018 à 17:15:06 UTC+2, John Kane  a 
> écrit :  
> 
> We need some idea of the problem.
> 
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
> 
> 
> http://adv-r.had.co.nz/Reproducibility.html
> 
> 
> 
>On Thursday, May 10, 2018, 11:07:30 a.m. EDT, malika yassa via R-help 
>  wrote:  
> 
> 
> Hello 
> 
> Do You help me, i have the problem in the package DTDA for  find the 
> probability of truncation  (alpha)
> thank you
> 
> [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.   
>   [[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] (no subject)

2018-05-12 Thread John Kane via R-help
 Thanks I think that may help but it is outside my small area of knowledge. 
With any luck, someone will be along soon to give some help.
Why are using attach(res)? I don't see the need.
Good luck.

On Saturday, May 12, 2018, 12:50:24 p.m. EDT, malika yassa 
 wrote:  
 
  
hello
for exampl, i have this programme
# Generating data which are right truncated
library(DTDA)
library(splines)
library(survival)
n<-25
X<-runif(n,0,1)
V<-runif(n,0.75,1)
for (i in 1:n){
while (X[i]>V[i]){
X[i]<-runif(1,0,1)
V[i]<-runif(1,0.75,1)
}}
res<-lynden(X=X,U=NA, V=V, boot=TRUE)
attach(res)
temps = time
M_i = n.event
L_t = res
F_t=1-L_t     
par(mfrow=c(1,1))
plot(L_t$time,L_t$survival,type="s",lty=2:3,lwd=2,las=1,cex.lab=1.1,font.lab=2,col="red",xlab="temps",ylab="L(t)",main="Esitmation
 de la Fonction de Survie L(t)")


i need to calculate the probability p(X>V)
Le jeudi 10 mai 2018 à 17:15:06 UTC+2, John Kane  a 
écrit :  
 
 We need some idea of the problem.

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


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

 

On Thursday, May 10, 2018, 11:07:30 a.m. EDT, malika yassa via R-help 
 wrote:  
 
 
Hello 

Do You help me, i have the problem in the package DTDA for  find the 
probability of truncation  (alpha)
thank you

    [[alternative HTML version deleted]]

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


  1   2   3   4   5   6   7   8   9   10   >