Re: [R] Help Required for R Markdown function.

2021-03-01 Thread Jeff Newmiller
It is standard for install.packages to download packages into a temporary 
directory before actually installing them. That message has been there for many 
many years every time you install a contributed package.

You have not provided a complete copy of the errors that were generated... I am 
certain something else happened that was in the output you failed to show us.

While I think RStudio is a fine tool, it does sometimes make non-trivial 
changes to standard outputs... I recommend that you try things in RGui or R 
from the command line (in this case the install.packages call) and describe 
them as such when asking for help here to reduce possible confusion as to where 
the problem is coming from. If it works in RGui but not in RStudio then you 
probably need to get help in their community forum.

Also, don't hijack conversation threads... start your own to ask a question, 
and reply to it as needed. Even changing the subject line doesn't disconnect 
your question from the original thread in the archive (or most email programs).

On February 28, 2021 2:04:52 PM PST, Avi Gross via R-help 
 wrote:
>I am sure you can get more done with a caret than a stick. I need a
>stick for another problem, though.
>
>A serious question. I somehow upset my R/RSTUDIO setup while trying to
>see why a markdown only allowed me to save an HTML version, not PDF and
>DOC as it used to. It now fails on any such document with a code that
>indicates it is not set to find a CRAN mirror:
>
>It seems to be upset by a simple call to get the tidyverse loaded and
>may succeed in one sense but not continue:
>
>" Installing package into
>�C:/Users/avid2016/Documents/R/win-library/4.0�
>(as �lib� is unspecified)
>trying URL
>'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip'
>Content type 'application/zip' length 439972 bytes (429 KB)
>downloaded 429 KB
>
>package ‘tidyverse’ successfully unpacked and MD5 sums checked
>..."
>
>The R Markdown lower console window says:
>
>"Error in contrib.url(repos, "source") : trying to use CRAN without
>setting a mirror calls  ...
>withVisible -> eval -> eval install.packages -> contrib.url Exection
>halted"
>
>I have done some work that failed. I am running on windows with the
>latest versions of both R and RSTUDIO after removing all old versions
>and re-installing both. I have seen hints I need to set some
>definitions in a .Rprofile or so and tried but it continues to fail. So
>I now can knit nothing!
>
>Anyone have a pointer on problems like this? My next attempt would be
>to reinstall the programs on another hard disk entirely in case the
>problem is in my folder structure of ~/R and below but I dod not want
>to toss years of work because of one errant configuration file or the
>lack thereof.
>
>Thanks in advance for any advice. It may be something trivial such as
>kit not knowing where to place a library so it puts it into a temp
>area?
>
>Avi
>
>-Original Message-
>From: R-help  On Behalf Of John Kane
>Sent: Saturday, February 27, 2021 3:07 PM
>To: Kishor raut 
>Cc: R. Help Mailing List 
>Subject: Re: [R] Help Required for R Markdown function.
>
>The "confusionMatrix" function appears to be from the 'caret' package.
>Have you loaded 'caret' with the library(caret) command?
>
>On Sat, 27 Feb 2021 at 14:20, Kishor raut 
>wrote:
>
>> Respected Sir,
>>
>> I Mr Kishor Tried to get help online but wont found the solution so 
>> writting an email.
>>
>> Step1: While writting in rmarkdown all codes get executted very well 
>> till the fuction Confusionmatrix were written on it.
>>
>> Step2: As confusionmatrix command inserted following error is on 
>> screen board
>>
>>
>> processing file: RMarkdown.Rmd
>>   |. 
>   |
>>   7%
>>   ordinary text without R code
>>
>>   |. 
>   |
>>  13%
>> label: unnamed-chunk-1
>>   |..
>   |
>>  20%
>>   ordinary text without R code
>>
>>   |...   
>   |
>>  27%
>> label: unnamed-chunk-2
>>   |...   
>   |
>>  33%
>>   ordinary text without R code
>>
>>   |  
>   |
>>  40%
>> label: unnamed-chunk-3
>>   |. 
>   |
>>  47%
>>   ordinary text w

Re: [R] Help Required for R Markdown function.

2021-03-01 Thread Avi Gross via R-help
Calum,

 

Thanks for your thoughts. As mentioned, I fixed the problem. I actually was 
using require() and also tried library() but the problem was elsewhere as my R 
installation and startup seemed to no longer have variables set properly to 
find packages remotely or locally.

 

And yes, I made a new empty markdown but as it asks for nothing, it has no 
problems 

 

 

From: CALUM POLWART  
Sent: Monday, March 1, 2021 2:31 AM
To: Avi Gross 
Cc: 'R. Help Mailing List' 
Subject: Re: [R] Help Required for R Markdown function.

 

Sounds like you have an install.packages("tidyverse") line in your Rmd rather 
than library (tidyverse)

 

Does this happen on a Rmd example created by doing File/New/R Markdown

 

With no changes?

 

 

 

On 28 Feb 2021 22:04, Avi Gross via R-help mailto:r-help@r-project.org> > wrote:

I am sure you can get more done with a caret than a stick. I need a stick for 
another problem, though. 

A serious question. I somehow upset my R/RSTUDIO setup while trying to see why 
a markdown only allowed me to save an HTML version, not PDF and DOC as it used 
to. It now fails on any such document with a code that indicates it is not set 
to find a CRAN mirror: 

It seems to be upset by a simple call to get the tidyverse loaded and may 
succeed in one sense but not continue: 

" Installing package into �C:/Users/avid2016/Documents/R/win-library/4.0� 
(as �lib� is unspecified) 
trying URL 
'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip' 
Content type 'application/zip' length 439972 bytes (429 KB) 
downloaded 429 KB 

package ‘tidyverse’ successfully unpacked and MD5 sums checked 
..." 

The R Markdown lower console window says: 

"Error in contrib.url(repos, "source") : trying to use CRAN without setting a 
mirror calls  ... 
withVisible -> eval -> eval install.packages -> contrib.url Exection halted" 

I have done some work that failed. I am running on windows with the latest 
versions of both R and RSTUDIO after removing all old versions and 
re-installing both. I have seen hints I need to set some definitions in a 
.Rprofile or so and tried but it continues to fail. So I now can knit nothing! 

Anyone have a pointer on problems like this? My next attempt would be to 
reinstall the programs on another hard disk entirely in case the problem is in 
my folder structure of ~/R and below but I dod not want to toss years of work 
because of one errant configuration file or the lack thereof. 

Thanks in advance for any advice. It may be something trivial such as kit not 
knowing where to place a library so it puts it into a temp area? 

Avi 

-Original Message- 
From: R-help mailto:r-help-boun...@r-project.org> > On Behalf Of John Kane 
Sent: Saturday, February 27, 2021 3:07 PM 
To: Kishor raut mailto:rautkisho...@gmail.com> > 
Cc: R. Help Mailing List mailto:r-help@r-project.org> > 
Subject: Re: [R] Help Required for R Markdown function. 

The "confusionMatrix" function appears to be from the 'caret' package. 
Have you loaded 'caret' with the library(caret) command? 

On Sat, 27 Feb 2021 at 14:20, Kishor raut mailto:rautkisho...@gmail.com> > wrote: 

> Respected Sir, 
> 
> I Mr Kishor Tried to get help online but wont found the solution so 
> writting an email. 
> 
> Step1: While writting in rmarkdown all codes get executted very well 
> till the fuction Confusionmatrix were written on it. 
> 
> Step2: As confusionmatrix command inserted following error is on 
> screen board 
> 
> 
> processing file: RMarkdown.Rmd 
>   |. | 
>   7% 
>   ordinary text without R code 
> 
>   |. | 
>  13% 
> label: unnamed-chunk-1 
>   |..| 
>  20% 
>   ordinary text without R code 
> 
>   |...   | 
>  27% 
> label: unnamed-chunk-2 
>   |...   | 
>  33% 
>   ordinary text without R code 
> 
>   |  | 
>  40% 
> label: unnamed-chunk-3 
>   |. | 
>  47% 
>   ordinary text without R code 
> 
>   |. | 
>  53% 
> label: unnamed-chunk-4 
>   |..| 
>  60% 
>   ordinary text without R code 
> 
>   |...   | 
>  67% 
> label: unnamed-chunk-5 

Re: [R] Help Required for R Markdown function.

2021-02-28 Thread Avi Gross via R-help
I am sure you can get more done with a caret than a stick. I need a stick for 
another problem, though.

A serious question. I somehow upset my R/RSTUDIO setup while trying to see why 
a markdown only allowed me to save an HTML version, not PDF and DOC as it used 
to. It now fails on any such document with a code that indicates it is not set 
to find a CRAN mirror:

It seems to be upset by a simple call to get the tidyverse loaded and may 
succeed in one sense but not continue:

" Installing package into �C:/Users/avid2016/Documents/R/win-library/4.0�
(as �lib� is unspecified)
trying URL 
'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyverse_1.3.0.zip'
Content type 'application/zip' length 439972 bytes (429 KB)
downloaded 429 KB

package ‘tidyverse’ successfully unpacked and MD5 sums checked
..."

The R Markdown lower console window says:

"Error in contrib.url(repos, "source") : trying to use CRAN without setting a 
mirror calls  ...
withVisible -> eval -> eval install.packages -> contrib.url Exection halted"

I have done some work that failed. I am running on windows with the latest 
versions of both R and RSTUDIO after removing all old versions and 
re-installing both. I have seen hints I need to set some definitions in a 
.Rprofile or so and tried but it continues to fail. So I now can knit nothing!

Anyone have a pointer on problems like this? My next attempt would be to 
reinstall the programs on another hard disk entirely in case the problem is in 
my folder structure of ~/R and below but I dod not want to toss years of work 
because of one errant configuration file or the lack thereof.

Thanks in advance for any advice. It may be something trivial such as kit not 
knowing where to place a library so it puts it into a temp area?

Avi

-Original Message-
From: R-help  On Behalf Of John Kane
Sent: Saturday, February 27, 2021 3:07 PM
To: Kishor raut 
Cc: R. Help Mailing List 
Subject: Re: [R] Help Required for R Markdown function.

The "confusionMatrix" function appears to be from the 'caret' package.
Have you loaded 'caret' with the library(caret) command?

On Sat, 27 Feb 2021 at 14:20, Kishor raut  wrote:

> Respected Sir,
>
> I Mr Kishor Tried to get help online but wont found the solution so 
> writting an email.
>
> Step1: While writting in rmarkdown all codes get executted very well 
> till the fuction Confusionmatrix were written on it.
>
> Step2: As confusionmatrix command inserted following error is on 
> screen board
>
>
> processing file: RMarkdown.Rmd
>   |. |
>   7%
>   ordinary text without R code
>
>   |. |
>  13%
> label: unnamed-chunk-1
>   |..|
>  20%
>   ordinary text without R code
>
>   |...   |
>  27%
> label: unnamed-chunk-2
>   |...   |
>  33%
>   ordinary text without R code
>
>   |  |
>  40%
> label: unnamed-chunk-3
>   |. |
>  47%
>   ordinary text without R code
>
>   |. |
>  53%
> label: unnamed-chunk-4
>   |..|
>  60%
>   ordinary text without R code
>
>   |...   |
>  67%
> label: unnamed-chunk-5
>   |...   |
>  73%
>   ordinary text without R code
>
>   |  |
>  80%
> label: unnamed-chunk-6
>   |. |
>  87%
>   ordinary text without R code
>
>   |. |
>  93%
> label: unnamed-chunk-7
> Quitting from lines 98-104 (RMarkdown.Rmd) Error in 
> confusionMatrix(p1, train$CTestresult) :
>   could not find function "confusionMatrix"
> Calls:  ... handle -> withCallingHandlers -> withVisible -> 
> eval
> -> eval
>
> Execution halted
>
> Step4: As codes were written these
>
>
> Using function “sample” the data takes into sample of the specified 
> size from the stored data ```{r}
> set.seed(1234)
> ind<-sample(2,nrow(FEVER1),replace=TRUE, pro = c(0.7,0.3)) 
> train<-FEVER1[ind==1,] test<-FEVER1[ind==2,] ```
>
> Application of Random 

Re: [R] Help Required for R Markdown function.

2021-02-28 Thread Kishor raut
Thanks, I'll check it out.

On Sun, 28 Feb, 2021, 1:37 AM John Kane,  wrote:

> The "confusionMatrix" function appears to be from the 'caret' package.
> Have you loaded 'caret' with the library(caret) command?
>
> On Sat, 27 Feb 2021 at 14:20, Kishor raut  wrote:
>
>> Respected Sir,
>>
>> I Mr Kishor Tried to get help online but wont found the solution so
>> writting an email.
>>
>> Step1: While writting in rmarkdown all codes get executted very well till
>> the fuction
>> Confusionmatrix were written on it.
>>
>> Step2: As confusionmatrix command inserted following error is on screen
>> board
>>
>>
>> processing file: RMarkdown.Rmd
>>   |. |
>>   7%
>>   ordinary text without R code
>>
>>   |. |
>>  13%
>> label: unnamed-chunk-1
>>   |..|
>>  20%
>>   ordinary text without R code
>>
>>   |...   |
>>  27%
>> label: unnamed-chunk-2
>>   |...   |
>>  33%
>>   ordinary text without R code
>>
>>   |  |
>>  40%
>> label: unnamed-chunk-3
>>   |. |
>>  47%
>>   ordinary text without R code
>>
>>   |. |
>>  53%
>> label: unnamed-chunk-4
>>   |..|
>>  60%
>>   ordinary text without R code
>>
>>   |...   |
>>  67%
>> label: unnamed-chunk-5
>>   |...   |
>>  73%
>>   ordinary text without R code
>>
>>   |  |
>>  80%
>> label: unnamed-chunk-6
>>   |. |
>>  87%
>>   ordinary text without R code
>>
>>   |. |
>>  93%
>> label: unnamed-chunk-7
>> Quitting from lines 98-104 (RMarkdown.Rmd)
>> Error in confusionMatrix(p1, train$CTestresult) :
>>   could not find function "confusionMatrix"
>> Calls:  ... handle -> withCallingHandlers -> withVisible ->
>> eval
>> -> eval
>>
>> Execution halted
>>
>> Step4: As codes were written these
>>
>>
>> Using function “sample” the data takes into sample of the specified size
>> from the stored data
>> ```{r}
>> set.seed(1234)
>> ind<-sample(2,nrow(FEVER1),replace=TRUE, pro = c(0.7,0.3))
>> train<-FEVER1[ind==1,]
>> test<-FEVER1[ind==2,]
>> ```
>>
>> Application of Random Forest
>>
>> ```{r}
>> library(randomForest)
>> set.seed(123)
>> rfmodel<-randomForest(CTestresult~.,data = train,prox=TRUE)# Random
>> Forest Model
>> plot(rfmodel,main="RandomForest Model")
>> print(rfmodel,train)# Printing Outcome of 'model for
>> Training Data
>>
>> ```
>>
>> Prediction using Randome Forest Model
>> ```{r}
>> # Prediction  of RandomForest Intial Model for Test and Train Data
>>
>> ptrain1<-predict(rfmodel,train)  # Predicting model Prediction
>> On Training Data
>>   # First Six Outcomes with prediction
>> head(ptrain1)  # Printing First Six Prediction
>> using Random Forest Model
>> head(train$CTestresult)   # Printing First Six (6)
>> Actual outcomes
>>
>> ```
>>
>>
>> Tuning Model:
>> Tuning of Machine learning model is important step for building good model
>> for best outcome of research.
>>
>> ```{r}
>> # Tunning RandomForest  Model using Algorithm
>>
>> t<-tuneRF(train[,-11],train$CTestresult, mtryStart = 2,ntreeTry = 100,
>> stepFactor =2,improve = 0.051,trace = TRUE, plot = TRUE, doBest=TRUE)
>>
>>
>> ```
>>
>> Building New Model:
>>
>> New model was build on the basis of tunned model parameters and controls.
>>
>> ```{r}
>> # New Model After Tuning Random Forest Model
>>
>> rf1<-randomForest(CTestresult~.,data = train,ntree = 100, mtry = 8,
>> importance = TRUE,proximity = TRUE)
>>
>> print(rf1)
>> ```
>>
>> Prediction and Confusion MAtrix:
>>
>> outcome of model will mesuare with the help of predictive outcomes with
>> the
>> help of confusion matrix.
>>
>> ```{r}
>> # Prediction using Random Forest and Confusion Matrix for Train Data
>> p1<-predict(rf1,train)
>> cmatrix<-confusionMatrix(p1,train$CTestresult)
>> cmatrix
>>
>>
>> ```
>>
>>
>> I will great thank full if you will help me for to remove the error.
>>
>>
>>
>>
>> --
>> *Kind Regards*
>>
>> Kishor Raut
>> *Cell No.-07387706552*
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 

Re: [R] Help Required for R Markdown function.

2021-02-27 Thread John Kane
The "confusionMatrix" function appears to be from the 'caret' package.
Have you loaded 'caret' with the library(caret) command?

On Sat, 27 Feb 2021 at 14:20, Kishor raut  wrote:

> Respected Sir,
>
> I Mr Kishor Tried to get help online but wont found the solution so
> writting an email.
>
> Step1: While writting in rmarkdown all codes get executted very well till
> the fuction
> Confusionmatrix were written on it.
>
> Step2: As confusionmatrix command inserted following error is on screen
> board
>
>
> processing file: RMarkdown.Rmd
>   |. |
>   7%
>   ordinary text without R code
>
>   |. |
>  13%
> label: unnamed-chunk-1
>   |..|
>  20%
>   ordinary text without R code
>
>   |...   |
>  27%
> label: unnamed-chunk-2
>   |...   |
>  33%
>   ordinary text without R code
>
>   |  |
>  40%
> label: unnamed-chunk-3
>   |. |
>  47%
>   ordinary text without R code
>
>   |. |
>  53%
> label: unnamed-chunk-4
>   |..|
>  60%
>   ordinary text without R code
>
>   |...   |
>  67%
> label: unnamed-chunk-5
>   |...   |
>  73%
>   ordinary text without R code
>
>   |  |
>  80%
> label: unnamed-chunk-6
>   |. |
>  87%
>   ordinary text without R code
>
>   |. |
>  93%
> label: unnamed-chunk-7
> Quitting from lines 98-104 (RMarkdown.Rmd)
> Error in confusionMatrix(p1, train$CTestresult) :
>   could not find function "confusionMatrix"
> Calls:  ... handle -> withCallingHandlers -> withVisible -> eval
> -> eval
>
> Execution halted
>
> Step4: As codes were written these
>
>
> Using function “sample” the data takes into sample of the specified size
> from the stored data
> ```{r}
> set.seed(1234)
> ind<-sample(2,nrow(FEVER1),replace=TRUE, pro = c(0.7,0.3))
> train<-FEVER1[ind==1,]
> test<-FEVER1[ind==2,]
> ```
>
> Application of Random Forest
>
> ```{r}
> library(randomForest)
> set.seed(123)
> rfmodel<-randomForest(CTestresult~.,data = train,prox=TRUE)# Random
> Forest Model
> plot(rfmodel,main="RandomForest Model")
> print(rfmodel,train)# Printing Outcome of 'model for
> Training Data
>
> ```
>
> Prediction using Randome Forest Model
> ```{r}
> # Prediction  of RandomForest Intial Model for Test and Train Data
>
> ptrain1<-predict(rfmodel,train)  # Predicting model Prediction
> On Training Data
>   # First Six Outcomes with prediction
> head(ptrain1)  # Printing First Six Prediction
> using Random Forest Model
> head(train$CTestresult)   # Printing First Six (6)
> Actual outcomes
>
> ```
>
>
> Tuning Model:
> Tuning of Machine learning model is important step for building good model
> for best outcome of research.
>
> ```{r}
> # Tunning RandomForest  Model using Algorithm
>
> t<-tuneRF(train[,-11],train$CTestresult, mtryStart = 2,ntreeTry = 100,
> stepFactor =2,improve = 0.051,trace = TRUE, plot = TRUE, doBest=TRUE)
>
>
> ```
>
> Building New Model:
>
> New model was build on the basis of tunned model parameters and controls.
>
> ```{r}
> # New Model After Tuning Random Forest Model
>
> rf1<-randomForest(CTestresult~.,data = train,ntree = 100, mtry = 8,
> importance = TRUE,proximity = TRUE)
>
> print(rf1)
> ```
>
> Prediction and Confusion MAtrix:
>
> outcome of model will mesuare with the help of predictive outcomes with the
> help of confusion matrix.
>
> ```{r}
> # Prediction using Random Forest and Confusion Matrix for Train Data
> p1<-predict(rf1,train)
> cmatrix<-confusionMatrix(p1,train$CTestresult)
> cmatrix
>
>
> ```
>
>
> I will great thank full if you will help me for to remove the error.
>
>
>
>
> --
> *Kind Regards*
>
> Kishor Raut
> *Cell No.-07387706552*
>
> [[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.
>


-- 
John Kane
Kingston ON Canada

[[alternative HTML version deleted]]


[R] Help Required for R Markdown function.

2021-02-27 Thread Kishor raut
Respected Sir,

I Mr Kishor Tried to get help online but wont found the solution so
writting an email.

Step1: While writting in rmarkdown all codes get executted very well till
the fuction
Confusionmatrix were written on it.

Step2: As confusionmatrix command inserted following error is on screen
board


processing file: RMarkdown.Rmd
  |. |
  7%
  ordinary text without R code

  |. |
 13%
label: unnamed-chunk-1
  |..|
 20%
  ordinary text without R code

  |...   |
 27%
label: unnamed-chunk-2
  |...   |
 33%
  ordinary text without R code

  |  |
 40%
label: unnamed-chunk-3
  |. |
 47%
  ordinary text without R code

  |. |
 53%
label: unnamed-chunk-4
  |..|
 60%
  ordinary text without R code

  |...   |
 67%
label: unnamed-chunk-5
  |...   |
 73%
  ordinary text without R code

  |  |
 80%
label: unnamed-chunk-6
  |. |
 87%
  ordinary text without R code

  |. |
 93%
label: unnamed-chunk-7
Quitting from lines 98-104 (RMarkdown.Rmd)
Error in confusionMatrix(p1, train$CTestresult) :
  could not find function "confusionMatrix"
Calls:  ... handle -> withCallingHandlers -> withVisible -> eval
-> eval

Execution halted

Step4: As codes were written these


Using function “sample” the data takes into sample of the specified size
from the stored data
```{r}
set.seed(1234)
ind<-sample(2,nrow(FEVER1),replace=TRUE, pro = c(0.7,0.3))
train<-FEVER1[ind==1,]
test<-FEVER1[ind==2,]
```

Application of Random Forest

```{r}
library(randomForest)
set.seed(123)
rfmodel<-randomForest(CTestresult~.,data = train,prox=TRUE)# Random
Forest Model
plot(rfmodel,main="RandomForest Model")
print(rfmodel,train)# Printing Outcome of 'model for
Training Data

```

Prediction using Randome Forest Model
```{r}
# Prediction  of RandomForest Intial Model for Test and Train Data

ptrain1<-predict(rfmodel,train)  # Predicting model Prediction
On Training Data
  # First Six Outcomes with prediction
head(ptrain1)  # Printing First Six Prediction
using Random Forest Model
head(train$CTestresult)   # Printing First Six (6)
Actual outcomes

```


Tuning Model:
Tuning of Machine learning model is important step for building good model
for best outcome of research.

```{r}
# Tunning RandomForest  Model using Algorithm

t<-tuneRF(train[,-11],train$CTestresult, mtryStart = 2,ntreeTry = 100,
stepFactor =2,improve = 0.051,trace = TRUE, plot = TRUE, doBest=TRUE)


```

Building New Model:

New model was build on the basis of tunned model parameters and controls.

```{r}
# New Model After Tuning Random Forest Model

rf1<-randomForest(CTestresult~.,data = train,ntree = 100, mtry = 8,
importance = TRUE,proximity = TRUE)

print(rf1)
```

Prediction and Confusion MAtrix:

outcome of model will mesuare with the help of predictive outcomes with the
help of confusion matrix.

```{r}
# Prediction using Random Forest and Confusion Matrix for Train Data
p1<-predict(rf1,train)
cmatrix<-confusionMatrix(p1,train$CTestresult)
cmatrix


```


I will great thank full if you will help me for to remove the error.




-- 
*Kind Regards*

Kishor Raut
*Cell No.-07387706552*

[[alternative HTML version deleted]]

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


Re: [R] Help Required in looping visuals

2017-08-21 Thread Ismail SEZEN

> On 21 Aug 2017, at 09:30, Venkateswara Reddy Marella (Infosys Ltd) via R-help 
>  wrote:
> 
> Hi Team ,
> 
> I have a requirement of building set of panels in which each panel has 
> multiple visuals based on single set of dataset values and this thing is 
> repeated for other set of values as well.
> For this requirement , I am trying to use a for loop to create visuals and 
> panel for each set of values ( like first panel should be for first set of 
> dataset values and so on) . Do we have any available solution for this 
> problem.
> 
> Thanks,
> Venkat.

I suspect you want to plot categorical variables in panels. Run the code below 
and see if it solves your problem. If not, create a minimal example as below 
and ask your question again.

df <- data.frame(set = factor(paste0("set", rep(1:6, each = 20))), 
 x = rnorm(120), y = rnorm(120))
library(lattice)
xyplot(x~y|set, df, type = "p", as.table = TRUE)

library(ggplot2)
ggplot(df, aes(x = x, y = y, color = set)) +
  facet_wrap(~set, nrow = 2, ncol = 3) +
  geom_point()
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Help Required in looping visuals

2017-08-21 Thread Ulrik Stervbo
Hi Venkat,

I must admit I don't understand what you are looking for, but maybe just
store the visuals in a named lIst?

Also, I have started to use nested data.frames to keep plots together with
identifiers of the data sets. The nest and unnest functions are in the
tidyr package. It keeps me from having to create and parse long names, and
provides a nice structure.

HTH
Ulrik

On Mon, 21 Aug 2017 at 10:00 Venkateswara Reddy Marella (Infosys Ltd) via
R-help  wrote:

> Hi Team ,
>
> I have a requirement of building set of panels in which each panel has
> multiple visuals based on single set of dataset values and this thing is
> repeated for other set of values as well.
> For this requirement , I am trying to use a for loop to create visuals and
> panel for each set of values ( like first panel should be for first set of
> dataset values and so on) . Do we have any available solution for this
> problem.
>
> Thanks,
> Venkat.
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


Re: [R] Help Required in looping visuals

2017-08-21 Thread John Kane via R-help
I think we need a lot more information on the problem.  read  the posting 
guidelines at the bottom of the email & have a look at these links.
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Reproducibility · Advanced R.

| 
| 
|  | 
Reproducibility · Advanced R.


 |

 |

 |





On Monday, August 21, 2017, 4:00:13 AM EDT, Venkateswara Reddy Marella (Infosys 
Ltd) via R-help  wrote:

Hi Team ,

I have a requirement of building set of panels in which each panel has multiple 
visuals based on single set of dataset values and this thing is repeated for 
other set of values as well.
For this requirement , I am trying to use a for loop to create visuals and 
panel for each set of values ( like first panel should be for first set of 
dataset values and so on) . Do we have any available solution for this problem.

Thanks,
Venkat.

    [[alternative HTML version deleted]]

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

[[alternative HTML version deleted]]

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

[R] Help Required in looping visuals

2017-08-21 Thread Venkateswara Reddy Marella (Infosys Ltd) via R-help
Hi Team ,

I have a requirement of building set of panels in which each panel has multiple 
visuals based on single set of dataset values and this thing is repeated for 
other set of values as well.
For this requirement , I am trying to use a for loop to create visuals and 
panel for each set of values ( like first panel should be for first set of 
dataset values and so on) . Do we have any available solution for this problem.

Thanks,
Venkat.

[[alternative HTML version deleted]]

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


Re: [R] Help required for Rcmdr

2016-02-22 Thread Fox, John
Dear sekhar,

You don't need a C or C++ compiler to use the Rcmdr package. Nor do you need a 
compiler to install the package on Windows or Mac OS X, for which binary 
packages are provided by CRAN. Apparently, from your previous question, you're 
using a Windows system, and so you don't need a C or C++ compiler, unless for 
some reason you want to install the package from source (because there is a 
single small C program in the sources for the package).

Why do you ask?

I hope this helps,
 John

-
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
web: socserv.mcmaster.ca/jfox



From: R-help [r-help-boun...@r-project.org] on behalf of Sekhar Venkatesan 
[venkatesansek...@gmail.com]
Sent: February 21, 2016 7:49 AM
To: R-help@r-project.org
Subject: Re: [R] Help required for Rcmdr

Dear Sirs,
just wanted to check whether C+ or C++ software is required to be in the
installed in the laptop in order to use Rcmdr
regards
sekhar

On Wed, Feb 10, 2016 at 10:17 PM, Fox, John <j...@mcmaster.ca> wrote:

> Dear Sekhar,
>
> > -Original Message-
> > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
> > Sent: February 10, 2016 11:37 AM
> > To: Fox, John <j...@mcmaster.ca>
> > Subject: RE: [R] Help required for Rcmdr
> >
> > Tks and sorry for inadvertently sending to u alone
>
> And you apparently just did that again, so again I'm cc'ing to r-help.
>
> > In any case I hv tried all
> > over again but to no avail Regards Sekhar
>
> I assume that  by "tried all over again" you mean you tried again with an
> HTTP rather than HTTPS CRAN mirror and that didn't work.
>
> I'm afraid that I'm out of ideas.
>
> Maybe someone else will have a suggestion.
>
> John
>
> >
> > On Feb 10, 2016 9:59 PM, "Fox, John" <j...@mcmaster.ca
> > <mailto:j...@mcmaster.ca> > wrote:
> >
> >
> >   Dear Sekhar,
> >
> >   I'm sorry that you're experiencing these problems. Although you
> > haven't said so directly, I assume that you aren't able to use
> install.packages()
> > to install *any* CRAN packages, not just the Rcmdr package.
> >
> >   Downloading and unpacking the Rcmdr zip file doesn't install the
> > package. You can install the zip-file binary package from the R Windows
> GUI
> > via the "Packages > Install package(s) from local zip files" menu, but
> that too
> > won't really help because it won't install the many CRAN packages on
> which
> > the Rcmdr depends.
> >
> >   As I said earlier, my guess is that you're experiencing a problem
> with
> > a firewall, proxy server, or HTTPS. If the latter (which was Vito's
> problem),
> > you can easily solve the problem by using an HTTP CRAN server in
> preference
> > to the default HTTPS:
> >
> >   Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R
> > Console > prompt and select a CRAN mirror -- I suggest the first
> (0-Cloud)
> > mirror. Then issue the command install.packages("Rcmdr"), as before.
> >
> >   If that doesn't work, I'm afraid I don't have other suggestions.
> >
> >   You appear to have sent this message only to me, not to r-help.
> That
> > not a good idea for several reasons, not least of which is that people
> who
> > have other suggestions won't see your message. I'm cc'ing this response
> to r-
> > help.
> >
> >   Best,
> >John
> >
> >   > -Original Message-
> >   > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com
> > <mailto:venkatesansek...@gmail.com> ]
> >   > Sent: February 10, 2016 12:03 AM
> >   > To: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca> >
> >   > Subject: Re: [R] Help required for Rcmdr
> >   >
> >   > Dear Sirs,
> >   > Thanks to everyone for trying to help me. i have tried several
> CRAN
> > mirrors
> >   > but to no help. I am getting the Zip file for Rcmdr and can also
> unzip
> > the
> >   > same. However, after that i am unable to open the Rcmdr console.
> >   > that is the problem.
> >   > regards
> >   > sekhar
> >   >
> >   > On Tue, Feb 9, 2016 at 10:00 PM, Fox, John <j...@mcmaster.ca
> > <mailto:j...@mcmaster.ca>
> >   > <mailto:j...@mcmaster.ca <mailto:j...@mcmaster.ca> > > wrote:
> >   >
> >   >
> >   >   Hi Rich,
> 

Re: [R] Help required for Rcmdr

2016-02-21 Thread Jeff Newmiller
Not sure what C+ software is, but with regard to C or C++ compilers the short 
answer is probably not.  The true answer is that it may depend on your 
unspecified operating system and on what packages you want to use. 

If you are on windows you can install most packages from zip files with no 
compiler. Also, many packages that contain only R source code can be installed 
from tar.gz files even without a compiler.
-- 
Sent from my phone. Please excuse my brevity.

On February 21, 2016 4:49:08 AM PST, Sekhar Venkatesan 
<venkatesansek...@gmail.com> wrote:
>Dear Sirs,
>just wanted to check whether C+ or C++ software is required to be in
>the
>installed in the laptop in order to use Rcmdr
>regards
>sekhar
>
>On Wed, Feb 10, 2016 at 10:17 PM, Fox, John <j...@mcmaster.ca> wrote:
>
>> Dear Sekhar,
>>
>> > -Original Message-
>> > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
>> > Sent: February 10, 2016 11:37 AM
>> > To: Fox, John <j...@mcmaster.ca>
>> > Subject: RE: [R] Help required for Rcmdr
>> >
>> > Tks and sorry for inadvertently sending to u alone
>>
>> And you apparently just did that again, so again I'm cc'ing to
>r-help.
>>
>> > In any case I hv tried all
>> > over again but to no avail Regards Sekhar
>>
>> I assume that  by "tried all over again" you mean you tried again
>with an
>> HTTP rather than HTTPS CRAN mirror and that didn't work.
>>
>> I'm afraid that I'm out of ideas.
>>
>> Maybe someone else will have a suggestion.
>>
>> John
>>
>> >
>> > On Feb 10, 2016 9:59 PM, "Fox, John" <j...@mcmaster.ca
>> > <mailto:j...@mcmaster.ca> > wrote:
>> >
>> >
>> >   Dear Sekhar,
>> >
>> >   I'm sorry that you're experiencing these problems. Although
>you
>> > haven't said so directly, I assume that you aren't able to use
>> install.packages()
>> > to install *any* CRAN packages, not just the Rcmdr package.
>> >
>> >   Downloading and unpacking the Rcmdr zip file doesn't install
>the
>> > package. You can install the zip-file binary package from the R
>Windows
>> GUI
>> > via the "Packages > Install package(s) from local zip files" menu,
>but
>> that too
>> > won't really help because it won't install the many CRAN packages
>on
>> which
>> > the Rcmdr depends.
>> >
>> >   As I said earlier, my guess is that you're experiencing a
>problem
>> with
>> > a firewall, proxy server, or HTTPS. If the latter (which was Vito's
>> problem),
>> > you can easily solve the problem by using an HTTP CRAN server in
>> preference
>> > to the default HTTPS:
>> >
>> >   Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R
>> > Console > prompt and select a CRAN mirror -- I suggest the first
>> (0-Cloud)
>> > mirror. Then issue the command install.packages("Rcmdr"), as
>before.
>> >
>> >   If that doesn't work, I'm afraid I don't have other
>suggestions.
>> >
>> >   You appear to have sent this message only to me, not to
>r-help.
>> That
>> > not a good idea for several reasons, not least of which is that
>people
>> who
>> > have other suggestions won't see your message. I'm cc'ing this
>response
>> to r-
>> > help.
>> >
>> >   Best,
>> >John
>> >
>> >   > -Original Message-
>> >   > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com
>> > <mailto:venkatesansek...@gmail.com> ]
>> >   > Sent: February 10, 2016 12:03 AM
>> >   > To: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca> >
>> >   > Subject: Re: [R] Help required for Rcmdr
>> >   >
>> >   > Dear Sirs,
>> >   > Thanks to everyone for trying to help me. i have tried
>several
>> CRAN
>> > mirrors
>> >   > but to no help. I am getting the Zip file for Rcmdr and can
>also
>> unzip
>> > the
>> >   > same. However, after that i am unable to open the Rcmdr
>console.
>> >   > that is the problem.
>> >   > regards
>> >   > sekhar
>> >   >
>> >   > On Tue, Feb 9, 2016 at 10:00 PM, Fox, John
><j...@mcmaster.ca
>> > <mailto:j...@mcmaster.ca>
>> >   > <mailto:j..

Re: [R] Help required for Rcmdr

2016-02-21 Thread Sekhar Venkatesan
Dear Sirs,
just wanted to check whether C+ or C++ software is required to be in the
installed in the laptop in order to use Rcmdr
regards
sekhar

On Wed, Feb 10, 2016 at 10:17 PM, Fox, John <j...@mcmaster.ca> wrote:

> Dear Sekhar,
>
> > -Original Message-
> > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
> > Sent: February 10, 2016 11:37 AM
> > To: Fox, John <j...@mcmaster.ca>
> > Subject: RE: [R] Help required for Rcmdr
> >
> > Tks and sorry for inadvertently sending to u alone
>
> And you apparently just did that again, so again I'm cc'ing to r-help.
>
> > In any case I hv tried all
> > over again but to no avail Regards Sekhar
>
> I assume that  by "tried all over again" you mean you tried again with an
> HTTP rather than HTTPS CRAN mirror and that didn't work.
>
> I'm afraid that I'm out of ideas.
>
> Maybe someone else will have a suggestion.
>
> John
>
> >
> > On Feb 10, 2016 9:59 PM, "Fox, John" <j...@mcmaster.ca
> > <mailto:j...@mcmaster.ca> > wrote:
> >
> >
> >   Dear Sekhar,
> >
> >   I'm sorry that you're experiencing these problems. Although you
> > haven't said so directly, I assume that you aren't able to use
> install.packages()
> > to install *any* CRAN packages, not just the Rcmdr package.
> >
> >   Downloading and unpacking the Rcmdr zip file doesn't install the
> > package. You can install the zip-file binary package from the R Windows
> GUI
> > via the "Packages > Install package(s) from local zip files" menu, but
> that too
> > won't really help because it won't install the many CRAN packages on
> which
> > the Rcmdr depends.
> >
> >   As I said earlier, my guess is that you're experiencing a problem
> with
> > a firewall, proxy server, or HTTPS. If the latter (which was Vito's
> problem),
> > you can easily solve the problem by using an HTTP CRAN server in
> preference
> > to the default HTTPS:
> >
> >   Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R
> > Console > prompt and select a CRAN mirror -- I suggest the first
> (0-Cloud)
> > mirror. Then issue the command install.packages("Rcmdr"), as before.
> >
> >   If that doesn't work, I'm afraid I don't have other suggestions.
> >
> >   You appear to have sent this message only to me, not to r-help.
> That
> > not a good idea for several reasons, not least of which is that people
> who
> > have other suggestions won't see your message. I'm cc'ing this response
> to r-
> > help.
> >
> >   Best,
> >John
> >
> >   > -Original Message-
> >   > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com
> > <mailto:venkatesansek...@gmail.com> ]
> >   > Sent: February 10, 2016 12:03 AM
> >   > To: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca> >
> >   > Subject: Re: [R] Help required for Rcmdr
> >   >
> >   > Dear Sirs,
> >   > Thanks to everyone for trying to help me. i have tried several
> CRAN
> > mirrors
> >   > but to no help. I am getting the Zip file for Rcmdr and can also
> unzip
> > the
> >   > same. However, after that i am unable to open the Rcmdr console.
> >   > that is the problem.
> >   > regards
> >   > sekhar
> >   >
> >   > On Tue, Feb 9, 2016 at 10:00 PM, Fox, John <j...@mcmaster.ca
> > <mailto:j...@mcmaster.ca>
> >   > <mailto:j...@mcmaster.ca <mailto:j...@mcmaster.ca> > > wrote:
> >   >
> >   >
> >   >   Hi Rich,
> >   >
> >   >   > -Original Message-
> >   >   > From: Richard M. Heiberger [mailto:r...@temple.edu
> > <mailto:r...@temple.edu>
> >   > <mailto:r...@temple.edu <mailto:r...@temple.edu> > ]
> >   >   > Sent: February 9, 2016 4:57 PM
> >   >   > To: Vito M. R. Muggeo <vito.mug...@unipa.it
> > <mailto:vito.mug...@unipa.it>
> >   > <mailto:vito.mug...@unipa.it <mailto:vito.mug...@unipa.it> > >
> >   >   > Cc: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca
> >
> > <mailto:j...@mcmaster.ca <mailto:j...@mcmaster.ca> > >;
> >   > Sekhar Venkatesan
> >   >   > <venkatesansek...@gmail.com
> > <

Re: [R] Help required for Rcmdr

2016-02-10 Thread Fox, John
Dear Sekhar,

I'm sorry that you're experiencing these problems. Although you haven't said so 
directly, I assume that you aren't able to use install.packages() to install 
*any* CRAN packages, not just the Rcmdr package.

Downloading and unpacking the Rcmdr zip file doesn't install the package. You 
can install the zip-file binary package from the R Windows GUI via the 
"Packages > Install package(s) from local zip files" menu, but that too won't 
really help because it won't install the many CRAN packages on which the Rcmdr 
depends.

As I said earlier, my guess is that you're experiencing a problem with a 
firewall, proxy server, or HTTPS. If the latter (which was Vito's problem), you 
can easily solve the problem by using an HTTP CRAN server in preference to the 
default HTTPS: 

Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R Console > prompt 
and select a CRAN mirror -- I suggest the first (0-Cloud) mirror. Then issue 
the command install.packages("Rcmdr"), as before.

If that doesn't work, I'm afraid I don't have other suggestions.

You appear to have sent this message only to me, not to r-help. That not a good 
idea for several reasons, not least of which is that people who have other 
suggestions won't see your message. I'm cc'ing this response to r-help.

Best,
 John

> -Original Message-
> From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
> Sent: February 10, 2016 12:03 AM
> To: Fox, John <j...@mcmaster.ca>
> Subject: Re: [R] Help required for Rcmdr
> 
> Dear Sirs,
> Thanks to everyone for trying to help me. i have tried several CRAN mirrors
> but to no help. I am getting the Zip file for Rcmdr and can also unzip the
> same. However, after that i am unable to open the Rcmdr console.
> that is the problem.
> regards
> sekhar
> 
> On Tue, Feb 9, 2016 at 10:00 PM, Fox, John <j...@mcmaster.ca
> <mailto:j...@mcmaster.ca> > wrote:
> 
> 
>   Hi Rich,
> 
>   > -Original Message-
>   > From: Richard M. Heiberger [mailto:r...@temple.edu
> <mailto:r...@temple.edu> ]
>   > Sent: February 9, 2016 4:57 PM
>   > To: Vito M. R. Muggeo <vito.mug...@unipa.it
> <mailto:vito.mug...@unipa.it> >
>   > Cc: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca> >;
> Sekhar Venkatesan
>   > <venkatesansek...@gmail.com
> <mailto:venkatesansek...@gmail.com> >; Duncan Murdoch
>   > <murdoch.dun...@gmail.com
> <mailto:murdoch.dun...@gmail.com> >; R-help@r-project.org <mailto:R-
> h...@r-project.org> ; R-windows@r-
>   > project.org <http://project.org>
>   > Subject: Re: [R] Help required for Rcmdr
>   >
>   > Several of my students have had this type of difficulty with Rstudio.
>   >
> 
>   Good to know, but the original poster tried both with the R Windows
> SDI and MDI.
> 
>   Best,
>John
> 
> 
>   > Rstudio masks install.packages with a similarly named function in an
>   > environment that does not appear in either conflicts(details=TRUE)
> or in
>   > search().
>   >
>   > The workaround is an explicit call to utils
>   >
>   > utils::install.packages("package.name <http://package.name> ")
>   >
>   > Rich
>   >
>   > On Tue, Feb 9, 2016 at 10:34 AM, Vito M. R. Muggeo
> <vito.mug...@unipa.it <mailto:vito.mug...@unipa.it> >
>   > wrote:
>   > > dear John,
>   > > Thanks for your prompt reply
>   > >
>   > > Il 09/02/2016 16.23, Fox, John ha scritto:
>   > >>
>   > >> Dear Vito,
>   > >>
>   > >> I've never experienced this problem myself in a general way,
>   > >
>   > > Me too. I have always installed R packages straightforwardly..
>   > >
>   > > and I'm sure that Windows users of R call install.packages() all the
>   > > time to install packages from CRAN mirrors.
>   > > Of course..
>   > >
>   > > So the question to ask, I think, is what's preventing
>   > > install.packages() from working in your case -- possibly an
> Internet
>   > > connectivity problem due to a firewall, proxy server, use of https,
> etc.
>   > > I'm sure that others more knowledgeable about these issues
> than I am
>   > > will be able to make more specific suggestions for fixing the
> problem.
>   > >
>   > > However I have just checked that it works with *http* servers
> (but not
>   > &

Re: [R] Help required for Rcmdr

2016-02-10 Thread Fox, John
Dear Sekhar,

> -Original Message-
> From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com]
> Sent: February 10, 2016 11:37 AM
> To: Fox, John <j...@mcmaster.ca>
> Subject: RE: [R] Help required for Rcmdr
> 
> Tks and sorry for inadvertently sending to u alone

And you apparently just did that again, so again I'm cc'ing to r-help.

> In any case I hv tried all
> over again but to no avail Regards Sekhar

I assume that  by "tried all over again" you mean you tried again with an HTTP 
rather than HTTPS CRAN mirror and that didn't work.

I'm afraid that I'm out of ideas.

Maybe someone else will have a suggestion.

John

> 
> On Feb 10, 2016 9:59 PM, "Fox, John" <j...@mcmaster.ca
> <mailto:j...@mcmaster.ca> > wrote:
> 
> 
>   Dear Sekhar,
> 
>   I'm sorry that you're experiencing these problems. Although you
> haven't said so directly, I assume that you aren't able to use 
> install.packages()
> to install *any* CRAN packages, not just the Rcmdr package.
> 
>   Downloading and unpacking the Rcmdr zip file doesn't install the
> package. You can install the zip-file binary package from the R Windows GUI
> via the "Packages > Install package(s) from local zip files" menu, but that 
> too
> won't really help because it won't install the many CRAN packages on which
> the Rcmdr depends.
> 
>   As I said earlier, my guess is that you're experiencing a problem with
> a firewall, proxy server, or HTTPS. If the latter (which was Vito's problem),
> you can easily solve the problem by using an HTTP CRAN server in preference
> to the default HTTPS:
> 
>   Enter the command chooseCRANmirror(useHTTPS=FALSE) at the R
> Console > prompt and select a CRAN mirror -- I suggest the first (0-Cloud)
> mirror. Then issue the command install.packages("Rcmdr"), as before.
> 
>   If that doesn't work, I'm afraid I don't have other suggestions.
> 
>   You appear to have sent this message only to me, not to r-help. That
> not a good idea for several reasons, not least of which is that people who
> have other suggestions won't see your message. I'm cc'ing this response to r-
> help.
> 
>   Best,
>John
> 
>   > -Original Message-
>   > From: Sekhar Venkatesan [mailto:venkatesansek...@gmail.com
> <mailto:venkatesansek...@gmail.com> ]
>   > Sent: February 10, 2016 12:03 AM
>   > To: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca> >
>   > Subject: Re: [R] Help required for Rcmdr
>   >
>   > Dear Sirs,
>   > Thanks to everyone for trying to help me. i have tried several CRAN
> mirrors
>   > but to no help. I am getting the Zip file for Rcmdr and can also unzip
> the
>   > same. However, after that i am unable to open the Rcmdr console.
>   > that is the problem.
>   > regards
>   > sekhar
>   >
>   > On Tue, Feb 9, 2016 at 10:00 PM, Fox, John <j...@mcmaster.ca
> <mailto:j...@mcmaster.ca>
>   > <mailto:j...@mcmaster.ca <mailto:j...@mcmaster.ca> > > wrote:
>   >
>   >
>   >   Hi Rich,
>   >
>   >   > -Original Message-
>   >   > From: Richard M. Heiberger [mailto:r...@temple.edu
> <mailto:r...@temple.edu>
>   > <mailto:r...@temple.edu <mailto:r...@temple.edu> > ]
>   >   > Sent: February 9, 2016 4:57 PM
>   >   > To: Vito M. R. Muggeo <vito.mug...@unipa.it
> <mailto:vito.mug...@unipa.it>
>   > <mailto:vito.mug...@unipa.it <mailto:vito.mug...@unipa.it> > >
>   >   > Cc: Fox, John <j...@mcmaster.ca <mailto:j...@mcmaster.ca>
> <mailto:j...@mcmaster.ca <mailto:j...@mcmaster.ca> > >;
>   > Sekhar Venkatesan
>   >   > <venkatesansek...@gmail.com
> <mailto:venkatesansek...@gmail.com>
>   > <mailto:venkatesansek...@gmail.com
> <mailto:venkatesansek...@gmail.com> > >; Duncan Murdoch
>   >   > <murdoch.dun...@gmail.com
> <mailto:murdoch.dun...@gmail.com>
>   > <mailto:murdoch.dun...@gmail.com
> <mailto:murdoch.dun...@gmail.com> > >; R-help@r-project.org <mailto:R-
> h...@r-project.org>  <mailto:R- <mailto:R->
>   > h...@r-project.org <mailto:h...@r-project.org> > ; R-windows@r-
>   >   > project.org <http://project.org>  <http://project.org>
>   >   > Subject: Re: [R] Help required for Rcmdr
>   >   >
>   >   >

Re: [R] Help required for Rcmdr

2016-02-09 Thread Fox, John
Dear Sekhar,

The Rcmdr package, including a Windows binary, *is* available for version 3.2.3 
(the current version) of R, as you can verify from the CRAN webpage for the 
package, at <https://cran.r-project.org/web/packages/Rcmdr/index.html>. My 
guess is that the CRAN mirror you're using has a problem, and you might try 
selecting a different mirror.

I hope that this help,
 John

-
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
web: socserv.mcmaster.ca/jfox



From: R-help [r-help-boun...@r-project.org] on behalf of Sekhar Venkatesan 
[venkatesansek...@gmail.com]
Sent: February 9, 2016 6:44 AM
To: Duncan Murdoch; R-help@r-project.org
Cc: r-wind...@r-project.org
Subject: Re: [R] Help required for Rcmdr

Dear Mr. Murdoch,
I am extremely sorry to have sent the mail to you instead of R-help. Thanks
for directing me.
I have downloaded R 3.2.3 version. After that i asked for
install.packages("Rcmdr") . It says that Rcmdr is not available with
version 3.2.3. On looking at the pdf file for getting started with R, i
found that i should download with SDI Graphical interface which I did once
again but still i could not get the Rcmdr console.
I attended a workshop where the faculty brought out the R console as well
as the R-commander console where i could import files and also do all the
statistics easily. I am not getting the R-commander console.
Shall be grateful if i could get help on getting the R-commander console
with the user friendly way of doing the statistical operations.
Thanks and regards,
Once again apologize to Dr. Duncan Murdoch for disturbing him.
Sekhar

On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch <murdoch.dun...@gmail.com>
wrote:

> On 08/02/2016 8:56 AM, Sekhar Venkatesan wrote:
>
>> Dear Sirs,
>> I have downloaded R 3.2.3 version from the CRAN site. I have tried to
>> download with both MDI and SDI user interface. But Rcmdr is not opening in
>> as a console  along with R console. Help is required to open Rcmdr. I have
>> tried install.packages("Rcmdr"), library(Rcmdr) etc but to no avail.
>> thanks
>> Sekhar
>> Delhi
>> India
>>
>> This is the wrong email address for help.  Please write to R-help, and
> describe what happens when you try the commands that are failing.
>
> Duncan Murdoch
>

[[alternative HTML version deleted]]

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

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


Re: [R] Help required for Rcmdr

2016-02-09 Thread Vito M. R. Muggeo

dear all,
I don't know if that problem is related to the Rcmdr package itself..
(Sekhar try to install any other packages..)

I am experiencing the same problem, in that when typing

> install.packages("_ANY_PACKAGE_")

I get the message
Warning message:
package ‘_ANY_PACKAGE_’ is not available (for R version 3.2.3)

But I can download the .zip file and unzip it..

I tried different CRAN mirrors...

best,
vito


Il 09/02/2016 12.44, Sekhar Venkatesan ha scritto:

Dear Mr. Murdoch,
I am extremely sorry to have sent the mail to you instead of R-help. Thanks
for directing me.
I have downloaded R 3.2.3 version. After that i asked for
install.packages("Rcmdr") . It says that Rcmdr is not available with
version 3.2.3. On looking at the pdf file for getting started with R, i
found that i should download with SDI Graphical interface which I did once
again but still i could not get the Rcmdr console.
I attended a workshop where the faculty brought out the R console as well
as the R-commander console where i could import files and also do all the
statistics easily. I am not getting the R-commander console.
Shall be grateful if i could get help on getting the R-commander console
with the user friendly way of doing the statistical operations.
Thanks and regards,
Once again apologize to Dr. Duncan Murdoch for disturbing him.
Sekhar

On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch 
wrote:


On 08/02/2016 8:56 AM, Sekhar Venkatesan wrote:


Dear Sirs,
I have downloaded R 3.2.3 version from the CRAN site. I have tried to
download with both MDI and SDI user interface. But Rcmdr is not opening in
as a console  along with R console. Help is required to open Rcmdr. I have
tried install.packages("Rcmdr"), library(Rcmdr) etc but to no avail.
thanks
Sekhar
Delhi
India

This is the wrong email address for help.  Please write to R-help, and

describe what happens when you try the commands that are failing.

Duncan Murdoch



[[alternative HTML version deleted]]

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



--
==
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 23895240
fax: 091 485726
http://dssm.unipa.it/vmuggeo
Associate Editor, Statistical Modelling

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


Re: [R] Help required for Rcmdr

2016-02-09 Thread Sekhar Venkatesan
Dear Mr. Murdoch,
I am extremely sorry to have sent the mail to you instead of R-help. Thanks
for directing me.
I have downloaded R 3.2.3 version. After that i asked for
install.packages("Rcmdr") . It says that Rcmdr is not available with
version 3.2.3. On looking at the pdf file for getting started with R, i
found that i should download with SDI Graphical interface which I did once
again but still i could not get the Rcmdr console.
I attended a workshop where the faculty brought out the R console as well
as the R-commander console where i could import files and also do all the
statistics easily. I am not getting the R-commander console.
Shall be grateful if i could get help on getting the R-commander console
with the user friendly way of doing the statistical operations.
Thanks and regards,
Once again apologize to Dr. Duncan Murdoch for disturbing him.
Sekhar

On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch 
wrote:

> On 08/02/2016 8:56 AM, Sekhar Venkatesan wrote:
>
>> Dear Sirs,
>> I have downloaded R 3.2.3 version from the CRAN site. I have tried to
>> download with both MDI and SDI user interface. But Rcmdr is not opening in
>> as a console  along with R console. Help is required to open Rcmdr. I have
>> tried install.packages("Rcmdr"), library(Rcmdr) etc but to no avail.
>> thanks
>> Sekhar
>> Delhi
>> India
>>
>> This is the wrong email address for help.  Please write to R-help, and
> describe what happens when you try the commands that are failing.
>
> Duncan Murdoch
>

[[alternative HTML version deleted]]

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


Re: [R] Help required for Rcmdr

2016-02-09 Thread Fox, John
Dear Vito,

I've never experienced this problem myself in a general way, and I'm sure that 
Windows users of R call install.packages() all the time to install packages 
from CRAN mirrors. So the question to ask, I think, is what's preventing 
install.packages() from working in your case -- possibly an Internet 
connectivity problem due to a firewall, proxy server, use of https, etc. I'm 
sure that others more knowledgeable about these issues than I am will be able 
to make more specific suggestions for fixing the problem.

Best,
 John

-
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
web: socserv.mcmaster.ca/jfox



From: R-help [r-help-boun...@r-project.org] on behalf of Vito M. R. Muggeo 
[vito.mug...@unipa.it]
Sent: February 9, 2016 10:15 AM
To: Sekhar Venkatesan; Duncan Murdoch; R-help@r-project.org
Cc: r-wind...@r-project.org
Subject: Re: [R] Help required for Rcmdr

dear all,
I don't know if that problem is related to the Rcmdr package itself..
(Sekhar try to install any other packages..)

I am experiencing the same problem, in that when typing

 > install.packages("_ANY_PACKAGE_")

I get the message
Warning message:
package ‘_ANY_PACKAGE_’ is not available (for R version 3.2.3)

But I can download the .zip file and unzip it..

I tried different CRAN mirrors...

best,
vito


Il 09/02/2016 12.44, Sekhar Venkatesan ha scritto:
> Dear Mr. Murdoch,
> I am extremely sorry to have sent the mail to you instead of R-help. Thanks
> for directing me.
> I have downloaded R 3.2.3 version. After that i asked for
> install.packages("Rcmdr") . It says that Rcmdr is not available with
> version 3.2.3. On looking at the pdf file for getting started with R, i
> found that i should download with SDI Graphical interface which I did once
> again but still i could not get the Rcmdr console.
> I attended a workshop where the faculty brought out the R console as well
> as the R-commander console where i could import files and also do all the
> statistics easily. I am not getting the R-commander console.
> Shall be grateful if i could get help on getting the R-commander console
> with the user friendly way of doing the statistical operations.
> Thanks and regards,
> Once again apologize to Dr. Duncan Murdoch for disturbing him.
> Sekhar
>
> On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch <murdoch.dun...@gmail.com>
> wrote:
>
>> On 08/02/2016 8:56 AM, Sekhar Venkatesan wrote:
>>
>>> Dear Sirs,
>>> I have downloaded R 3.2.3 version from the CRAN site. I have tried to
>>> download with both MDI and SDI user interface. But Rcmdr is not opening in
>>> as a console  along with R console. Help is required to open Rcmdr. I have
>>> tried install.packages("Rcmdr"), library(Rcmdr) etc but to no avail.
>>> thanks
>>> Sekhar
>>> Delhi
>>> India
>>>
>>> This is the wrong email address for help.  Please write to R-help, and
>> describe what happens when you try the commands that are failing.
>>
>> Duncan Murdoch
>>
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
==
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 23895240
fax: 091 485726
http://dssm.unipa.it/vmuggeo
Associate Editor, Statistical Modelling

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

2016-02-09 Thread Vito M. R. Muggeo

dear John,
Thanks for your prompt reply

Il 09/02/2016 16.23, Fox, John ha scritto:

Dear Vito,

I've never experienced this problem myself in a general way,

Me too. I have always installed R packages straightforwardly..

and I'm sure that Windows users of R call install.packages() all the 
time to

install packages from CRAN mirrors.
Of course..

So the question to ask, I think, is what's preventing install.packages()
from working in your case -- possibly an Internet connectivity problem
due to a firewall, proxy server, use of https, etc.
I'm sure that others more knowledgeable about these issues than I am will
be able to make more specific suggestions for fixing the problem.

However I have just checked that it works with *http* servers (but not 
for any other *https*..)


Thanks for your support,
best,
vito



Best,
  John

-
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
web: socserv.mcmaster.ca/jfox



From: R-help [r-help-boun...@r-project.org] on behalf of Vito M. R. Muggeo 
[vito.mug...@unipa.it]
Sent: February 9, 2016 10:15 AM
To: Sekhar Venkatesan; Duncan Murdoch; R-help@r-project.org
Cc: r-wind...@r-project.org
Subject: Re: [R] Help required for Rcmdr

dear all,
I don't know if that problem is related to the Rcmdr package itself..
(Sekhar try to install any other packages..)

I am experiencing the same problem, in that when typing

  > install.packages("_ANY_PACKAGE_")

I get the message
Warning message:
package ‘_ANY_PACKAGE_’ is not available (for R version 3.2.3)

But I can download the .zip file and unzip it..

I tried different CRAN mirrors...

best,
vito


Il 09/02/2016 12.44, Sekhar Venkatesan ha scritto:

Dear Mr. Murdoch,
I am extremely sorry to have sent the mail to you instead of R-help. Thanks
for directing me.
I have downloaded R 3.2.3 version. After that i asked for
install.packages("Rcmdr") . It says that Rcmdr is not available with
version 3.2.3. On looking at the pdf file for getting started with R, i
found that i should download with SDI Graphical interface which I did once
again but still i could not get the Rcmdr console.
I attended a workshop where the faculty brought out the R console as well
as the R-commander console where i could import files and also do all the
statistics easily. I am not getting the R-commander console.
Shall be grateful if i could get help on getting the R-commander console
with the user friendly way of doing the statistical operations.
Thanks and regards,
Once again apologize to Dr. Duncan Murdoch for disturbing him.
Sekhar

On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch <murdoch.dun...@gmail.com>
wrote:


On 08/02/2016 8:56 AM, Sekhar Venkatesan wrote:


Dear Sirs,
I have downloaded R 3.2.3 version from the CRAN site. I have tried to
download with both MDI and SDI user interface. But Rcmdr is not opening in
as a console  along with R console. Help is required to open Rcmdr. I have
tried install.packages("Rcmdr"), library(Rcmdr) etc but to no avail.
thanks
Sekhar
Delhi
India

This is the wrong email address for help.  Please write to R-help, and

describe what happens when you try the commands that are failing.

Duncan Murdoch



   [[alternative HTML version deleted]]

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



--
==
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 23895240
fax: 091 485726
http://dssm.unipa.it/vmuggeo
Associate Editor, Statistical Modelling

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



--
==
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 23895240
fax: 091 485726
http://dssm.unipa.it/vmuggeo
Associate Editor, Statistical Modelling

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


Re: [R] Help required for Rcmdr

2016-02-09 Thread Richard M. Heiberger
Several of my students have had this type of difficulty with Rstudio.

Rstudio masks install.packages with a similarly named function in an
environment that does not appear in
either conflicts(details=TRUE) or in search().

The workaround is an explicit call to utils

utils::install.packages("package.name")

Rich

On Tue, Feb 9, 2016 at 10:34 AM, Vito M. R. Muggeo <vito.mug...@unipa.it> wrote:
> dear John,
> Thanks for your prompt reply
>
> Il 09/02/2016 16.23, Fox, John ha scritto:
>>
>> Dear Vito,
>>
>> I've never experienced this problem myself in a general way,
>
> Me too. I have always installed R packages straightforwardly..
>
> and I'm sure that Windows users of R call install.packages() all the time to
> install packages from CRAN mirrors.
> Of course..
>
> So the question to ask, I think, is what's preventing install.packages()
> from working in your case -- possibly an Internet connectivity problem
> due to a firewall, proxy server, use of https, etc.
> I'm sure that others more knowledgeable about these issues than I am will
> be able to make more specific suggestions for fixing the problem.
>
> However I have just checked that it works with *http* servers (but not for
> any other *https*..)
>
> Thanks for your support,
> best,
> vito
>
>
>>
>> Best,
>>   John
>>
>> -
>> John Fox, Professor
>> McMaster University
>> Hamilton, Ontario
>> Canada L8S 4M4
>> web: socserv.mcmaster.ca/jfox
>>
>>
>> 
>> From: R-help [r-help-boun...@r-project.org] on behalf of Vito M. R. Muggeo
>> [vito.mug...@unipa.it]
>> Sent: February 9, 2016 10:15 AM
>> To: Sekhar Venkatesan; Duncan Murdoch; R-help@r-project.org
>> Cc: r-wind...@r-project.org
>> Subject: Re: [R] Help required for Rcmdr
>>
>> dear all,
>> I don't know if that problem is related to the Rcmdr package itself..
>> (Sekhar try to install any other packages..)
>>
>> I am experiencing the same problem, in that when typing
>>
>>   > install.packages("_ANY_PACKAGE_")
>>
>> I get the message
>> Warning message:
>> package ‘_ANY_PACKAGE_’ is not available (for R version 3.2.3)
>>
>> But I can download the .zip file and unzip it..
>>
>> I tried different CRAN mirrors...
>>
>> best,
>> vito
>>
>>
>> Il 09/02/2016 12.44, Sekhar Venkatesan ha scritto:
>>>
>>> Dear Mr. Murdoch,
>>> I am extremely sorry to have sent the mail to you instead of R-help.
>>> Thanks
>>> for directing me.
>>> I have downloaded R 3.2.3 version. After that i asked for
>>> install.packages("Rcmdr") . It says that Rcmdr is not available with
>>> version 3.2.3. On looking at the pdf file for getting started with R, i
>>> found that i should download with SDI Graphical interface which I did
>>> once
>>> again but still i could not get the Rcmdr console.
>>> I attended a workshop where the faculty brought out the R console as well
>>> as the R-commander console where i could import files and also do all the
>>> statistics easily. I am not getting the R-commander console.
>>> Shall be grateful if i could get help on getting the R-commander console
>>> with the user friendly way of doing the statistical operations.
>>> Thanks and regards,
>>> Once again apologize to Dr. Duncan Murdoch for disturbing him.
>>> Sekhar
>>>
>>> On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch <murdoch.dun...@gmail.com>
>>> wrote:
>>>
>>>> On 08/02/2016 8:56 AM, Sekhar Venkatesan wrote:
>>>>
>>>>> Dear Sirs,
>>>>> I have downloaded R 3.2.3 version from the CRAN site. I have tried to
>>>>> download with both MDI and SDI user interface. But Rcmdr is not opening
>>>>> in
>>>>> as a console  along with R console. Help is required to open Rcmdr. I
>>>>> have
>>>>> tried install.packages("Rcmdr"), library(Rcmdr) etc but to no avail.
>>>>> thanks
>>>>> Sekhar
>>>>> Delhi
>>>>> India
>>>>>
>>>>> This is the wrong email address for help.  Please write to R-help, and
>>>>
>>>> describe what happens when you try the commands that are failing.
>>>>
>>>> Duncan Murdoch
>>>>
>>>
>>>[[alternative HTML version deleted]]
>>>
>>> __

Re: [R] Help required for Rcmdr

2016-02-09 Thread Fox, John
Hi Rich,

> -Original Message-
> From: Richard M. Heiberger [mailto:r...@temple.edu]
> Sent: February 9, 2016 4:57 PM
> To: Vito M. R. Muggeo <vito.mug...@unipa.it>
> Cc: Fox, John <j...@mcmaster.ca>; Sekhar Venkatesan
> <venkatesansek...@gmail.com>; Duncan Murdoch
> <murdoch.dun...@gmail.com>; R-help@r-project.org; R-windows@r-
> project.org
> Subject: Re: [R] Help required for Rcmdr
> 
> Several of my students have had this type of difficulty with Rstudio.
> 

Good to know, but the original poster tried both with the R Windows SDI and MDI.

Best,
 John

> Rstudio masks install.packages with a similarly named function in an
> environment that does not appear in either conflicts(details=TRUE) or in
> search().
> 
> The workaround is an explicit call to utils
> 
> utils::install.packages("package.name")
> 
> Rich
> 
> On Tue, Feb 9, 2016 at 10:34 AM, Vito M. R. Muggeo <vito.mug...@unipa.it>
> wrote:
> > dear John,
> > Thanks for your prompt reply
> >
> > Il 09/02/2016 16.23, Fox, John ha scritto:
> >>
> >> Dear Vito,
> >>
> >> I've never experienced this problem myself in a general way,
> >
> > Me too. I have always installed R packages straightforwardly..
> >
> > and I'm sure that Windows users of R call install.packages() all the
> > time to install packages from CRAN mirrors.
> > Of course..
> >
> > So the question to ask, I think, is what's preventing
> > install.packages() from working in your case -- possibly an Internet
> > connectivity problem due to a firewall, proxy server, use of https, etc.
> > I'm sure that others more knowledgeable about these issues than I am
> > will be able to make more specific suggestions for fixing the problem.
> >
> > However I have just checked that it works with *http* servers (but not
> > for any other *https*..)
> >
> > Thanks for your support,
> > best,
> > vito
> >
> >
> >>
> >> Best,
> >>   John
> >>
> >> -
> >> John Fox, Professor
> >> McMaster University
> >> Hamilton, Ontario
> >> Canada L8S 4M4
> >> web: socserv.mcmaster.ca/jfox
> >>
> >>
> >> 
> >> From: R-help [r-help-boun...@r-project.org] on behalf of Vito M. R.
> >> Muggeo [vito.mug...@unipa.it]
> >> Sent: February 9, 2016 10:15 AM
> >> To: Sekhar Venkatesan; Duncan Murdoch; R-help@r-project.org
> >> Cc: r-wind...@r-project.org
> >> Subject: Re: [R] Help required for Rcmdr
> >>
> >> dear all,
> >> I don't know if that problem is related to the Rcmdr package itself..
> >> (Sekhar try to install any other packages..)
> >>
> >> I am experiencing the same problem, in that when typing
> >>
> >>   > install.packages("_ANY_PACKAGE_")
> >>
> >> I get the message
> >> Warning message:
> >> package ‘_ANY_PACKAGE_’ is not available (for R version 3.2.3)
> >>
> >> But I can download the .zip file and unzip it..
> >>
> >> I tried different CRAN mirrors...
> >>
> >> best,
> >> vito
> >>
> >>
> >> Il 09/02/2016 12.44, Sekhar Venkatesan ha scritto:
> >>>
> >>> Dear Mr. Murdoch,
> >>> I am extremely sorry to have sent the mail to you instead of R-help.
> >>> Thanks
> >>> for directing me.
> >>> I have downloaded R 3.2.3 version. After that i asked for
> >>> install.packages("Rcmdr") . It says that Rcmdr is not available with
> >>> version 3.2.3. On looking at the pdf file for getting started with
> >>> R, i found that i should download with SDI Graphical interface which
> >>> I did once again but still i could not get the Rcmdr console.
> >>> I attended a workshop where the faculty brought out the R console as
> >>> well as the R-commander console where i could import files and also
> >>> do all the statistics easily. I am not getting the R-commander console.
> >>> Shall be grateful if i could get help on getting the R-commander
> >>> console with the user friendly way of doing the statistical operations.
> >>> Thanks and regards,
> >>> Once again apologize to Dr. Duncan Murdoch for disturbing him.
> >>> Sekhar
> >>>
> >>> On Mon, Feb 8, 2016 at 8:56 PM, Duncan Murdoch
> >>> <murdoch.dun...@gmail.com>
> >

[R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Nasim Hasan
Dear All,
  I am Nasim Hasan a CS Student of New Mexico State 
University(NMSU). I am using R for my course work on the topics of Big-Data. My 
OS is Windows Seven and I using R's windows  version of 3.0.2 along with the 
R-Studio of version 0.98.495.
  The problem is that, I can not use prettyTree() for plotting a 
Tree.Though, I have included the library function of rpart and also downloaded 
as well as installed the package of rpart.So, can anyone kindly tell me that 
what is the problem..??What else should I need to do in order to use 
prettyTree()...?? or are there any packages, which can be used as the 
substitute of prettyTree()...??
 Please, notify me about those.Thanks to all of you in 
advance!!!

Best Regards,
Nasim Hasan
CS Dept. Student
NMSU


[[alternative HTML version deleted]]

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


Re: [R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Prof Brian Ripley
You seem to be under the impression that prettyTree() is something to do 
with package rpart: it is not.


You need to ask the person who told you about prettyTree() where to find it.

On 09/02/2014 07:49, Nasim Hasan wrote:

Dear All,
   I am Nasim Hasan a CS Student of New Mexico State 
University(NMSU). I am using R for my course work on the topics of Big-Data. My 
OS is Windows Seven and I using R's windows  version of 3.0.2 along with the 
R-Studio of version 0.98.495.
   The problem is that, I can not use prettyTree() for plotting a 
Tree.Though, I have included the library function of rpart and also downloaded 
as well as installed the package of rpart.So, can anyone kindly tell me that 
what is the problem..??What else should I need to do in order to use 
prettyTree()...?? or are there any packages, which can be used as the 
substitute of prettyTree()...??
  Please, notify me about those.Thanks to all of you in 
advance!!!

Best Regards,
Nasim Hasan
CS Dept. Student
NMSU


[[alternative HTML version deleted]]

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


PLEASE do.



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

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


Re: [R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Ista Zahn
On Sun, Feb 9, 2014 at 7:20 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote:
 You seem to be under the impression that prettyTree() is something to do
 with package rpart: it is not.

 You need to ask the person who told you about prettyTree() where to find it.

OR:

install.packages(sos)
library(sos)
findFn(prettyTree)

Best,
Ista


 On 09/02/2014 07:49, Nasim Hasan wrote:

 Dear All,
I am Nasim Hasan a CS Student of New Mexico State
 University(NMSU). I am using R for my course work on the topics of Big-Data.
 My OS is Windows Seven and I using R's windows  version of 3.0.2 along with
 the R-Studio of version 0.98.495.
The problem is that, I can not use prettyTree() for
 plotting a Tree.Though, I have included the library function of rpart and
 also downloaded as well as installed the package of rpart.So, can anyone
 kindly tell me that what is the problem..??What else should I need to do in
 order to use prettyTree()...?? or are there any packages, which can be used
 as the substitute of prettyTree()...??
   Please, notify me about those.Thanks to all of you in
 advance!!!

 Best Regards,
 Nasim Hasan
 CS Dept. Student
 NMSU


 [[alternative HTML version deleted]]

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


 PLEASE do.



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


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

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


Re: [R] Help required for using the prettyTree() to plot a regression tree graphically.......!!!!!!

2014-02-09 Thread Prof Brian Ripley

On 09/02/2014 15:52, Ista Zahn wrote:

On Sun, Feb 9, 2014 at 7:20 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote:

You seem to be under the impression that prettyTree() is something to do
with package rpart: it is not.

You need to ask the person who told you about prettyTree() where to find it.


OR:

install.packages(sos)
library(sos)
findFn(prettyTree)


That answer assumes it is from a CRAN package ... it could equally be in 
some local course notes/package.


For plotting trees from rpart there is a third-party package rpart.plot 
(but that does not supply prettyTree).




Best,
Ista



On 09/02/2014 07:49, Nasim Hasan wrote:


Dear All,
I am Nasim Hasan a CS Student of New Mexico State
University(NMSU). I am using R for my course work on the topics of Big-Data.
My OS is Windows Seven and I using R's windows  version of 3.0.2 along with
the R-Studio of version 0.98.495.
The problem is that, I can not use prettyTree() for
plotting a Tree.Though, I have included the library function of rpart and
also downloaded as well as installed the package of rpart.So, can anyone
kindly tell me that what is the problem..??What else should I need to do in
order to use prettyTree()...?? or are there any packages, which can be used
as the substitute of prettyTree()...??
   Please, notify me about those.Thanks to all of you in
advance!!!

Best Regards,
Nasim Hasan
CS Dept. Student
NMSU


 [[alternative HTML version deleted]]

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



PLEASE do.



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


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



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

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


Re: [R] Help required graphing factors with predicted model settings

2013-10-11 Thread Michael Friendly
On 10/10/2013 11:33 PM, Rebecca Stirnemann wrote:
 Hi Michael,
 Thanks! That worked. Which is so brilliant!
 A couple of questions. In regards to display.
 Do you know how to add labels on to the graph? The code below doesn't 
 work.
Not surprising, since your data, mao1, is not in the lme4 package, and 
you didn't provide it.
 Also is it possible some how to add all three lines onto one graph and 
 some how tell it to display things without colours?
For the example I gave you, multiline=TRUE will plot all curves in a 
single graph.
You have to learn how to read the help pages to find answers to such 
questions.

plot(Effect(c(recipe, temperature), fm1), colors=rep(black,3), 
multiline=TRUE)
# put the legend inside the plot
plot(Effect(c(recipe, temperature), fm1), colors=rep(black,3), 
multiline=TRUE, key.args=list(x=.10, y=.80))

 Thanks soo much!
 Rebecca

 library(effects)

 ?effect


 library(lme4)

 data(mao1,package=lme4)

 fm1-glm(frat~flandusenumb+ ground.cover_lo+(1|fsite),mao1,

  REML=FALSE)

 plot(effect(frat:ground.cover_lo,fm1, xlab=Low ground cover (%) ,

  ylab=Proportion of nests predated,),grid=TRUE)

 plot(Effect(c(flandusenumb,ground.cover_lo),fm1))# equivalent




 On Fri, Oct 11, 2013 at 1:41 AM, Michael Friendly frien...@yorku.ca 
 mailto:frien...@yorku.ca wrote:

 Perhaps you are looking for the effects package, which can plot
 effects
 (predicted values) for terms in mer objects from lme4?

 library(effects)
 ?effect

 library(lme4)
 data(cake, package=lme4)
 fm1 - lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake,
REML = FALSE)
 plot(effect(recipe:temperature, fm1), grid=TRUE)
 plot(Effect(c(recipe, temperature), fm1)) # equivalent



 On 10/10/2013 12:52 AM, Rebecca Stirnemann wrote:

 Thanks Jim for helping,

 Your sample data actually looks like my dataset. The one I put
 up looks
 strange for some reason so please ignore that.
 I have three landusenumb variables 1 2 and 3. is rep (1,2,3)
 correct?

 When I run the following code I am getting:

 mod1 - glmer(frat ~ flandusenumb + ground.cover_lo +
 (1|fsite) ,family =

 binomial, data= mao1)


 #Calculate predicted values
 newdata1 - data.frame(ground.cover_lo = c(25,50,100),
 flandusenumb =

 rep(1,2,3))

 pred34 - predict(mod1,newdata=newdata1,type=response)


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

 Can you see what I am doing wrong?
 What I am aiming for is a graph which looks like this.

 Thanks
 Rebecca






 On Thu, Oct 10, 2013 at 5:33 PM, Jim Lemon j...@bitwrit.com.au
 mailto:j...@bitwrit.com.au wrote:

 On 10/10/2013 08:35 AM, Rebecca Stirnemann wrote:

 Dear R wizards,

 Though I hate to do it after weeks of my code not
 working I need some help
 since I cant find an example which seems to work.
 I am trying to create a graph which show the
 probability of predation of a
 nest on one side (either 1 to 0) or (0% to 100%) on
 one side
 and grass height at the bottom. I want to then add my
 predicted lines from
 my glmr onto the graph for three habitat types.

 I would like to repeat this procedure 3 times for
 three different grass
 heights 25- 50- 100 to see the effect size.

 My data:
  landusenumb landuse sitename rat ground.cover_lo
  1  plantation
 far.leftroad_LHS 0 60  1 plantation far.leftroad_LHS 1
 70  1 plantation
 far.leftroad_LHS 1 10  1 plantation far.leftroad_LHS 1
 30  1 plantation
 far.leftroad_LHS 1 50  1 plantation far.leftroad_LHS 0
 20  1 plantation
 far.leftroad_LHS 0 70  1 plantation far.leftroad_LHS 0
 100  1 plantation
 far.leftroad_LHS 0 90

 #Graph


 #Fit model

 mod1- glmer(frat ~ flandusenumb + ground.cover_lo +
 (1|fsite) ,family =
 binomial, data= mao1)


 #Calculate predicted values

 newdata1- data.frame(ground.cover_lo =
 seq(0,10,length=100), flandusenumb
 = rep(1,2,3))

 pred34- predict(mod1,newdata=newdata1,**type=response)



 #Plot model predicted curves

 
 plot(c(0,100),c(0,1),type=n,**xlab=grasscover,ylab=**Probability
 of
 predation)

 

Re: [R] Help required graphing factors with predicted model settings

2013-10-10 Thread Michael Friendly

Perhaps you are looking for the effects package, which can plot effects
(predicted values) for terms in mer objects from lme4?

library(effects)
?effect

library(lme4)
data(cake, package=lme4)
fm1 - lmer(angle ~ recipe * temperature + (1|recipe:replicate), cake,
   REML = FALSE)
plot(effect(recipe:temperature, fm1), grid=TRUE)
plot(Effect(c(recipe, temperature), fm1)) # equivalent


On 10/10/2013 12:52 AM, Rebecca Stirnemann wrote:

Thanks Jim for helping,

Your sample data actually looks like my dataset. The one I put up looks
strange for some reason so please ignore that.
I have three landusenumb variables 1 2 and 3. is rep (1,2,3) correct?

When I run the following code I am getting:


mod1 - glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =

binomial, data= mao1)


#Calculate predicted values
newdata1 - data.frame(ground.cover_lo = c(25,50,100), flandusenumb =

rep(1,2,3))

pred34 - predict(mod1,newdata=newdata1,type=response)


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

Can you see what I am doing wrong?
What I am aiming for is a graph which looks like this.

Thanks
Rebecca






On Thu, Oct 10, 2013 at 5:33 PM, Jim Lemon j...@bitwrit.com.au wrote:


On 10/10/2013 08:35 AM, Rebecca Stirnemann wrote:


Dear R wizards,

Though I hate to do it after weeks of my code not working I need some help
since I cant find an example which seems to work.
I am trying to create a graph which show the probability of predation of a
nest on one side (either 1 to 0) or (0% to 100%) on one side
and grass height at the bottom. I want to then add my predicted lines from
my glmr onto the graph for three habitat types.

I would like to repeat this procedure 3 times for three different grass
heights 25- 50- 100 to see the effect size.

My data:
 landusenumb landuse sitename rat ground.cover_lo  1  plantation
far.leftroad_LHS 0 60  1 plantation far.leftroad_LHS 1 70  1 plantation
far.leftroad_LHS 1 10  1 plantation far.leftroad_LHS 1 30  1 plantation
far.leftroad_LHS 1 50  1 plantation far.leftroad_LHS 0 20  1 plantation
far.leftroad_LHS 0 70  1 plantation far.leftroad_LHS 0 100  1 plantation
far.leftroad_LHS 0 90

#Graph


#Fit model

mod1- glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =
binomial, data= mao1)


#Calculate predicted values

newdata1- data.frame(ground.cover_lo = seq(0,10,length=100), flandusenumb
= rep(1,2,3))

pred34- predict(mod1,newdata=newdata1,**type=response)



#Plot model predicted curves

plot(c(0,100),c(0,1),type=n,**xlab=grasscover,ylab=**Probability of
predation)

lines(newdata1$frat,pred34,**lwd=3,col=blue)


  Hi Rebecca,

First, your sample data are a bit mangled, and should look like this:

mao1

landusenumb landusesitename rat ground.cover_lo
1   plantation far.leftroad_LHS   0  60
1   plantation far.leftroad_LHS   1  70
1   plantation far.leftroad_LHS   1  10
1   plantation far.leftroad_LHS   1  30
1   plantation far.leftroad_LHS   1  50
1   plantation far.leftroad_LHS   0  20
1   plantation far.leftroad_LHS   0  70
1   plantation far.leftroad_LHS   0 100
1   plantation far.leftroad_LHS   0  90

If you want the predicted values with ground cover as above, then:

ground.cover_lo = c(25,50,100)

The variable names in the first model don't match those in the data frame,
but I assume these were typos. What does pred34 look like? This will tell
you what function you should be using to plot it.

Jim








--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.  Chair, Quantitative Methods
York University  Voice: 416 736-2100 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

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


[R] Help required graphing factors with predicted model settings

2013-10-09 Thread Rebecca Stirnemann
Dear R wizards,

Though I hate to do it after weeks of my code not working I need some help
since I cant find an example which seems to work.
I am trying to create a graph which show the probability of predation of a
nest on one side (either 1 to 0) or (0% to 100%) on one side
and grass height at the bottom. I want to then add my predicted lines from
my glmr onto the graph for three habitat types.

I would like to repeat this procedure 3 times for three different grass
heights 25- 50- 100 to see the effect size.

My data:
   landusenumb landuse sitename rat ground.cover_lo  1  plantation
far.leftroad_LHS 0 60  1 plantation far.leftroad_LHS 1 70  1 plantation
far.leftroad_LHS 1 10  1 plantation far.leftroad_LHS 1 30  1 plantation
far.leftroad_LHS 1 50  1 plantation far.leftroad_LHS 0 20  1 plantation
far.leftroad_LHS 0 70  1 plantation far.leftroad_LHS 0 100  1 plantation
far.leftroad_LHS 0 90

#Graph


#Fit model

mod1 - glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =
binomial, data= mao1)


#Calculate predicted values

newdata1 - data.frame(ground.cover_lo = seq(0,10,length=100), flandusenumb
= rep(1,2,3))

pred34 - predict(mod1,newdata=newdata1,type=response)



#Plot model predicted curves

plot(c(0,100),c(0,1),type=n,xlab=grasscover,ylab=Probability of
predation)

lines(newdata1$frat,pred34,lwd=3,col=blue)


-- 
www.samoanbirds.com

[[alternative HTML version deleted]]

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


Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Jim Lemon

On 10/10/2013 08:35 AM, Rebecca Stirnemann wrote:

Dear R wizards,

Though I hate to do it after weeks of my code not working I need some help
since I cant find an example which seems to work.
I am trying to create a graph which show the probability of predation of a
nest on one side (either 1 to 0) or (0% to 100%) on one side
and grass height at the bottom. I want to then add my predicted lines from
my glmr onto the graph for three habitat types.

I would like to repeat this procedure 3 times for three different grass
heights 25- 50- 100 to see the effect size.

My data:
landusenumb landuse sitename rat ground.cover_lo  1  plantation
far.leftroad_LHS 0 60  1 plantation far.leftroad_LHS 1 70  1 plantation
far.leftroad_LHS 1 10  1 plantation far.leftroad_LHS 1 30  1 plantation
far.leftroad_LHS 1 50  1 plantation far.leftroad_LHS 0 20  1 plantation
far.leftroad_LHS 0 70  1 plantation far.leftroad_LHS 0 100  1 plantation
far.leftroad_LHS 0 90

#Graph


#Fit model

mod1- glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =
binomial, data= mao1)


#Calculate predicted values

newdata1- data.frame(ground.cover_lo = seq(0,10,length=100), flandusenumb
= rep(1,2,3))

pred34- predict(mod1,newdata=newdata1,type=response)



#Plot model predicted curves

plot(c(0,100),c(0,1),type=n,xlab=grasscover,ylab=Probability of
predation)

lines(newdata1$frat,pred34,lwd=3,col=blue)



Hi Rebecca,
First, your sample data are a bit mangled, and should look like this:

mao1
landusenumb landusesitename rat ground.cover_lo
1   plantation far.leftroad_LHS   0  60
1   plantation far.leftroad_LHS   1  70
1   plantation far.leftroad_LHS   1  10
1   plantation far.leftroad_LHS   1  30
1   plantation far.leftroad_LHS   1  50
1   plantation far.leftroad_LHS   0  20
1   plantation far.leftroad_LHS   0  70
1   plantation far.leftroad_LHS   0 100
1   plantation far.leftroad_LHS   0  90

If you want the predicted values with ground cover as above, then:

ground.cover_lo = c(25,50,100)

The variable names in the first model don't match those in the data 
frame, but I assume these were typos. What does pred34 look like? This 
will tell you what function you should be using to plot it.


Jim

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


Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Rebecca Stirnemann
Thanks Jim for helping,

Your sample data actually looks like my dataset. The one I put up looks
strange for some reason so please ignore that.
I have three landusenumb variables 1 2 and 3. is rep (1,2,3) correct?

When I run the following code I am getting:

 mod1 - glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =
binomial, data= mao1)

 #Calculate predicted values
 newdata1 - data.frame(ground.cover_lo = c(25,50,100), flandusenumb =
rep(1,2,3))
 pred34 - predict(mod1,newdata=newdata1,type=response)

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

Can you see what I am doing wrong?
What I am aiming for is a graph which looks like this.

Thanks
Rebecca






On Thu, Oct 10, 2013 at 5:33 PM, Jim Lemon j...@bitwrit.com.au wrote:

 On 10/10/2013 08:35 AM, Rebecca Stirnemann wrote:

 Dear R wizards,

 Though I hate to do it after weeks of my code not working I need some help
 since I cant find an example which seems to work.
 I am trying to create a graph which show the probability of predation of a
 nest on one side (either 1 to 0) or (0% to 100%) on one side
 and grass height at the bottom. I want to then add my predicted lines from
 my glmr onto the graph for three habitat types.

 I would like to repeat this procedure 3 times for three different grass
 heights 25- 50- 100 to see the effect size.

 My data:
 landusenumb landuse sitename rat ground.cover_lo  1  plantation
 far.leftroad_LHS 0 60  1 plantation far.leftroad_LHS 1 70  1 plantation
 far.leftroad_LHS 1 10  1 plantation far.leftroad_LHS 1 30  1 plantation
 far.leftroad_LHS 1 50  1 plantation far.leftroad_LHS 0 20  1 plantation
 far.leftroad_LHS 0 70  1 plantation far.leftroad_LHS 0 100  1 plantation
 far.leftroad_LHS 0 90

 #Graph


 #Fit model

 mod1- glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =
 binomial, data= mao1)


 #Calculate predicted values

 newdata1- data.frame(ground.cover_lo = seq(0,10,length=100), flandusenumb
 = rep(1,2,3))

 pred34- predict(mod1,newdata=newdata1,**type=response)



 #Plot model predicted curves

 plot(c(0,100),c(0,1),type=n,**xlab=grasscover,ylab=**Probability of
 predation)

 lines(newdata1$frat,pred34,**lwd=3,col=blue)


  Hi Rebecca,
 First, your sample data are a bit mangled, and should look like this:

 mao1

 landusenumb landusesitename rat ground.cover_lo
 1   plantation far.leftroad_LHS   0  60
 1   plantation far.leftroad_LHS   1  70
 1   plantation far.leftroad_LHS   1  10
 1   plantation far.leftroad_LHS   1  30
 1   plantation far.leftroad_LHS   1  50
 1   plantation far.leftroad_LHS   0  20
 1   plantation far.leftroad_LHS   0  70
 1   plantation far.leftroad_LHS   0 100
 1   plantation far.leftroad_LHS   0  90

 If you want the predicted values with ground cover as above, then:

 ground.cover_lo = c(25,50,100)

 The variable names in the first model don't match those in the data frame,
 but I assume these were typos. What does pred34 look like? This will tell
 you what function you should be using to plot it.

 Jim




-- 
www.samoanbirds.com

[[alternative HTML version deleted]]

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


Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Rebecca Stirnemann
But with three lines for the three habitat types and grass length at the
bottom




On Thu, Oct 10, 2013 at 5:52 PM, Rebecca Stirnemann
rstirnem...@gmail.comwrote:

 Thanks Jim for helping,

 Your sample data actually looks like my dataset. The one I put up looks
 strange for some reason so please ignore that.
 I have three landusenumb variables 1 2 and 3. is rep (1,2,3) correct?

 When I run the following code I am getting:

  mod1 - glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family
 = binomial, data= mao1)
 
  #Calculate predicted values
  newdata1 - data.frame(ground.cover_lo = c(25,50,100), flandusenumb =
 rep(1,2,3))
  pred34 - predict(mod1,newdata=newdata1,type=response)

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

 Can you see what I am doing wrong?
 What I am aiming for is a graph which looks like this.

 Thanks
 Rebecca






 On Thu, Oct 10, 2013 at 5:33 PM, Jim Lemon j...@bitwrit.com.au wrote:

 On 10/10/2013 08:35 AM, Rebecca Stirnemann wrote:

 Dear R wizards,

 Though I hate to do it after weeks of my code not working I need some
 help
 since I cant find an example which seems to work.
 I am trying to create a graph which show the probability of predation of
 a
 nest on one side (either 1 to 0) or (0% to 100%) on one side
 and grass height at the bottom. I want to then add my predicted lines
 from
 my glmr onto the graph for three habitat types.

 I would like to repeat this procedure 3 times for three different grass
 heights 25- 50- 100 to see the effect size.

 My data:
 landusenumb landuse sitename rat ground.cover_lo  1  plantation
 far.leftroad_LHS 0 60  1 plantation far.leftroad_LHS 1 70  1 plantation
 far.leftroad_LHS 1 10  1 plantation far.leftroad_LHS 1 30  1 plantation
 far.leftroad_LHS 1 50  1 plantation far.leftroad_LHS 0 20  1 plantation
 far.leftroad_LHS 0 70  1 plantation far.leftroad_LHS 0 100  1 plantation
 far.leftroad_LHS 0 90

 #Graph


 #Fit model

 mod1- glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite) ,family =
 binomial, data= mao1)


 #Calculate predicted values

 newdata1- data.frame(ground.cover_lo = seq(0,10,length=100),
 flandusenumb
 = rep(1,2,3))

 pred34- predict(mod1,newdata=newdata1,**type=response)



 #Plot model predicted curves

 plot(c(0,100),c(0,1),type=n,**xlab=grasscover,ylab=**Probability of
 predation)

 lines(newdata1$frat,pred34,**lwd=3,col=blue)


  Hi Rebecca,
 First, your sample data are a bit mangled, and should look like this:

 mao1

 landusenumb landusesitename rat ground.cover_lo
 1   plantation far.leftroad_LHS   0  60
 1   plantation far.leftroad_LHS   1  70
 1   plantation far.leftroad_LHS   1  10
 1   plantation far.leftroad_LHS   1  30
 1   plantation far.leftroad_LHS   1  50
 1   plantation far.leftroad_LHS   0  20
 1   plantation far.leftroad_LHS   0  70
 1   plantation far.leftroad_LHS   0 100
 1   plantation far.leftroad_LHS   0  90

 If you want the predicted values with ground cover as above, then:

 ground.cover_lo = c(25,50,100)

 The variable names in the first model don't match those in the data
 frame, but I assume these were typos. What does pred34 look like? This
 will tell you what function you should be using to plot it.

 Jim




 --
 www.samoanbirds.com




-- 
www.samoanbirds.com

[[alternative HTML version deleted]]

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


Re: [R] Help required graphing factors with predicted model settings

2013-10-09 Thread Jim Lemon

On 10/10/2013 03:52 PM, Rebecca Stirnemann wrote:

Thanks Jim for helping,

Your sample data actually looks like my dataset. The one I put up looks
strange for some reason so please ignore that.
I have three landusenumb variables 1 2 and 3. is rep (1,2,3) correct?

When I run the following code I am getting:

  mod1 - glmer(frat ~ flandusenumb + ground.cover_lo + (1|fsite)
,family = binomial, data= mao1)
 
  #Calculate predicted values
  newdata1 - data.frame(ground.cover_lo = c(25,50,100), flandusenumb =
rep(1,2,3))
  pred34 - predict(mod1,newdata=newdata1,type=response)

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

Can you see what I am doing wrong?
What I am aiming for is a graph which looks like this.

Thanks
Rebecca

Okay, so you aren't getting anything to plot. You will have to send your 
plot image directly to me, as R-help scrubs most images from emails.


I assume that landusenumb is the occasion of measurement (i.e. you 
have three repeated measurements). Perhaps you could calculate the three 
values from the initial model, remembering that the logarithm of the 
odds of predation is your response.


Jim

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


[R] Help required in using apply instead of for loop

2012-01-31 Thread arunkumar1111
Hi

I have  a function

y= x^2

min =10
max=20
increment=0.1

I want to find the value of y for the value of x between min and max by step
increment.

how to get the values using apply function instead of for loop

-
Thanks in Advance
Arun
--
View this message in context: 
http://r.789695.n4.nabble.com/Help-required-in-using-apply-instead-of-for-loop-tp4344350p4344350.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] Help required in using apply instead of for loop

2012-01-31 Thread Carlos Ortega
Hi,

You can do that even without apply():

v.v-seq(10,20, by=0.1)

y-v.v^2


But if you want it with apply...

apply(as.matrix(v.v), 1, function(x) x^2)


Regards,
Carlos Ortega
www.qualityexcellence.es



2012/1/31 arunkumar akpbond...@gmail.com

 Hi

 I have  a function

 y= x^2

 min =10
 max=20
 increment=0.1

 I want to find the value of y for the value of x between min and max by
 step
 increment.

 how to get the values using apply function instead of for loop

 -
 Thanks in Advance
Arun
 --
 View this message in context:
 http://r.789695.n4.nabble.com/Help-required-in-using-apply-instead-of-for-loop-tp4344350p4344350.html
 Sent from the R help mailing list archive at Nabble.com.

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


[[alternative HTML version deleted]]

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


[R] help required for GO Annotation problem

2011-06-28 Thread suman pal
Hello,
I basically want to use R-help, and post some problems which I am facing. The 
Ref is a well known Genome Biology paper Bioconductor: open software 
development for computational biology and bioinformatics by Robert C Gentleman 
et al., 2004. Generating Heatmaps till Fig2 is working so I think esetSel is 
not the problem..
However, for generating the Figure 3, for GO annotations the following command 
is not working:
 ll - mget(geneNames(esetSel),hgu95av2LOCUSID)   
#it is displaying error messages  Error in mget(geneNames(esetSel), 
hgu95av2LOCUSID) : object 'hgu95av2LOCUSID' not foundand also geneNames not 
found try featureNames instead
Hence I cant proceed to the next set of commands provided in the paper which 
are as follows:
 ll - unique(unlist(ll)) mf - as.data.frame(GOHyperG(ll))[, 1:3] mf - 
 mf[mf$pvalue  0.01, ]
sincerelySumanCCMB Hyderabad.

[[alternative HTML version deleted]]

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


Re: [R] help required for GO Annotation problem

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 5:34 AM, suman pal wrote:


Hello,
I basically want to use R-help, and post some problems which I am  
facing. The Ref is a well known Genome Biology paper Bioconductor:  
open software development for computational biology and  
bioinformatics by Robert C Gentleman et al., 2004. Generating  
Heatmaps till Fig2 is working so I think esetSel is not the problem..
However, for generating the Figure 3, for GO annotations the  
following command is not working:

ll - mget(geneNames(esetSel),hgu95av2LOCUSID)
#it is displaying error messages  Error in mget(geneNames(esetSel),  
hgu95av2LOCUSID) : object 'hgu95av2LOCUSID' not foundand also  
geneNames not found try featureNames instead


You seem to be missing a data object. A google search produces this as  
the third hit that suggest you are attempting to run outdate ... well  
it is 7 years old ... code:


http://www.rforge.net/bin/results/compton/2.1/data/annotation/hgu95av2-00check.html

Hence I cant proceed to the next set of commands provided in the  
paper which are as follows:
ll - unique(unlist(ll)) mf - as.data.frame(GOHyperG(ll))[, 1:3]  
mf - mf[mf$pvalue  0.01, ]

sincerelySumanCCMB Hyderabad.

This would seem a natural question for the BoConductor mailing list...  
after you do a bit more basic searching.




[[alternative HTML version deleted]]

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


David Winsemius, MD
West Hartford, CT

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


Re: [R] help required for GO Annotation problem

2011-06-28 Thread James W. MacDonald

Hi Suman,

On 6/28/2011 10:02 AM, David Winsemius wrote:


On Jun 28, 2011, at 5:34 AM, suman pal wrote:


Hello,
I basically want to use R-help, and post some problems which I am
facing. The Ref is a well known Genome Biology paper Bioconductor:
open software development for computational biology and
bioinformatics by Robert C Gentleman et al., 2004. Generating
Heatmaps till Fig2 is working so I think esetSel is not the problem..
However, for generating the Figure 3, for GO annotations the following
command is not working:

ll - mget(geneNames(esetSel),hgu95av2LOCUSID)

#it is displaying error messages Error in mget(geneNames(esetSel),
hgu95av2LOCUSID) : object 'hgu95av2LOCUSID' not foundand also
geneNames not found try featureNames instead


As David notes, this question is better asked on the BioC listserv. And 
it is really old code. The LOCUSID object has been deprecated for a long 
time now, replaced by ENTREZID, and as the warning notes, geneNames() 
has been deprecated in favor of featureNames.


So try

ll - mget(featureNames(esetSel), hgu95av2ENTREZID)

also GOHyperG() is gone as well, replaced by S4 methods that might be a 
bit less easy to figure out. I don't have the book you are working 
through, but you would be better served if you were to use the vignettes 
that come with the packages you are using instead (or at least as a way 
to get updated examples of how to use the package).


Anyway, please direct all future questions about BioC packages to the 
BioC listserv.


Best,

Jim




You seem to be missing a data object. A google search produces this as
the third hit that suggest you are attempting to run outdate ... well it
is 7 years old ... code:

http://www.rforge.net/bin/results/compton/2.1/data/annotation/hgu95av2-00check.html



Hence I cant proceed to the next set of commands provided in the paper
which are as follows:

ll - unique(unlist(ll)) mf - as.data.frame(GOHyperG(ll))[, 1:3]
mf - mf[mf$pvalue  0.01, ]

sincerelySumanCCMB Hyderabad.


This would seem a natural question for the BoConductor mailing list...
after you do a bit more basic searching.



[[alternative HTML version deleted]]

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


David Winsemius, MD
West Hartford, CT

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


--
James W. MacDonald, M.S.
Biostatistician
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
734-615-7826
**
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues 


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


Re: [R] Help required

2011-04-12 Thread Steve Lianoglou
Hi Sadaf,

Out of curiosity, what sorts of things have you tried to fix this?

For example, after playing around with this a bit, if I remove your
eps parameter from your `ranges` list, it works.

Perhaps you should try tweaking the values you pick for your
parameters. You don't even have to put it in the `tune` function to
get an idea of the ranges you should use:

R m=svm(Rexp ~ ., data=retrain, epsilon=10)Error in predict.svm(ret,
xhold, decision.values = TRUE) :
  Model is empty!

See? I think if you do a bit of exploration of the parameter space,
you'll get it to work.

-steve

On Mon, Apr 11, 2011 at 10:50 PM, Sadaf Zaidi s.zaidi...@amu.ac.in wrote:
 Dear Sir,
 Thanks for ur prompt reply. The details are:
 1) I had an excel data file. I converted it into .csv file and loaded it into 
 R.
 2) then I invoked e-1071 package and used the following code to tune the svm.
 retune-tune(svm, Rexp~.,data=retrain, 
 ranges=list(gamma=c(2^-10,2^-8,2^-6,2^-4, 2^-2,
 2^0, 2^1, 2^2, 2^3), cost=c(0.1,0.4,0.6,0.8,1.0,1.2,1.4),
 eps=10^(2:1)),tunecontrol=tune.control(sampling=cross)).
 3) I got the following error message.
 Error in predict.svm(ret, xhold, decision.values = TRUE) :
  Model is empty!
 4) 10 random data as per your instructions are:
 structure(list(Peb = c(225.0282, 514.4835, 66.6346, 221.4287,
 366.8782, 429.7749, 161.9826, 124.2772, 98.63578, 160.9544),
   Ksub = c(7.892368, 21.07559, 66.61676, 43.01224, 113.7249,
   2.642293, 4.475745, 113.4638, 43.69712, 46.29462), Sub = c(50,
   30, 98.96, 73.96, 77.43, 30, 100, 99.65, 100, 96.88), Xtt = c(6.632812,
   0.751595, 5.664743, 1.630639, 1.49907, 26.39829, 11.07653,
   3.319892, 8.356013, 4.484025), Rexp = c(78433.04, 14106,
   4670.345, 9326.914, 3519.494, 573554.6, 27154.07, 3695.473,
   14582.2, 13297.71)), .Names = c(Peb, Ksub, Sub, Xtt,
 Rexp), row.names = c(300L, 196L, 70L, 150L, 31L, 319L, 251L,
 40L, 200L, 191L), class = data.frame)

 Please help.

 SADAF ZAIDI

 Department of
 Aligarh Muslim University
 Aligarh 202002.


 Department of
 Aligarh Muslim University
 Aligarh 202002.





-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

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


[R] Help required for rpart package

2011-03-04 Thread Muralidharan Somasundaram
Hi,

I am trying to model credit risk data using decision trees. Since the 
number of defaulters is less compared to non-defaulters (defaulters around 
10%), we have the class imbalance problem. Consequently, the confusion 
matrix shows that the number of misclassified non-defaulters is large. 
Classifying a defaulter as non-defaulter is more expensive. How does one 
include this information (penalty matrix) into rpart function?

Thanks and regards,
Dr S Muralidharan
Chief Scientist,
Tata Consultancy Services
17, Cathedral Road,
Chennai - 600 086,Tamil Nadu
India
Ph:- 91 44 66164513
Buzz:- 444 4513
Mailto: muralidharan.somasunda...@tcs.com
Website: http://www.tcs.com

Experience certainty.   IT Services
Business Solutions
Outsourcing

=-=-=
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you



[[alternative HTML version deleted]]

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


Re: [R] Help required: binomial option pricing using package

2010-12-25 Thread Tal Galili
Hi Sonal,

The example you gave is not reproducible since we don't have data as you
do.
However, here is an example of how to access the object you are after:

tmp - CRRBinomialTreeOption(TypeFlag = pa, S = 50, X = 50,
 Time = 5/12, r = 0.1, b = 0.1, sigma = 0.4, n = 5)

t...@price

Cheers,
Tal

Contact
Details:---
Contact me: tal.gal...@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
--




On Fri, Dec 24, 2010 at 6:51 AM, sonal sonal.sar...@arxaa.com wrote:


 I'm using the CRRBinomialTreeOption function (in package fOptions) with a
 loop for pricing a large number of options. But I can't transfer the values
 obtained from this function to a numeric matrix as the outcome of this
 function is not a simple numeric.

 The following is the piece of code:

 # USING THE FUNCTION
 library(fOptions)
 option.price-matrix(nrow=250,ncol=9)
 for(j in 1:9){for(i in 1:250)

 {option.price[i,j]=CRRBinomialTreeOption(TypeFlag=ca,S=data[(i+250),j],X=data[j,19],Time=T[i,j],r=data[i
 ,(9+j)],b=0,sigma=sig[i,j],n=5)}}

 R output:
 Error in option.price[i, j] = CRRBinomialTreeOption(TypeFlag = ca, S =
 data[(i +  :
  object of type 'S4' is not subsettable

 I'm very new to R and can't find a solution with my knowledge at this
 moment. Plz help.

 --
 View this message in context:
 http://r.789695.n4.nabble.com/Help-required-binomial-option-pricing-using-package-tp3162935p3162935.html
 Sent from the R help mailing list archive at Nabble.com.

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


[[alternative HTML version deleted]]

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


[R] Help required: binomial option pricing using package

2010-12-23 Thread sonal

I'm using the CRRBinomialTreeOption function (in package fOptions) with a
loop for pricing a large number of options. But I can't transfer the values
obtained from this function to a numeric matrix as the outcome of this
function is not a simple numeric.

The following is the piece of code:

# USING THE FUNCTION
library(fOptions)
option.price-matrix(nrow=250,ncol=9)
for(j in 1:9){for(i in 1:250)   
   
{option.price[i,j]=CRRBinomialTreeOption(TypeFlag=ca,S=data[(i+250),j],X=data[j,19],Time=T[i,j],r=data[i
,(9+j)],b=0,sigma=sig[i,j],n=5)}} 

R output:
Error in option.price[i, j] = CRRBinomialTreeOption(TypeFlag = ca, S =
data[(i +  : 
  object of type 'S4' is not subsettable

I'm very new to R and can't find a solution with my knowledge at this
moment. Plz help.

-- 
View this message in context: 
http://r.789695.n4.nabble.com/Help-required-binomial-option-pricing-using-package-tp3162935p3162935.html
Sent from the R help mailing list archive at Nabble.com.

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


[R] Help required to remove \\N

2010-11-06 Thread Mohan L
Dear All,

I have .csv file it looks like this :
rawdata - read.csv(file='/home/Mohan/Rworks/tmp/VMList_User.txt',sep='\t'
, header=FALSE)

 head(rawdata,n=5)
  TenantDomain Owner  Current State
1\\N  ROOTadmin Running
2\\N  ROOTadmin Stopped
3\\N  ROOTadmin Running
4\\N  ROOTadmin Running
5\\N ROOTadmin Running
20  DEMO   ROOTadmin Stopped
21  DEMOROOT   admin Stopped
22  Demo ROOT   admin Stopped


The first column contain the \\n up to 19 row. I need to replace the
\\N value to  Blankspace .  Any help will  really appreciated.

Thanks for your time.

Thanks  Rg
Mohan L

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


Re: [R] Help required to remove \\N

2010-11-06 Thread Henrique Dallazuanna
Try this:

gsub(N, BlankSpace, rawdata$Tenant)

On Sat, Nov 6, 2010 at 8:15 AM, Mohan L l.mohanphys...@gmail.com wrote:

 Dear All,

 I have .csv file it looks like this :
 rawdata - read.csv(file='/home/Mohan/Rworks/tmp/VMList_User.txt',sep='\t'
 , header=FALSE)

  head(rawdata,n=5)
  TenantDomain Owner  Current State
 1\\N  ROOTadmin Running
 2\\N  ROOTadmin Stopped
 3\\N  ROOTadmin Running
 4\\N  ROOTadmin Running
 5\\N ROOTadmin Running
 20  DEMO   ROOTadmin Stopped
 21  DEMOROOT   admin Stopped
 22  Demo ROOT   admin Stopped


 The first column contain the \\n up to 19 row. I need to replace the
 \\N value to  Blankspace .  Any help will  really appreciated.

 Thanks for your time.

 Thanks  Rg
 Mohan L

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




-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O

[[alternative HTML version deleted]]

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


Re: [R] Help required

2010-09-26 Thread Renaud Lancelot
In a context of spatial analysis, see also readGDAL in package rgdal:

library(rgdal)
logo - system.file(pictures/logo.jpg, package=rgdal)[1]
x - readGDAL(logo)
image(x)

Renaud


2010/9/25 Prof Brian Ripley rip...@stats.ox.ac.uk:
 On Sat, 25 Sep 2010, Malik Shahzad wrote:


 Is it possible to read jpeg files into R?

 If yes please guide, Thanks.. I tried to search many time but failed to
 do.

 On my system ??jpeg gave

 ReadImages::read.jpeg   Read JPEG file
 biOps::readJpeg         Read jpeg file
 rimage::read.jpeg       Read JPEG file

 There are a number of other possibilities, including
 EBImage::readImage from Bioconductor which uses ImageMagick to convert the
 file format (and that or many other image convertors could be used in a
 simple R wrapper).


 Thankis in advance..

 with Best Regards,

 Malik Shahzad
 Visiting Researcher
 National Institute of Informatics (NII)
 Tokyo, Japan

 Doctoral Student
 Asian Institute of Technology (AIT)
 Bangkok, Thailand
 +66-8-7676-5616




        [[alternative HTML version deleted]]

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


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

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

-- 
Renaud Lancelot
EDEN Project, coordinator
http://www.eden-fp6project.net/

UMR CIRAD-INRA Contrôle des maladies animales exotiques et émergentes
Joint research unit Control of emerging and exotic animal diseases

CIRAD, Campus International de Baillarguet TA A-DIR / B
F34398 Montpellier
http://umr-cmaee.cirad.fr/

Tel.  +33 4 67 59 37 17  -  Fax  +33 4 67 59 37 95
Secr. +33 4 67 59 37 37  - Cell. +33 6 77 52 08 69

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


[R] Help required

2010-09-25 Thread Malik Shahzad

Is it possible to read jpeg files into R?

If yes please guide, Thanks.. I tried to search many time but failed to do.

Thankis in advance..

with Best Regards,
 
Malik Shahzad
Visiting Researcher
National Institute of Informatics (NII)
Tokyo, Japan
 
Doctoral Student
Asian Institute of Technology (AIT)
Bangkok, Thailand
+66-8-7676-5616



  
[[alternative HTML version deleted]]

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


Re: [R] Help required

2010-09-25 Thread Ben Bolker
Malik Shahzad geomalik at live.com writes:

 
 
 Is it possible to read jpeg files into R?
 
 If yes please guide, Thanks.. I tried to search many time but failed to do.
 

install.packages(sos)
library(sos)
findFn(read jpeg)

(I initially tried findFn(import jpeg) and didn't
get any hits, then tried findFn(jpeg) and scrolled
down to find these results)

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


Re: [R] Help required

2010-09-25 Thread Prof Brian Ripley

On Sat, 25 Sep 2010, Malik Shahzad wrote:



Is it possible to read jpeg files into R?

If yes please guide, Thanks.. I tried to search many time but failed to do.


On my system ??jpeg gave

ReadImages::read.jpeg   Read JPEG file
biOps::readJpeg Read jpeg file
rimage::read.jpeg   Read JPEG file

There are a number of other possibilities, including
EBImage::readImage from Bioconductor which uses ImageMagick to convert 
the file format (and that or many other image convertors could be used 
in a simple R wrapper).




Thankis in advance..

with Best Regards,

Malik Shahzad
Visiting Researcher
National Institute of Informatics (NII)
Tokyo, Japan

Doctoral Student
Asian Institute of Technology (AIT)
Bangkok, Thailand
+66-8-7676-5616




[[alternative HTML version deleted]]

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



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

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


[R] help required to melt a data frame

2010-05-25 Thread Mohan L
I have the raw data with 9 column and 197977 row:

 dummy
   State Months Bedroom
1xxxJan   1
2xxxJan   2
3xxxJan   1
4yyyJan   1
5yyyJan   2
6yyyJan   1
7zzzJan   3
8zzzJan   1
9zzzJan   2
10   xxxFeb   3
11   xxxFeb   4
12   xxxFeb   2
13   yyyFeb   1
14   yyyFeb   2
15   yyyFeb   1
16   zzzFeb   2
17   zzzFeb   3
18   zzzFeb   3

 dim(rawdata)
[1] 197977  9

I want to do some calculation on the State Months Bedroom. So I am
picking only three column using subset.

 subsets.dummy - subset(dummy, select=c(State,Months,Bedroom))
 subsets.dummy
   State Months Bedroom
1xxxJan   1
2xxxJan   2
3xxxJan   1
4yyyJan   1
5yyyJan   2
6yyyJan   1
7zzzJan   3
8zzzJan   1
9zzzJan   2
10   xxxFeb   3
11   xxxFeb   4
12   xxxFeb   2
13   yyyFeb   1
14   yyyFeb   2
15   yyyFeb   1
16   zzzFeb   0
17   zzzFeb   3
18   zzzFeb   3

From the above data. I want below table for 1,2,3,4 Bedroom.
Ex : for 1 Bedroom, I need how may(count of 1 Bedroom) 1 Bedroom is there in
a particular state for month wise.

State  Jan Feb
 xxx   20
 yyy   22
 zzz   10

for 2 Bedroom :
State  Jan Feb
 xxx   11
 yyy   11
 zzz   10

I want to melt subsets.dummy data for the above requirement. To achive
this I am doing like this:

melt.data.frame(subsets.dummy,id.vars=c(State,Bedroom),measure.vars=Months)
   State Bedroom variable value
1xxx   1   Months   Jan
2xxx   2   Months   Jan
3xxx   1   Months   Jan
4yyy   1   Months   Jan
5yyy   2   Months   Jan
6yyy   1   Months   Jan
7zzz   3   Months   Jan
8zzz   1   Months   Jan
9zzz   2   Months   Jan
10   xxx   3   Months   Feb
11   xxx   4   Months   Feb
12   xxx   2   Months   Feb
13   yyy   1   Months   Feb
14   yyy   2   Months   Feb
15   yyy   1   Months   Feb
16   zzz   2   Months   Feb
17   zzz   3   Months   Feb
18   zzz   3   Months   Feb

I trying to get a new data frame for 1 bedroom using cast. But I am not able
to get the below data for 1 Bedroom using cost.

State  Jan Feb
 xxx   20
 yyy   22
 zzz   10

I not able to understand how to cost it.  any help will be greatly
appreciated.

Thanks  Rg
Mohan L

[[alternative HTML version deleted]]

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


Re: [R] help required state wise count

2010-05-25 Thread Jim Lemon

On 05/24/2010 10:21 PM, Mohan L wrote:

...
in this case the state column becomes the row index. I want the state
name as the first column. There may be a way to do it.


Hi Mohan,
You can do it with this awful kludge, but there must be a better way:

dummy-data.frame(
 State=sample(c(NSW,NT,QLD,SA,TAS,WA),100,TRUE),
 Month=sample(c(Jan,Feb,Mar,Apr,May,Jun,
  Jul,Aug,Sep,Oct,Nov,Dec),100,TRUE))
dummytab-table(dummy$State,dummy$Month)
dfdummytab-data.frame(State=rownames(dummytab),
 Jan=dummytab[,5],Feb=dummytab[,4],Mar=dummytab[,8],
 Apr=dummytab[,1],May=dummytab[,9],Jun=dummytab[,7],
 Jul=dummytab[,6],Aug=dummytab[,2],Sep=dummytab[,12],
 Oct=dummytab[,11],Nov=dummytab[,10],Dec=dummytab[,3])
rownames(dfdummytab)-NULL

Jim

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Hadley Wickham
 I trying to get a new data frame for 1 bedroom using cast. But I am not able
 to get the below data for 1 Bedroom using cost.

 State  Jan Feb
  xxx   2    0
  yyy   2    2
  zzz   1    0

What do those numbers represent?

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Mohan L
On Tue, May 25, 2010 at 6:59 PM, Hadley Wickham had...@rice.edu wrote:

  I trying to get a new data frame for 1 bedroom using cast. But I am not
 able
  to get the below data for 1 Bedroom using cost.
 
  State  Jan Feb
   xxx   20
   yyy   22
   zzz   10

 What do those numbers represent?

 Hadley


The raw data is  real estate  property portal data. the numbers represent
how many 1 Bedroom house has registered in xxx state on particular months.
Then we will normalize the data and plot the graph for trend analysis.

Thanks  Rg
Mohan L

[[alternative HTML version deleted]]

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Hadley Wickham
On Tue, May 25, 2010 at 8:39 AM, Mohan L l.mohan...@gmail.com wrote:


 On Tue, May 25, 2010 at 6:59 PM, Hadley Wickham had...@rice.edu wrote:

  I trying to get a new data frame for 1 bedroom using cast. But I am not
  able
  to get the below data for 1 Bedroom using cost.
 
  State  Jan Feb
   xxx   2    0
   yyy   2    2
   zzz   1    0

 What do those numbers represent?

 Hadley


 The raw data is  real estate  property portal data. the numbers represent
 how many 1 Bedroom house has registered in xxx state on particular months.
 Then we will normalize the data and plot the graph for trend analysis.

In that case, you probably want:

subsets.melt - melt(subsets.dummy,id.vars=c(State,Bedroom, Months))
cast(subsets.melt, State ~ Months, fill = 0, fun = length)

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Mohan L

 In that case, you probably want:

 subsets.melt - melt(subsets.dummy,id.vars=c(State,Bedroom, Months))
 cast(subsets.melt, State ~ Months, fill = 0, fun = length)

 Hadley


Dear Hadley,

 subsets.melt - melt(subsets.dummy,id.vars=c(State,Bedroom, Months))
 subsets.melt
   State Bedroom Months
1xxx   1Jan
2xxx   2Jan
3xxx   1Jan
4yyy   1Jan
5yyy   2Jan
6yyy   1Jan
7zzz   3Jan
8zzz   1Jan
9zzz   2Jan
10   xxx   3Feb
11   xxx   4Feb
12   xxx   2Feb
13   yyy   1Feb
14   yyy   2Feb
15   yyy   1Feb
16   zzz   2Feb
17   zzz   3Feb
18   zzz   3Feb
 cast(subsets.melt, State ~ Months, fill = 0, fun = length)

It show some thing like this :

Using Months as value column.  Use the value argument to cast to override
this choice
Error in `[.data.frame`(data, , variables, drop = FALSE) :
  undefined columns selected

Thanks
Mohan L

[[alternative HTML version deleted]]

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Wu Gong

Do you mean count frequency of One Bedroom?

table(dummy[dummy$Bedroom==1,][,1:2])

-
A R learner.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/help-required-to-melt-a-data-frame-tp2229633p2230260.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Wu Gong

Hope it helps this time:)

### Package reshape, function melt and cast
### Read table
dummy - read.table(textConnection(State Months Bedroom
1xxxJan   1
2xxxJan   2
3xxxJan   1
4yyyJan   1
5yyyJan   2
6yyyJan   1
7zzzJan   3
8zzzJan   1
9zzzJan   2
10   xxxFeb   3
11   xxxFeb   4
12   xxxFeb   2
13   yyyFeb   1
14   yyyFeb   2
15   yyyFeb   1
16   zzzFeb   2
17   zzzFeb   3
18   zzzFeb   3 ))

## Melt
melt.dummy - melt.data.frame(dummy,id.vars=c(State,Bedroom),
measure.vars=Months)

## Cast
cast(melt.dummy, State + Bedroom ~ value,length)

-
A R learner.
-- 
View this message in context: 
http://r.789695.n4.nabble.com/help-required-to-melt-a-data-frame-tp2229633p2230729.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] help required to melt a data frame

2010-05-25 Thread Mohan L
On Tue, May 25, 2010 at 9:35 PM, Wu Gong gho...@gmail.com wrote:


 Do you mean count frequency of One Bedroom?

 table(dummy[dummy$Bedroom==1,][,1:2])


Dear learner,

Thanks for you time.

Yes, that is what I am trying to archive using  melt and cost.  any way it
works for me . Thanks for your help.


Thanks  Rg
Mohan L

[[alternative HTML version deleted]]

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


[R] help required state wise count

2010-05-24 Thread Mohan L
I have the data like this:

 dummy
   State Months No
1xxxJan  1
2xxxJan  2
3xxxJan  1
4yyyJan  1
5yyyJan  2
6yyyJan  1
7zzzJan  3
8zzzJan  1
9zzzJan  2
10   xxxFeb  3
11   xxxFeb  4
12   xxxFeb  2
13   yyyFeb  1
14   yyyFeb  2
15   yyyFeb  1
16   zzzFeb  2
17   zzzFeb  3
18   zzzFeb  3

I want for a month Jan how many count(row) is there for xxx and yyy.some
thing like this:

State Jan  Feb  Mar
xxx   3 3
yyy   3 3
zzz   3 3

Any clue will be greatly appreciated

Thanks  Rg
Mohan L

[[alternative HTML version deleted]]

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


Re: [R] help required state wise count

2010-05-24 Thread Jim Lemon

On 05/24/2010 07:44 PM, Mohan L wrote:

I have the data like this:


dummy

State Months No
1xxxJan  1
2xxxJan  2
3xxxJan  1
4yyyJan  1
5yyyJan  2
6yyyJan  1
7zzzJan  3
8zzzJan  1
9zzzJan  2
10   xxxFeb  3
11   xxxFeb  4
12   xxxFeb  2
13   yyyFeb  1
14   yyyFeb  2
15   yyyFeb  1
16   zzzFeb  2
17   zzzFeb  3
18   zzzFeb  3

I want for a month Jan how many count(row) is there for xxx and yyy.some
thing like this:

State Jan  Feb  Mar
xxx   3 3
yyy   3 3
zzz   3 3


Hi Mohan,
Try this:

table(dummy$State,dummy$Months)

Jim

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


Re: [R] help required state wise count

2010-05-24 Thread Mohan L

  Hi Mohan,
 Try this:

 table(dummy$State,dummy$Months)

 Jim

 Thanks for your time.
table(dummy$State,dummy$Months)

in this case the state column becomes the row index. I want the state name
as the first column. There may be a way to do it.

Thanks  Rg
Mohan L

[[alternative HTML version deleted]]

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


Re: [R] help required state wise count

2010-05-24 Thread David Winsemius


On May 24, 2010, at 8:21 AM, Mohan L wrote:



Hi Mohan,

Try this:

table(dummy$State,dummy$Months)

Jim

Thanks for your time.

table(dummy$State,dummy$Months)

in this case the state column becomes the row index. I want the  
state name

as the first column. There may be a way to do it.


?as.data.frame



Thanks  Rg
Mohan L


David Winsemius, MD
West Hartford, CT

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


Re: [R] Help required with png graphic production as text has shadows?

2010-04-13 Thread Karl Ove Hufthammer
Alice Johnstone wrote:

 I have produced a series of graphs with the png command, however when I
 have finally printed these out the black text appears to have a colour
 shadow with blue or red on either side of the letter.

What you’re seeing is likely subpixel antialiasing. How to ‘fix’ this 
depends on your platform. For Windows, I believe you have to turn off 
ClearType for fonts. For Linux, see ?X11.options.

-- 
Karl Ove Hufthammer

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


Re: [R] Help required with png graphic production as text has shadows?

2010-04-13 Thread Greg Snow
Are you resizing the graphs at all?  This can cause the shadows/blur, it is 
best to create the graphs at the exact size that you will end up using them so 
that there is no resizing (though I would not trust word to not resize even if 
you tell it not to).  You may also want to try producing wmf files as they are 
vector based, but can be included in word and other ms products (but could 
suffer the same size issues as pdf).

When pdf files are much larger than png files, it is usually because you are 
plotting many points and there is much overplotting, if that is the case, then 
you may want to try some different types of plots, for example, boxplots, 
hexbin plots, sunflower plots, or others.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Alice Johnstone
 Sent: Monday, April 12, 2010 9:41 PM
 To: r-help@R-project.org
 Subject: [R] Help required with png graphic production as text has
 shadows?
 
 I have produced a series of graphs with the png command, however when I
 have finally printed these out the black text appears to have a colour
 shadow with blue or red on either side of the letter.
 I tried increasing my res to 1200 and this improved it somewhat, but
 the text is still not sharp and occassionally these shadows will
 still print.
 
 I initially thought this was an issue with the printer.. But I can
 produce a pdf image and it is sharp.  However as I have 50+ images I
 want to include in a word document the pdf files are much too large and
 was the reason I was using png.
 
 I am using an older version of R, but didn't want to upgrade as this
 may cause issues with my completed analyses and the potential changes
 to other functions.
 
 Can someone suggest what it is I have missed?
 Thank you very much.
 
 Alice Johnstone
 
 Example code:
 Png(volcano.png,units=cm,height=15,width=15,res=1200,pointsize=12)
 Volcano2(fit2.eb,coef=2,highlight=5,xlab=log fold change,ylab=log
 odds,pch=16,cex=0.5, main=Volcano Plot,xlim=c(-2,2))
 Dev.off()
 
 
  sessionInfo()
 R version 2.8.0 (2008-10-20)
 i386-pc-mingw32
 
 locale:
 LC_COLLATE=English_New Zealand.1252;LC_CTYPE=English_New
 Zealand.1252;LC_MONETARY=English_New
 Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252
 
 attached base packages:
  [1] grid  splines   tools stats graphics  grDevices utils
  [8] datasets  methods   base
 
 other attached packages:
  [1] affyQCReport_1.20.0   arrayQualityMetrics_1.8.1
  [3] marray_1.20.0 beadarray_1.10.0
  [5] hwriter_0.93  latticeExtra_0.5-4
  [7] simpleaffy_2.18.0 affyPLM_1.18.0
  [9] preprocessCore_1.4.0  RColorBrewer_1.0-2
 [11] vsn_3.8.0 genefilter_1.22.0
 [13] survival_2.34-1   geneplotter_1.20.0
 [15] annotate_1.20.0   xtable_1.5-4
 [17] lattice_0.17-15   sma_0.5.15
 [19] rat2302probe_2.3.0rat2302cdf_2.3.0
 [21] rat2302.db_2.2.5  RSQLite_0.7-1
 [23] DBI_0.2-4 AnnotationDbi_1.4.0
 [25] MASS_7.2-44   gcrma_2.14.0
 [27] matchprobes_1.14.0affy_1.20.0
 [29] Biobase_2.2.0 limma_2.16.2
 [31] gplots_2.6.0  gdata_2.4.2
 [33] gtools_2.5.0
 
 loaded via a namespace (and not attached):
 [1] affyio_1.10.0  KernSmooth_2.22-22
 
 P Think before you print
 This e-mail transmission and any attachments that accompany it may
 contain information that is privileged, confidential or otherwise
 exempt from disclosure under applicable law and is intended solely for
 the use of the individual(s) to whom it was intended to be addressed.
 If you have received this e-mail by mistake, or you are not the
 intended recipient, any disclosure, dissemination, distribution,
 copying or other use or retention of this communication or its
 substance is prohibited. If you have received this communication in
 error, please immediately reply to the author via e-mail that you
 received this message by mistake and also permanently delete the
 original and all copies of this e-mail and any attachments from your
 computer. Thank you.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.

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


Re: [R] Help required with png graphic production as text has shadows?

2010-04-13 Thread Alice Johnstone
Hi Greg

Thank you, the wmf version looks much better in Word and prints out lovely. The 
file size is very large for the volcano plots, but the other graphs are smaller 
than the png ones.  I wasn't resizing the png's but I think word was definitely 
changing them.  I only have six volcano plots so hopefully word will manage 
when I convert them all.

Thanks again
Alice


-Original Message-
From: Greg Snow [mailto:greg.s...@imail.org]
Sent: Wednesday, 14 April 2010 1:59 a.m.
To: Alice Johnstone; r-help@R-project.org
Subject: RE: Help required with png graphic production as text has shadows?

Are you resizing the graphs at all?  This can cause the shadows/blur, it is 
best to create the graphs at the exact size that you will end up using them so 
that there is no resizing (though I would not trust word to not resize even if 
you tell it not to).  You may also want to try producing wmf files as they are 
vector based, but can be included in word and other ms products (but could 
suffer the same size issues as pdf).

When pdf files are much larger than png files, it is usually because you are 
plotting many points and there is much overplotting, if that is the case, then 
you may want to try some different types of plots, for example, boxplots, 
hexbin plots, sunflower plots, or others.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Alice Johnstone
 Sent: Monday, April 12, 2010 9:41 PM
 To: r-help@R-project.org
 Subject: [R] Help required with png graphic production as text has
 shadows?

 I have produced a series of graphs with the png command, however when I
 have finally printed these out the black text appears to have a colour
 shadow with blue or red on either side of the letter.
 I tried increasing my res to 1200 and this improved it somewhat, but
 the text is still not sharp and occassionally these shadows will
 still print.

 I initially thought this was an issue with the printer.. But I can
 produce a pdf image and it is sharp.  However as I have 50+ images I
 want to include in a word document the pdf files are much too large and
 was the reason I was using png.

 I am using an older version of R, but didn't want to upgrade as this
 may cause issues with my completed analyses and the potential changes
 to other functions.

 Can someone suggest what it is I have missed?
 Thank you very much.

 Alice Johnstone

 Example code:
 Png(volcano.png,units=cm,height=15,width=15,res=1200,pointsize=12)
 Volcano2(fit2.eb,coef=2,highlight=5,xlab=log fold change,ylab=log
 odds,pch=16,cex=0.5, main=Volcano Plot,xlim=c(-2,2))
 Dev.off()


  sessionInfo()
 R version 2.8.0 (2008-10-20)
 i386-pc-mingw32

 locale:
 LC_COLLATE=English_New Zealand.1252;LC_CTYPE=English_New
 Zealand.1252;LC_MONETARY=English_New
 Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252

 attached base packages:
  [1] grid  splines   tools stats graphics  grDevices utils
  [8] datasets  methods   base

 other attached packages:
  [1] affyQCReport_1.20.0   arrayQualityMetrics_1.8.1
  [3] marray_1.20.0 beadarray_1.10.0
  [5] hwriter_0.93  latticeExtra_0.5-4
  [7] simpleaffy_2.18.0 affyPLM_1.18.0
  [9] preprocessCore_1.4.0  RColorBrewer_1.0-2
 [11] vsn_3.8.0 genefilter_1.22.0
 [13] survival_2.34-1   geneplotter_1.20.0
 [15] annotate_1.20.0   xtable_1.5-4
 [17] lattice_0.17-15   sma_0.5.15
 [19] rat2302probe_2.3.0rat2302cdf_2.3.0
 [21] rat2302.db_2.2.5  RSQLite_0.7-1
 [23] DBI_0.2-4 AnnotationDbi_1.4.0
 [25] MASS_7.2-44   gcrma_2.14.0
 [27] matchprobes_1.14.0affy_1.20.0
 [29] Biobase_2.2.0 limma_2.16.2
 [31] gplots_2.6.0  gdata_2.4.2
 [33] gtools_2.5.0

 loaded via a namespace (and not attached):
 [1] affyio_1.10.0  KernSmooth_2.22-22

 P Think before you print
 This e-mail transmission and any attachments that accompany it may
 contain information that is privileged, confidential or otherwise
 exempt from disclosure under applicable law and is intended solely for
 the use of the individual(s) to whom it was intended to be addressed.
 If you have received this e-mail by mistake, or you are not the
 intended recipient, any disclosure, dissemination, distribution,
 copying or other use or retention of this communication or its
 substance is prohibited. If you have received this communication in
 error, please immediately reply to the author via e-mail that you
 received this message by mistake and also permanently delete the
 original and all copies of this e-mail and any attachments from your
 computer. Thank you.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read

[R] Help required with png graphic production as text has shadows?

2010-04-12 Thread Alice Johnstone
I have produced a series of graphs with the png command, however when I have 
finally printed these out the black text appears to have a colour shadow with 
blue or red on either side of the letter.
I tried increasing my res to 1200 and this improved it somewhat, but the text 
is still not sharp and occassionally these shadows will still print.

I initially thought this was an issue with the printer.. But I can produce a 
pdf image and it is sharp.  However as I have 50+ images I want to include in a 
word document the pdf files are much too large and was the reason I was using 
png.

I am using an older version of R, but didn't want to upgrade as this may cause 
issues with my completed analyses and the potential changes to other functions.

Can someone suggest what it is I have missed?
Thank you very much.

Alice Johnstone

Example code:
Png(volcano.png,units=cm,height=15,width=15,res=1200,pointsize=12)
Volcano2(fit2.eb,coef=2,highlight=5,xlab=log fold change,ylab=log 
odds,pch=16,cex=0.5, main=Volcano Plot,xlim=c(-2,2))
Dev.off()


 sessionInfo()
R version 2.8.0 (2008-10-20)
i386-pc-mingw32

locale:
LC_COLLATE=English_New Zealand.1252;LC_CTYPE=English_New 
Zealand.1252;LC_MONETARY=English_New 
Zealand.1252;LC_NUMERIC=C;LC_TIME=English_New Zealand.1252

attached base packages:
 [1] grid  splines   tools stats graphics  grDevices utils
 [8] datasets  methods   base

other attached packages:
 [1] affyQCReport_1.20.0   arrayQualityMetrics_1.8.1
 [3] marray_1.20.0 beadarray_1.10.0
 [5] hwriter_0.93  latticeExtra_0.5-4
 [7] simpleaffy_2.18.0 affyPLM_1.18.0
 [9] preprocessCore_1.4.0  RColorBrewer_1.0-2
[11] vsn_3.8.0 genefilter_1.22.0
[13] survival_2.34-1   geneplotter_1.20.0
[15] annotate_1.20.0   xtable_1.5-4
[17] lattice_0.17-15   sma_0.5.15
[19] rat2302probe_2.3.0rat2302cdf_2.3.0
[21] rat2302.db_2.2.5  RSQLite_0.7-1
[23] DBI_0.2-4 AnnotationDbi_1.4.0
[25] MASS_7.2-44   gcrma_2.14.0
[27] matchprobes_1.14.0affy_1.20.0
[29] Biobase_2.2.0 limma_2.16.2
[31] gplots_2.6.0  gdata_2.4.2
[33] gtools_2.5.0

loaded via a namespace (and not attached):
[1] affyio_1.10.0  KernSmooth_2.22-22

P Think before you print
This e-mail transmission and any attachments that accompany it may contain 
information that is privileged, confidential or otherwise exempt from 
disclosure under applicable law and is intended solely for the use of the 
individual(s) to whom it was intended to be addressed.
If you have received this e-mail by mistake, or you are not the intended 
recipient, any disclosure, dissemination, distribution, copying or other use or 
retention of this communication or its substance is prohibited. If you have 
received this communication in error, please immediately reply to the author 
via e-mail that you received this message by mistake and also permanently 
delete the original and all copies of this e-mail and any attachments from your 
computer. Thank you.

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


[R] Help required with NLME syntax

2009-12-07 Thread Surujbally, Bernie
Hi there,
 
I am attempting to analyse data from a crossover study using a mixed
effect Emax model in R using nlme. I am having problems ascertaining how
to fit the model.
 
Subjects are randomly assigned to 1 of 4 treatments in a complete block
design. The response variable of interest is recorded once within each
period. So, subjects have a response for each period.
 
Specifically, I want to fit fixed effects: two continuous baseline
covariates (base1 and base2) and period which has levels 1-4. Subject
will be fitted as a random variable.
 
I have started with the 3 parameter Emax model using nls, with no other
covariates and no random term. The syntax of this I know to be correct.
When I progress to nlme, firstly fitting subject as random, I get
nonsensical answers for Emax and ED50. Even if I was getting reasonable
answers at this point, I am not sure how I specify period, a co-factor
in the model?
 
Hoping someone can help.
 
Many thanks in advance.
 
B Surujbally
 
 

 LEGAL NOTICE 
 
 Unless expressly stated otherwise, this message is confidential and
 may be privileged. It is intended for the addressee(s) only. Access
to 
 this e-mail by anyone else is unauthorised. If you are not an 
 addressee, any disclosure or copying of the contents of this e-mail
or 
 any action taken (or not taken) in reliance on it is unauthorised
and 
 may be unlawful. If you are not an addressee, please inform the
sender 
 immediately. 
 
 Pfizer Limited is registered in England under No. 526209 with its 
 registered office at Ramsgate Road, Sandwich, Kent CT13 9NJ  

 

[[alternative HTML version deleted]]

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


[R] Help required to install package from a website

2008-12-14 Thread Eamonn O'Brien
Hi,
I am new to R and I'm looking to perform some method comparison
analysis and would be grateful for some help regarding package
installation.
There is a package 'MethComp' that I want to use
(http://staff.pubhealth.ku.dk/~bxc/MethComp/Courses/Sthm.2007/.)
Unfortunately I am unable to install it. I have tried numerous
approaches but to no avail. this is the first time I have tried to
install a package 'outside' of R. My operating system is Windows XP.

Here's one attempt that does not work:

where=http://staff.pubhealth.ku.dk/~bxc/MethComp/Archive/?C=M;O=D;

install.packages(MethComp_0.4.1.tar.gz,contriburl=where)

Warning messages:
1: In read.dcf(file = tmpf) ... :
  Line starting '!DOCTYPE HTML PUBLI ...' is malformed!
2: In read.dcf(file = tmpf) ... : Line starting 'html ...' is malformed!
3: In read.dcf(file = tmpf) ... : Line starting ' head ...' is malformed!
4: In read.dcf(file = tmpf) ... :
  Line starting '  titleIndex of /~ ...' is malformed!
5: In read.dcf(file = tmpf) ... : Line starting ' /head ...' is malformed!
6: In read.dcf(file = tmpf) ... : Line starting ' body ...' is malformed!
7: In read.dcf(file = tmpf) ... :
  Line starting 'h1Index of /~bxc/M ...' is malformed!
8: In read.dcf(file = tmpf) ... :
  Line starting 'preimg src=/icon ...' is malformed!
9: In read.dcf(file = tmpf) ... : Line starting 'hr/pre ...' is malformed!
10: In read.dcf(file = tmpf) ... :
  Line starting 'addressApache/2.0. ...' is malformed!
11: In read.dcf(file = tmpf) ... : Line starting '/body/html ...'
is malformed!

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


Re: [R] Help required to install package from a website

2008-12-14 Thread Ben Bolker



Eamonn O'Brien wrote:
 
 Hi,
 I am new to R and I'm looking to perform some method comparison
 analysis and would be grateful for some help regarding package
 installation.
 There is a package 'MethComp' that I want to use
 (http://staff.pubhealth.ku.dk/~bxc/MethComp/Courses/Sthm.2007/.)
 Unfortunately I am unable to install it. I have tried numerous
 approaches but to no avail. this is the first time I have tried to
 install a package 'outside' of R. My operating system is Windows XP.
 
 Here's one attempt that does not work:
 
 where=http://staff.pubhealth.ku.dk/~bxc/MethComp/Archive/?C=M;O=D;
 
 install.packages(MethComp_0.4.1.tar.gz,contriburl=where)
 
 Warning messages:
 1: In read.dcf(file = tmpf) ... :
   Line starting '!DOCTYPE HTML PUBLI ...' is malformed!
 2: In read.dcf(file = tmpf) ... : Line starting 'html ...' is malformed!
 3: In read.dcf(file = tmpf) ... : Line starting ' head ...' is
 malformed!
 4: In read.dcf(file = tmpf) ... :
   Line starting '  titleIndex of /~ ...' is malformed!
 5: In read.dcf(file = tmpf) ... : Line starting ' /head ...' is
 malformed!
 6: In read.dcf(file = tmpf) ... : Line starting ' body ...' is
 malformed!
 7: In read.dcf(file = tmpf) ... :
   Line starting 'h1Index of /~bxc/M ...' is malformed!
 8: In read.dcf(file = tmpf) ... :
   Line starting 'pre /icon ...' is malformed!
9: In read.dcf(file = tmpf) ... : Line starting 'hr /pre ...' is
malformed!
 10: In read.dcf(file = tmpf) ... :
   Line starting 'addressApache/2.0. ...' is malformed!
 11: In read.dcf(file = tmpf) ... : Line starting '/body/html ...'
 is malformed!
 

Download MethComp_0.1.19.zip  from the web site
(assuming you are using Windows) and use the Install
local packages option under the File (?) menu
-- 
View this message in context: 
http://www.nabble.com/Help-required-to-install-package-from-a-website-tp21000979p21001109.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] Help required to install package from a website

2008-12-14 Thread Eamonn O'Brien
Thanks Ben
Successfully installed.

On Sun, Dec 14, 2008 at 2:59 PM, Ben Bolker bol...@ufl.edu wrote:



 Eamonn O'Brien wrote:

 Hi,
 I am new to R and I'm looking to perform some method comparison
 analysis and would be grateful for some help regarding package
 installation.
 There is a package 'MethComp' that I want to use
 (http://staff.pubhealth.ku.dk/~bxc/MethComp/Courses/Sthm.2007/.)
 Unfortunately I am unable to install it. I have tried numerous
 approaches but to no avail. this is the first time I have tried to
 install a package 'outside' of R. My operating system is Windows XP.

 Here's one attempt that does not work:

 where=http://staff.pubhealth.ku.dk/~bxc/MethComp/Archive/?C=M;O=D;

 install.packages(MethComp_0.4.1.tar.gz,contriburl=where)

 Warning messages:
 1: In read.dcf(file = tmpf) ... :
   Line starting '!DOCTYPE HTML PUBLI ...' is malformed!
 2: In read.dcf(file = tmpf) ... : Line starting 'html ...' is malformed!
 3: In read.dcf(file = tmpf) ... : Line starting ' head ...' is
 malformed!
 4: In read.dcf(file = tmpf) ... :
   Line starting '  titleIndex of /~ ...' is malformed!
 5: In read.dcf(file = tmpf) ... : Line starting ' /head ...' is
 malformed!
 6: In read.dcf(file = tmpf) ... : Line starting ' body ...' is
 malformed!
 7: In read.dcf(file = tmpf) ... :
   Line starting 'h1Index of /~bxc/M ...' is malformed!
 8: In read.dcf(file = tmpf) ... :
   Line starting 'pre /icon ...' is malformed!
 9: In read.dcf(file = tmpf) ... : Line starting 'hr /pre ...' is
 malformed!
 10: In read.dcf(file = tmpf) ... :
   Line starting 'addressApache/2.0. ...' is malformed!
 11: In read.dcf(file = tmpf) ... : Line starting '/body/html ...'
 is malformed!


 Download MethComp_0.1.19.zip  from the web site
 (assuming you are using Windows) and use the Install
 local packages option under the File (?) menu
 --
 View this message in context: 
 http://www.nabble.com/Help-required-to-install-package-from-a-website-tp21000979p21001109.html
 Sent from the R help mailing list archive at Nabble.com.

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


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


[R] Help Required

2007-11-21 Thread Kushal M Shah
Hi Friends

 

I am working on a Financial Model project in R and require help in
writing code for Moving Averages. Since I am very new to R, it would be
good if any seniors in the group can guide me on a proper moving average
code. 

 

Thanks  Best Regards, 

Kushal 

 



The information in this e-mail is the property of Evalue...{{dropped:11}}

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


Re: [R] Help Required

2007-11-21 Thread jim holtman
There is code for moving averages already in R. There is some
information in the 'zoo' package.

?filter

What specifically are you looking for?

On Nov 20, 2007 11:53 PM, Kushal M Shah [EMAIL PROTECTED] wrote:
 Hi Friends



 I am working on a Financial Model project in R and require help in
 writing code for Moving Averages. Since I am very new to R, it would be
 good if any seniors in the group can guide me on a proper moving average
 code.



 Thanks  Best Regards,

 Kushal





 The information in this e-mail is the property of Eval...{{dropped:18}}

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


Re: [R] Help Required in using cast (reshape package) function

2007-11-21 Thread Punit Anand
Hello everyone, 

Since the fields in variables column are unique with respect to ID and
fiscal year; any function like 
sum,min,max,mean etc will lead to the desired result

Therefore cast(dataread, ID + Period ~ variable,sum)
Will lead to the desired result in my case; 

Thanks,
Punit



-Original Message-
From: Punit Anand 
Sent: Wednesday, November 21, 2007 11:21 AM
To: 'r-help@r-project.org'
Subject: Help Required in using cast (reshape package) function

Hello everyone,

I am new to R. I have data in the form of excel pivot table format and I
want to cast it into a format which can make it compatible with
computation. 

Since I already have the package in pivot format; I avoid melt function
and use the cast directly. 
I inspect the 

dataread - read.csv(., header=TRUE)

Data in the format 
Id  Region  Country Industry
Period  variablevalue
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY   account payable 1
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY   account receivable 5
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY     7
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY    NA
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY    
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY    1
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY   ccc 1

# I want to arrange data in the format
Id  Region  Country Industry
Period  account payable   account receivable   Y
    C
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY1  5   7NA   1
1   

# casting the data
cast - cast(dataread, ID + Period ~ variable)

When I do that the data is casted as a pivot with a warning Aggregation
requires fun.aggregate: length used as default, and the casted data
gives me the count of variables (as suggested by the warning )

Id  Region  Country Industry
Period  account payable   account receivable   Y
    C
Aaa11  xx  Latin AmericaMexicofood  beverages
2002:FY1  1   1NA NA  1
1   

How do I use the fun.aggregate feature of the cast function to obtain
the desired result?

Moreover, I want to subdivide the casted data into subsets based on ids.
How do I achieve that?


Thanks in advance,

Punit Anand

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


Re: [R] Help Required in using cast (reshape package) function

2007-11-21 Thread hadley wickham
On 11/21/07, Punit Anand [EMAIL PROTECTED] wrote:
 Hello everyone,

 Since the fields in variables column are unique with respect to ID and
 fiscal year; any function like
 sum,min,max,mean etc will lead to the desired result

You should probably check that, as the warning only occurs when
aggregation is definitely occurring.

 Therefore cast(dataread, ID + Period ~ variable,sum)
 Will lead to the desired result in my case;

If you want a list of data frames by ID, you might also want to try:

cast(dataread, Period ~ variable | ID, sum)

Hadley


 Thanks,
 Punit



 -Original Message-
 From: Punit Anand
 Sent: Wednesday, November 21, 2007 11:21 AM
 To: 'r-help@r-project.org'
 Subject: Help Required in using cast (reshape package) function

 Hello everyone,

 I am new to R. I have data in the form of excel pivot table format and I
 want to cast it into a format which can make it compatible with
 computation.

 Since I already have the package in pivot format; I avoid melt function
 and use the cast directly.
 I inspect the

 dataread - read.csv(., header=TRUE)

 Data in the format
 Id  Region  Country Industry
 Period  variablevalue
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY   account payable 1
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY   account receivable 5
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY     7
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY    NA
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY   
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY    1
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY   ccc 1

 # I want to arrange data in the format
 Id  Region  Country Industry
 Period  account payable   account receivable   Y
     C
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY1  5   7NA   1
 1

 # casting the data
 cast - cast(dataread, ID + Period ~ variable)

 When I do that the data is casted as a pivot with a warning Aggregation
 requires fun.aggregate: length used as default, and the casted data
 gives me the count of variables (as suggested by the warning )

 Id  Region  Country Industry
 Period  account payable   account receivable   Y
     C
 Aaa11  xx  Latin AmericaMexicofood  beverages
 2002:FY1  1   1NA NA  1
 1

 How do I use the fun.aggregate feature of the cast function to obtain
 the desired result?

 Moreover, I want to subdivide the casted data into subsets based on ids.
 How do I achieve that?


 Thanks in advance,

 Punit Anand

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



-- 
http://had.co.nz/

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