[R] argument "string" is missing, with no default

2018-09-08 Thread Shivi Bhatia
Hi All,

I am trying to fetch data from a pdf file with the below code but getting
the error message:
Error in stri_split_regex(string, pattern, n = n, simplify = simplify,  :
  argument "string" is missing, with no default

library(readr)library(stringr)library(magrittr)library(dplyr)
table_data <- nvsr65_05[ [ 14 ] ] %>%
  str_split(pattern = "\n") %>%
  unlist() %>%
  str_subset(pattern = "^[^…].*(\\. ){5}") %>%
  str_c(collapse = "\n") %>%
  read_table(col_names = FALSE) %>%
  mutate(X2 = str_replace_all(X2, "(\\. )*", ""),
 X5 = rep(c("Neonatal", "Postnatal"), each = 10)) %>%
  set_names(value = c("rank", "cause_of_death", "deaths", "percent", "group"))

Please advice. Thank you.

[[alternative HTML version deleted]]

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


Re: [R] NaN in Scoring Sentiment

2018-08-27 Thread Shivi Bhatia
Thanks you Petr. This worked. 
Regards, Shivi 


Sent from Yahoo Mail for iPhone


On Monday, August 27, 2018, 14:31, PIKAL Petr  wrote:

Hi

the output seems to me rather weird. Unles you have NaNs in input data frame 
you should not get NaN as a result.

Anyway, your aggregate will give you NA or NaN even when there is only one NA 
or NaN in your input data frame. So I suggest to use

sentiments_per_Category <- aggregate(relative_sentiment_frequencies,            
                          by = list(Category = df$Case.Category), mean, 
na.rm=TRUE)

This should strip all NAs before calculating mean in each category.

Complete cases removes all lines with at least one NA in your data frame, which 
probably results to empty data frame.

Cheers
Petr

> -Original Message-
> From: R-help  On Behalf Of Shivi Bhatia
> Sent: Saturday, August 25, 2018 4:01 PM
> To: R-help 
> Subject: [R] NaN in Scoring Sentiment
>
> Hi All- I am running a sentiment scoring model and the code is as below:
> sentiments_per_Category <- aggregate(relative_sentiment_frequencies,
>                                      by = list(Category = df$Case.Category), 
>mean)
>
> while i run the head command most of the values are NaN. i then used
> complete.cases on my data frame df[complete.cases(df),]  but it does not seems
> to work. Please advice if there is a way to handle NaN.
>
> Regards, Shivi
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Osobní údaje: Informace o zpracování a ochraně osobních údajů obchodních 
partnerů PRECHEZA a.s. jsou zveřejněny na: 
https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about 
processing and protection of business partner’s personal data are available on 
website: https://www.precheza.cz/en/personal-data-protection-principles/
Důvěrnost: Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a 
podléhají tomuto právně závaznému prohláąení o vyloučení odpovědnosti: 
https://www.precheza.cz/01-dovetek/ | This email and any documents attached to 
it may be confidential and are subject to the legally binding disclaimer: 
https://www.precheza.cz/en/01-disclaimer/





[[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] NaN in Scoring Sentiment

2018-08-25 Thread Shivi Bhatia
Hi All- I am running a sentiment scoring model and the code is as below:
sentiments_per_Category <- aggregate(relative_sentiment_frequencies,
 by = list(Category =
df$Case.Category), mean)

while i run the head command most of the values are NaN. i then used
complete.cases on my data frame
df[complete.cases(df),]
 but it does not seems to work. Please advice if there is a way to handle
NaN.

Regards, Shivi

[[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] Assistance on Installing Rattle

2018-08-14 Thread Shivi Bhatia
Hi Michael Thank you for the reply.I have been looking for 3.5.1 version of 
this package but I cannot find one, would you recommend downgrading my current 
R version. Would there be some or any other compatibly issue - please advice. 
Thank you, Shivi 


Sent from Yahoo Mail for iPhone


On Monday, August 13, 2018, 21:56, Michael Dewey  
wrote:

Dear Shivi

You are running R 3.5.1 according to your session info. Why are you 
installing a version for R 3.3? Note that the up-to-date version depends 
on R > 3.4.0 so it is no surprise that you get problems.

Michael

On 13/08/2018 16:07, Shivi Bhatia wrote:
> Hi Michael,
> 
> I was able to install RGtk2 
> from 
> install.packages("https://cran.r-project.org/bin/windows/contrib/3.3/RGtk2_2.20.31.zip;,
>  
> repos=NULL) but after installing this and trying to install rattle i get 
> this error:
> Error : package 'RGtk2' was installed by an R version with different 
> internals; it needs to be reinstalled for use with this R version
> ERROR: lazy loading failed for package 'rattle'
> 
> I tried installing rattle from install.packages("rattle", 
> repos="https://rattle.togaware.com;, type="source").
> 
> Regards, Shivi
> 
> 
> On Sun, Aug 12, 2018 at 7:20 PM Michael Dewey  <mailto:li...@dewey.myzen.co.uk>> wrote:
> 
>    Dear Shivi
> 
>    What error message do you get when you try to install RGtk2?
> 
>    Michael
> 
>    On 12/08/2018 11:49, Shivi Bhatia wrote:
>      > Hi Eric,
>      >
>      > Thank you for the reply. I am adding the session details below,
>    hope it
>      > helps:
>      > R version 3.5.1 (2018-07-02)
>      > Platform: x86_64-w64-mingw32/x64 (64-bit)
>      > Running under: Windows >= 8 x64 (build 9200)
>      >
>      > Matrix products: default
>      > locale:
>      > [1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252
>      > LC_MONETARY=English_India.1252
>      > [4] LC_NUMERIC=C                   LC_TIME=English_India.1252
>      >
>      > attached base packages:
>      > [1] stats     graphics  grDevices utils     datasets  methods   base
>      >
>      > Thanks.
>      >
>      > On Sat, Aug 11, 2018 at 9:38 PM Eric Berger
>    mailto:ericjber...@gmail.com>> wrote:
>      >
>      >> Hi Shivi,
>      >> I have no experience with the rattle package but I just
>    installed it with
>      >> no problem.
>      >> I am using a Windows 10 machine with R version 3.4.2.
>      >>
>      >> I suggest you provide additional information so that others may
>    have ideas.
>      >> e.g. your operating system version and output from sessionInfo()
>    (in R)
>      >>
>      >> Best,
>      >> Eric
>      >>
>      >>
>      >> On Sat, Aug 11, 2018 at 6:55 PM, Shivi Bhatia
>    mailto:shivipm...@gmail.com>>
>      >> wrote:
>      >>
>      >>> Hi,
>      >>>
>      >>> Need assistance on installing Rattle.
>      >>>
>      >>> I have followed the instructions on https://rattle.togaware.com/
>      >>> but still facing error installing the package.
>      >>> ERROR: dependency 'RGtk2' is not available for package 'rattle'.
>      >>> Have tried installing RGt2 from multiple sources and its still
>    failing.
>      >>>
>      >>> One of the suggestion on stack overflow was to downgrade the R
>    version
>      >>> here
>      >>> :
>      >>>
>      >>>
>    
>https://stackoverflow.com/questions/24913643/downgrade-r-version-no-issues-with-bioconductor-installation
>      >>> Request assistance.
>      >>>
>      >>> Regards, Shivi
>      >>>
>      >>>          [[alternative HTML version deleted]]
>      >>>
>      >>> __
>      >>> R-help@r-project.org <mailto:R-help@r-project.org> mailing list
>    -- To UNSUBSCRIBE and more, see
>      >>> https://stat.ethz.ch/mailman/listinfo/r-help
>      >>> PLEASE do read the posting guide
>      >>> http://www.R-project.org/posting-guide.html
>      >>> and provide commented, minimal, self-contained, reproducible code.
>      >>>
>      >>
>      >>
>      >
>      >       [[alternative HTML version deleted]]
>      >
>      > __
>      > R-help@r-project.org <mailto:R-help@r-project.org> mailing list
>    -- To UNSUBSCRIBE and more, see
>      > https://stat.ethz.ch/mailman/listinfo/r-help
>      > PLEASE do read the posting guide
>    http://www.R-project.org/posting-guide.html
>      > and provide commented, minimal, self-contained, reproducible code.
>      >
> 
>    -- 
>    Michael
>    http://www.dewey.myzen.co.uk/home.html
> 

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




[[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] Assistance on Installing Rattle

2018-08-13 Thread Shivi Bhatia
Hi Michael,

I was able to install RGtk2 from install.packages("
https://cran.r-project.org/bin/windows/contrib/3.3/RGtk2_2.20.31.zip;,
repos=NULL) but after installing this and trying to install rattle i get
this error:
Error : package 'RGtk2' was installed by an R version with different
internals; it needs to be reinstalled for use with this R version
ERROR: lazy loading failed for package 'rattle'

I tried installing rattle from install.packages("rattle", repos="
https://rattle.togaware.com;, type="source").

Regards, Shivi


On Sun, Aug 12, 2018 at 7:20 PM Michael Dewey 
wrote:

> Dear Shivi
>
> What error message do you get when you try to install RGtk2?
>
> Michael
>
> On 12/08/2018 11:49, Shivi Bhatia wrote:
> > Hi Eric,
> >
> > Thank you for the reply. I am adding the session details below, hope it
> > helps:
> > R version 3.5.1 (2018-07-02)
> > Platform: x86_64-w64-mingw32/x64 (64-bit)
> > Running under: Windows >= 8 x64 (build 9200)
> >
> > Matrix products: default
> > locale:
> > [1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252
> > LC_MONETARY=English_India.1252
> > [4] LC_NUMERIC=C   LC_TIME=English_India.1252
> >
> > attached base packages:
> > [1] stats graphics  grDevices utils datasets  methods   base
> >
> > Thanks.
> >
> > On Sat, Aug 11, 2018 at 9:38 PM Eric Berger 
> wrote:
> >
> >> Hi Shivi,
> >> I have no experience with the rattle package but I just installed it
> with
> >> no problem.
> >> I am using a Windows 10 machine with R version 3.4.2.
> >>
> >> I suggest you provide additional information so that others may have
> ideas.
> >> e.g. your operating system version and output from sessionInfo() (in R)
> >>
> >> Best,
> >> Eric
> >>
> >>
> >> On Sat, Aug 11, 2018 at 6:55 PM, Shivi Bhatia 
> >> wrote:
> >>
> >>> Hi,
> >>>
> >>> Need assistance on installing Rattle.
> >>>
> >>> I have followed the instructions on https://rattle.togaware.com/
> >>> but still facing error installing the package.
> >>> ERROR: dependency 'RGtk2' is not available for package 'rattle'.
> >>> Have tried installing RGt2 from multiple sources and its still failing.
> >>>
> >>> One of the suggestion on stack overflow was to downgrade the R version
> >>> here
> >>> :
> >>>
> >>>
> https://stackoverflow.com/questions/24913643/downgrade-r-version-no-issues-with-bioconductor-installation
> >>> Request assistance.
> >>>
> >>> Regards, Shivi
> >>>
> >>>  [[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.
> >
>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>

[[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] Assistance on Installing Rattle

2018-08-12 Thread Shivi Bhatia
Hi Eric,

Thank you for the reply. I am adding the session details below, hope it
helps:
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default
locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252
LC_MONETARY=English_India.1252
[4] LC_NUMERIC=C   LC_TIME=English_India.1252

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

Thanks.

On Sat, Aug 11, 2018 at 9:38 PM Eric Berger  wrote:

> Hi Shivi,
> I have no experience with the rattle package but I just installed it with
> no problem.
> I am using a Windows 10 machine with R version 3.4.2.
>
> I suggest you provide additional information so that others may have ideas.
> e.g. your operating system version and output from sessionInfo() (in R)
>
> Best,
> Eric
>
>
> On Sat, Aug 11, 2018 at 6:55 PM, Shivi Bhatia 
> wrote:
>
>> Hi,
>>
>> Need assistance on installing Rattle.
>>
>> I have followed the instructions on https://rattle.togaware.com/
>> but still facing error installing the package.
>> ERROR: dependency 'RGtk2' is not available for package 'rattle'.
>> Have tried installing RGt2 from multiple sources and its still failing.
>>
>> One of the suggestion on stack overflow was to downgrade the R version
>> here
>> :
>>
>> https://stackoverflow.com/questions/24913643/downgrade-r-version-no-issues-with-bioconductor-installation
>> Request assistance.
>>
>> Regards, Shivi
>>
>> [[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] Assistance on Installing Rattle

2018-08-11 Thread Shivi Bhatia
Hi,

Need assistance on installing Rattle.

I have followed the instructions on https://rattle.togaware.com/
but still facing error installing the package.
ERROR: dependency 'RGtk2' is not available for package 'rattle'.
Have tried installing RGt2 from multiple sources and its still failing.

One of the suggestion on stack overflow was to downgrade the R version here
:
https://stackoverflow.com/questions/24913643/downgrade-r-version-no-issues-with-bioconductor-installation
Request assistance.

Regards, Shivi

[[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] Cannot Load A Package

2018-06-02 Thread Shivi Bhatia
Thank you Dan, this is what i had been searching. Thanks again,

Regards, Shivi

On Sat, Jun 2, 2018 at 12:33 PM, Daniel Nordlund 
wrote:

> On 6/1/2018 4:17 PM, Duncan Murdoch wrote:
>
>> On 01/06/2018 5:24 PM, Shivi Bhatia wrote:
>>
>>> Hi All,
>>>
>>> I am trying to download semnet package but getting the error:
>>> package not available for R version 3.4.4.
>>>
>>
>> As far as I can see, there is no semnet package on CRAN, and never has
>> been (or if there was, it was there by mistake).
>>
>> Packages whose names start with "sem" are:
>>
>> semStructural Equation Models
>> semantic.dashboardDashboard with Semantic UI Support for 'shiny'
>> SemblancePair-Wise Semblance Using a Rank-Based Kernel
>> semdiagStructural equation modeling diagnostics
>> semdsStructural Equation Multidimensional Scaling
>> semGOFGoodness-of-fit indexes for structural equation models
>> semiArtificialGenerator of Semi-Artificial Data
>> SemiCompRisksHierarchical Models for Parametric and Semi-Parametric
>> Analyses of Semi-Competing Risks Data
>> SEMIDIdentifiability of Linear Structural Equation Models
>> SemiMarkovMulti-States Semi-Markov Models
>> seminrDomain-Specific Language for Building PLS Structural Equation
>> Models
>> SemiParSemiparametic Regression
>> SemiParSampleSelSemi-Parametric Sample Selection Modelling with
>> Continuous or Discrete Response
>> SemiSupervisedSafe Semi-Supervised Learning Tools
>> semisupKernelPCAKernel PCA projection, and semi-supervised variant
>> SEMModCompModel Comparisons for SEM
>> SemNetCleanerAn Automated Cleaning Tool for Semantic and Linguistic
>> Data
>> semPlotPath Diagrams and Visual Analysis of Various SEM Packages'
>> Output
>> semPLSStructural Equation Modeling Using Partial Least Squares
>> semPowerPower Analyses for SEM
>> semsfaSemiparametric Estimation of Stochastic Frontier Models
>> semToolsUseful Tools for Structural Equation Modeling
>> semtreeRecursive Partitioning for Structural Equation Models
>> semver'Semantic Versioning V2.0.0' Parser
>>
>> Perhaps you really want one of those.
>>
>> Duncan Murdoch
>>
>>
>>> I tried downloading it from
>>> install.packages('semnet',repos='http://cran.us.r-project.org')
>>> and install.packages('semnet',repos='http://cran.revolutionanaly
>>> tics.com/')
>>> and even the https://cran.r-project.org/src/contrib/semnet.tar.gz but
>>> doesnt seem to get success.
>>>
>>> Please suggest some alternate.
>>>
>>> Regards, Shivi
>>>
>>> [[alternative HTML version deleted]]
>>>
>>>
> Maybe this is what the OP is looking for
>
> library(devtools)
> install_github("kasperwelbers/semnet")
>
>
> Hope this is helpful,
>
> Dan
>
> --
> Daniel Nordlund
> Port Townsend, WA  USA
>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-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] Cannot Load A Package

2018-06-01 Thread Shivi Bhatia
Hi All,

I am trying to download semnet package but getting the error:
package not available for R version 3.4.4.

I tried downloading it from
install.packages('semnet',repos='http://cran.us.r-project.org')
and install.packages('semnet',repos='http://cran.revolutionanalytics.com/')
and even the https://cran.r-project.org/src/contrib/semnet.tar.gz but
doesnt seem to get success.

Please suggest some alternate.

Regards, Shivi

[[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] length of 'dimnames' [2] not equal to array extent- For Correlation Plot

2018-03-17 Thread Shivi Bhatia
Thank you Sarah, this is really helpful.

Have a nice day.

Regards, Shivi

On Sat, Mar 17, 2018 at 10:28 PM, Sarah Goslee <sarah.gos...@gmail.com>
wrote:

> That does clarify for me that you're missing a step: I didn't clearly
> follow your description at first.
>
> corrplot expects a correlation matrix, not your original data. You need to
> use cor() first.
>
> That's pretty clear in the documentation. See for instance the examples:
>
> data(mtcars)
> M <- cor(mtcars)
> corrplot(M)
>
> Sarah
>
> On Sat, Mar 17, 2018 at 12:00 PM Shivi Bhatia <shivipm...@gmail.com>
> wrote:
>
>> Hi Sarah,
>> Thank you for your help.
>>
>> I tried using CR1<-as.matrix(CR1) but gives error Error in corrplot(CR1,
>> method = "circle") : The matrix is not in [-1, 1]!. I am using a corrplot
>> library.
>>
>> Please find the reproducible example:
>> dput(head(CR1,10))
>> structure(c(26L, 46L, 39L, 38L, 47L, 59L, 56L, 61L, 43L, 60L,
>> 78L, 63L, 2L, 58L, 8L, 1L, 1L, 9L, 11L, 2L, 1037500L, 46747L,
>> 346300L, 672000L, 729000L, 470800L, 423000L, 72184L, 368022L,
>> 1037500L), .Dim = c(10L, 3L), .Dimnames = list(NULL, c("AGE",
>> "OLD_CAR_PURCHASE_YRS", "Total.Spend.With.Maruti")))
>>
>> Please advice if this would help.
>>
>> Thank you. Shivi
>>
>> On Sat, Mar 17, 2018 at 8:45 PM, Sarah Goslee <sarah.gos...@gmail.com>
>> wrote:
>>
>>> I'm assuming you are using the corrplot package.
>>>
>>> If so, your data object does need to be a matrix, not a data frame.
>>> Since it's already a data frame, your line of code:
>>>
>>> as.matrix(as.data.frame(CR1))
>>>
>>> doesn't need the as.data.frame function, but more importantly, you
>>> didn't assign the result to anything: as.matrix() does not work in
>>> place.
>>>
>>> CR1 <- as.matrix(CR1)
>>>
>>> Now try.
>>>
>>> If that doesn't work, then provide a reproducible example so we can
>>> offer further advice.
>>>
>>> Sarah
>>>
>>> On Sat, Mar 17, 2018 at 11:08 AM, Shivi Bhatia <shivipm...@gmail.com>
>>> wrote:
>>> > Created a new data set with 3 numeric variable to find correlation
>>> >
>>> > CR1<- mar%>%  as_data_frame%>%  select(AGE, OLD_CAR_PURCHASE_YRS,
>>> > Total.Spend.With.AA)
>>> >
>>> > had to convert it to a data frame, code:
>>> >
>>> > as.matrix(as.data.frame(CR1))
>>> >
>>> > Now i need to run a correlation plot for these 3 variables:
>>> >
>>> > corrplot(CR1, method = "circle")
>>> >
>>> > But i am getting this error:
>>> > Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE),
>>> nrow =
>>> > nr, : length of 'dimnames' [2] not equal to array extent
>>> > Researched and found Correlation
>>> > <https://stackoverflow.com/questions/43362420/length-of-
>>> dimnames-2-not-equal-to-array-extent-when-using-corrplot-function>that
>>> > corrplot requires a matrix however the error is still the same.
>>> > Regards, Shivi
>>> >
>>> > [[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.
>>>
>>>
>>>
>>> --
>>> Sarah Goslee
>>> http://www.functionaldiversity.org
>>>
>> --
> Sarah Goslee
> http://www.stringpage.com
> http://www.sarahgoslee.com
> http://www.functionaldiversity.org
>

[[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] length of 'dimnames' [2] not equal to array extent- For Correlation Plot

2018-03-17 Thread Shivi Bhatia
Hi Sarah,
Thank you for your help.

I tried using CR1<-as.matrix(CR1) but gives error Error in corrplot(CR1,
method = "circle") : The matrix is not in [-1, 1]!. I am using a corrplot
library.

Please find the reproducible example:
dput(head(CR1,10))
structure(c(26L, 46L, 39L, 38L, 47L, 59L, 56L, 61L, 43L, 60L,
78L, 63L, 2L, 58L, 8L, 1L, 1L, 9L, 11L, 2L, 1037500L, 46747L,
346300L, 672000L, 729000L, 470800L, 423000L, 72184L, 368022L,
1037500L), .Dim = c(10L, 3L), .Dimnames = list(NULL, c("AGE",
"OLD_CAR_PURCHASE_YRS", "Total.Spend.With.Maruti")))

Please advice if this would help.

Thank you. Shivi

On Sat, Mar 17, 2018 at 8:45 PM, Sarah Goslee <sarah.gos...@gmail.com>
wrote:

> I'm assuming you are using the corrplot package.
>
> If so, your data object does need to be a matrix, not a data frame.
> Since it's already a data frame, your line of code:
>
> as.matrix(as.data.frame(CR1))
>
> doesn't need the as.data.frame function, but more importantly, you
> didn't assign the result to anything: as.matrix() does not work in
> place.
>
> CR1 <- as.matrix(CR1)
>
> Now try.
>
> If that doesn't work, then provide a reproducible example so we can
> offer further advice.
>
> Sarah
>
> On Sat, Mar 17, 2018 at 11:08 AM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> > Created a new data set with 3 numeric variable to find correlation
> >
> > CR1<- mar%>%  as_data_frame%>%  select(AGE, OLD_CAR_PURCHASE_YRS,
> > Total.Spend.With.AA)
> >
> > had to convert it to a data frame, code:
> >
> > as.matrix(as.data.frame(CR1))
> >
> > Now i need to run a correlation plot for these 3 variables:
> >
> > corrplot(CR1, method = "circle")
> >
> > But i am getting this error:
> > Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE),
> nrow =
> > nr, : length of 'dimnames' [2] not equal to array extent
> > Researched and found Correlation
> > <https://stackoverflow.com/questions/43362420/length-of-
> dimnames-2-not-equal-to-array-extent-when-using-corrplot-function>that
> > corrplot requires a matrix however the error is still the same.
> > Regards, Shivi
> >
> > [[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.
>
>
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>

[[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] length of 'dimnames' [2] not equal to array extent- For Correlation Plot

2018-03-17 Thread Shivi Bhatia
Created a new data set with 3 numeric variable to find correlation

CR1<- mar%>%  as_data_frame%>%  select(AGE, OLD_CAR_PURCHASE_YRS,
Total.Spend.With.AA)

had to convert it to a data frame, code:

as.matrix(as.data.frame(CR1))

Now i need to run a correlation plot for these 3 variables:

corrplot(CR1, method = "circle")

But i am getting this error:
Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow =
nr, : length of 'dimnames' [2] not equal to array extent
Researched and found Correlation
that
corrplot requires a matrix however the error is still the same.
Regards, Shivi

[[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] arguments imply differing number of rows

2017-09-20 Thread Shivi Bhatia
Thank you Bob, this is what i was looking for. Really appreciate.

Regards, Shivi

On Wed, Sep 20, 2017 at 8:41 PM, Bob O'Hara <rni@gmail.com> wrote:

> 4000:6000 gives you 4000, 4001, ..., 6000. I suspect you want
> population= c(seq(4000, 6000, length=5), seq(3500, 4300, length=5),
> seq(3000, 3200, length=5))
>
> Bob
>
> On 20 September 2017 at 17:07, Shivi Bhatia <shivipm...@gmail.com> wrote:
> > Hi Team,
> >
> > I using the syntax as:
> >
> > data.df<- data.frame(
> >   city= c(rep(c("Delhi", "Bangalore","Chandigarh"),each=5)),
> >   population= c(4000:6000,3500:4300,3000:3200)
> > )
> >
> > But i am getting the error as arguments imply differing number of rows:
> 15,
> > 3003.
> >
> > Tried searching google but could not understand & find the solution.
> >
> > Thanks, Shivi
> >
> > [[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.
>
>
>
> --
> Bob O'Hara
> NOTE NEW ADDRESS!!!
> Institutt for matematiske fag
> NTNU
> 7491 Trondheim
> Norway
>
> Mobile: +49 1515 888 5440
> Journal of Negative Results - EEB: www.jnr-eeb.org
>

[[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] arguments imply differing number of rows

2017-09-20 Thread Shivi Bhatia
Hi Team,

I using the syntax as:

data.df<- data.frame(
  city= c(rep(c("Delhi", "Bangalore","Chandigarh"),each=5)),
  population= c(4000:6000,3500:4300,3000:3200)
)

But i am getting the error as arguments imply differing number of rows: 15,
3003.

Tried searching google but could not understand & find the solution.

Thanks, Shivi

[[alternative HTML version deleted]]

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


Re: [R] R and Tableau Compatibility

2017-06-21 Thread Shivi Bhatia
 blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px 
#715FFA solid !important; padding-left:1ex !important; background-color:white 
!important; } R and Tableau can easily get connected with their latest 
versions. I have been using both for my case. 10.1 version of tableau can 
connect to R studio you have to write your scripts in R and then call those in 
tableau. 
Thanks.


Sent from Yahoo Mail for iPhone


On Wednesday, June 21, 2017, 8:13 PM, David Winsemius  
wrote:


> On Jun 21, 2017, at 6:24 AM, Dai, Shengyu [HCSUS]  wrote:
> 
> Good morning R helpers,
> 
> I hope this email finds you well.
> 
> Recently, I am thinking of using R with connection to Tableau. I search 
> information online but I did not see any official documentations about these 
> compatibilities. I have Tableau version 10.1 and I wonder which versionS of R 
> is compatible to this Tableau version.

Not sure what you are expecting. When I go to the Tableau website and search 
their "Support" links I almost immediately find:

https://www.tableau.com/search#q=r=support

Following a link with the word "configuring" I see:

http://kb.tableau.com/articles/HowTo/configuring-tableau-server-for-r-and-rserve

 which says to use the current version of R. Since you are using a 
closed-source, commercial product., you really should be asking this question 
on their support portal.

> 
> Thank you very much. Your quick assistance will be appreciated.
> 
> Best,
> Shengyu
> 
>     [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

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




[[alternative HTML version deleted]]

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

[R] Error in .jcall

2017-03-10 Thread Shivi Bhatia
Hi Team,
I am creating an n-gram analysis on a text mining data however receving the
error as:-

Error in .jcall("RWekaInterfaces", "[S", "tokenize", .jcast(tokenizer,  :
  java.lang.NullPointerException

I have used the function:
Ngramtok= function(x)NGramTokenizer(x, Weka_control(min=1, max=5))
 and then using this as below:-

ngram1= DocumentTermMatrix(cnt_reason,control = list(tokenize= Ngramtok)).

Checked stack overflow for the error here -
http://stackoverflow.com/questions/38605088/creating-ngrams-in-r where it
was advised to remove the blank rows but it did not help.

I have strangely used this earlier but it now not working now.

Please suggest.

[[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] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread Shivi Bhatia
Thanks Pikal. This worked for me.

Regards, Shivi

On Thu, Mar 2, 2017 at 6:46 PM, PIKAL Petr <petr.pi...@precheza.cz> wrote:

> Well,
>
>
>
> you read documents from
>
>
>
> directory = "D:/Shivi/R Project"
>
>
>
> and you say that you have 220+ files in this directory
>
>
>
> If you move respective files into some working directory you could use let
> say
>
>
>
> docs<- Corpus(DirSource(directory = "D:/Shivi/R Project/work"))
>
>
>
> without need to use setwd.
>
>
>
> But maybe I do not understand your problem corrrectly.
>
>
>
> Cheers
>
> Petr
>
>
>
>
>
> *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
> *Sent:* Thursday, March 2, 2017 2:06 PM
> *To:* PIKAL Petr <petr.pi...@precheza.cz>
> *Cc:* R-help <r-help@r-project.org>
> *Subject:* Re: [R] Reading Multiple Files for Text Mining in R Using TM
> Package?
>
>
>
> Hi Pikal,
>
>
>
> So i understand it correctly you are advising to temporarily change the
> working directory using the setwd syntax.
>
>
>
> Thanks, Shivi.
>
>
>
> On Thu, Mar 2, 2017 at 6:33 PM, PIKAL Petr <petr.pi...@precheza.cz> wrote:
>
> Hi
>
> Hmm, if you need only three files why not copy them to another directory
> and use the same command for reading them from that other directory.
>
> You probably could do this from R itself however I am almost sure that
> doing this task by OS is far less complicated.
>
> Cheers
> Petr
>
>
>
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
> > Bhatia
> > Sent: Thursday, March 2, 2017 1:00 PM
> > To: R-help <r-help@r-project.org>
> > Subject: [R] Reading Multiple Files for Text Mining in R Using TM
> Package?
> >
> > Hi All ,
> >
> > I am trying to read few csv files for some text mining assignment.
> >
> > I have used this command to check the # of files in the working
> directory:
> >
> > length(dir(path="D:/Shivi/R Project", all.files = TRUE)) This results to
> more
> > than 220 approx.
> >
> > I just need 3 files from these to use for the text mining purpose
> however if i
> > use:
> >
> > docs<- Corpus(DirSource(directory = "D:/Shivi/R Project")) this reads
> all the
> > 220+ files
> >
> > Please suggest how to achieve this feat. Have researched on stack
> overflow,
> > where they have used multiple read.csv statements to read multiple files
> > however do not find that very effective way.
> >
> > Thank you.
> >
>
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
> --
> Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
> určeny pouze jeho adresátům.
> Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
> neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie
> vymažte ze svého systému.
> Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email
> jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi
> či zpožděním přenosu e-mailu.
>
> V případě, že je tento e-mail součástí obchodního jednání:
> - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
> smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
> - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout;
> Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany
> příjemce s dodatkem či odchylkou.
> - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve
> výslovným dosažením shody na všech jejích náležitostech.
> - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za
> společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn
> nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto
> emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich
> existence je adresátovi či osobě jím zastoupené známá.
>
> This e-mail and any documents attached to it may be confidential and are
> intended only for its intended recipients.
> If you received this e-mail by mistake, please immedi

Re: [R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread Shivi Bhatia
Hi Pikal,

So i understand it correctly you are advising to temporarily change the
working directory using the setwd syntax.

Thanks, Shivi.

On Thu, Mar 2, 2017 at 6:33 PM, PIKAL Petr <petr.pi...@precheza.cz> wrote:

> Hi
>
> Hmm, if you need only three files why not copy them to another directory
> and use the same command for reading them from that other directory.
>
> You probably could do this from R itself however I am almost sure that
> doing this task by OS is far less complicated.
>
> Cheers
> Petr
>
>
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
> > Bhatia
> > Sent: Thursday, March 2, 2017 1:00 PM
> > To: R-help <r-help@r-project.org>
> > Subject: [R] Reading Multiple Files for Text Mining in R Using TM
> Package?
> >
> > Hi All ,
> >
> > I am trying to read few csv files for some text mining assignment.
> >
> > I have used this command to check the # of files in the working
> directory:
> >
> > length(dir(path="D:/Shivi/R Project", all.files = TRUE)) This results to
> more
> > than 220 approx.
> >
> > I just need 3 files from these to use for the text mining purpose
> however if i
> > use:
> >
> > docs<- Corpus(DirSource(directory = "D:/Shivi/R Project")) this reads
> all the
> > 220+ files
> >
> > Please suggest how to achieve this feat. Have researched on stack
> overflow,
> > where they have used multiple read.csv statements to read multiple files
> > however do not find that very effective way.
> >
> > Thank you.
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> 
> Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
> určeny pouze jeho adresátům.
> Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
> neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie
> vymažte ze svého systému.
> Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email
> jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi
> či zpožděním přenosu e-mailu.
>
> V případě, že je tento e-mail součástí obchodního jednání:
> - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
> smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
> - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout;
> Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany
> příjemce s dodatkem či odchylkou.
> - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve
> výslovným dosažením shody na všech jejích náležitostech.
> - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za
> společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn
> nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto
> emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich
> existence je adresátovi či osobě jím zastoupené známá.
>
> This e-mail and any documents attached to it may be confidential and are
> intended only for its intended recipients.
> If you received this e-mail by mistake, please immediately inform its
> sender. Delete the contents of this e-mail with all attachments and its
> copies from your system.
> If you are not the intended recipient of this e-mail, you are not
> authorized to use, disseminate, copy or disclose this e-mail in any manner.
> The sender of this e-mail shall not be liable for any possible damage
> caused by modifications of the e-mail or by delay with transfer of the
> email.
>
> In case that this e-mail forms part of business dealings:
> - the sender reserves the right to end negotiations about entering into a
> contract in any time, for any reason, and without stating any reasoning.
> - if the e-mail contains an offer, the recipient is entitled to
> immediately accept such offer; The sender of this e-mail (offer) excludes
> any acceptance of the offer on the part of the recipient containing any
> amendment or variation.
> - the sender insists on that the respective contract is concluded only
> upon an express mutual agreement on all its aspects.
> - the sender of this e-mail infor

[R] Reading Multiple Files for Text Mining in R Using TM Package?

2017-03-02 Thread Shivi Bhatia
Hi All ,

I am trying to read few csv files for some text mining assignment.

I have used this command to check the # of files in the working directory:

length(dir(path="D:/Shivi/R Project", all.files = TRUE))
This results to more than 220 approx.

I just need 3 files from these to use for the text mining purpose however
if i use:

docs<- Corpus(DirSource(directory = "D:/Shivi/R Project"))
this reads all the 220+ files

Please suggest how to achieve this feat. Have researched on stack overflow,
where they have used multiple read.csv statements to read multiple files
however do not find that very effective way.

Thank you.

[[alternative HTML version deleted]]

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


[R] Request body format is wrong. Make sure the json request is serialized correctly and there are no null members"- Text Mining With Cognitive API

2017-01-27 Thread Shivi Bhatia
Hi Team,

I am building a sentiment and text mining model with R and Cognitive API. I
am getting the error as mentioned in the subject:

Request body format is wrong. Make sure the json request is serialized
correctly and there are no null members. Can you please advice what is
incorrect i am doing in the code below:

modi_df["language"] = "en"
modi_df["id"] = seq.int(nrow(modi_df))
request_body_modi = modi_df[c(2,3,1)]

# Converting tweets dataframe into JSON
request_body_json_modi = toJSON(list(documents = request_body_modi))
# Calling text analytics API


result_modi = POST("
https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment;,
body = request_body_json_modi,
add_headers(.headers =
c("Content-Type"="application/json","Ocp-Apim-Subscription-Key"="bc8c8427fd74412ea51967373e418681")))

Output = content(result_modi)
Thank You!.

[[alternative HTML version deleted]]

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


[R] Error in FUN(content(x), ...) : invalid input in 'utf8towcs' in Twitter Analysis using TM package

2017-01-24 Thread Shivi Bhatia
Hi All,
I am working on a twitter analysis using the TM package. Below are some
codes:

1- Here i am creating a data frame of the data collected from twitter
chennai=as.data.frame(cbind(tweet=jallitext,date=jallidate,lat=jallilat,lon=jallilon,
 isretweet=isretweet,retweeted=retweeted,
retweetcount=retweetcount,favorite=favoritesCount,
 favorited=favorited))

2- corpus<- Corpus(VectorSource(chennai$tweet)) The output gives me:
Metadata:  corpus specific: 0, document level (indexed): 0
Content:  documents: 6000

However while changing the text to lower using the tm package i get this
error:

Error in FUN(content(x), ...) :
  invalid input 'RT @Aariactor: Officially #jallikattu protest is over
yesterday we won í ½í²ªí ¼í¿» thx to government í ½í¹ í ¼í¿»' in
'utf8towcs'.

After researching a lot i am using this code:-
tryTolower = function(x)
{
  # create missing value
  # this is where the returned value will be
  y = NA
  # tryCatch error
  try_error = tryCatch(tolower(x), error = function(e) e)
  # if not an error
  if (!inherits(try_error, "error"))
y = tolower(x)
  return(y)
}
corpus<- sapply(corpus, function(x) tryTolower(x))
This makes the tweets case sensitive but  when i create a document term
matrix i get this error:

Jalli<- DocumentTermMatrix(corpus)
Error in UseMethod("TermDocumentMatrix", x) :
  no applicable method for 'TermDocumentMatrix' applied to an object of
class "character"

Request you to please assist with this error. Thank you.

[[alternative HTML version deleted]]

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

[R] PNG File in R Markdown HTML

2017-01-10 Thread Shivi Bhatia
Hi Team,

I am successfully able to add the company logo to the R markdown file using
the code below:

```{r, fig.width=3, fig.height=15,echo=FALSE, warning=FALSE, message=FALSE}
library(png)
library(grid)
img <- readPNG("D:/Shivi/R Project/Name.png")
 grid.raster(img)
```
However the image gets displayed at the bottom of the html page. I have
tried deleting any empty space after this code but it does not help.

Request you to please advice.
Thanks, Shivi

[[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] 0 rows> (or 0-length row.names)

2016-08-31 Thread Shivi Bhatia
Thank you Mark & Dunlap,

Will make changes to the variable as suggested. Thank you for your time &
assistance.

On Wed, Aug 31, 2016 at 9:16 PM, Mark Sharp <msh...@txbiomed.org> wrote:

> Shivi,
>
> Looking at the help from ?WOE, ?WOETable, and ?IV, your Y vector in all
> cases is to be categorical and it is numeric.
>
> Mark
>
>
> R. Mark Sharp, Ph.D.
> Director of Primate Records Database
> Southwest National Primate Research Center
> Texas Biomedical Research Institute
> P.O. Box 760549
> San Antonio, TX 78245-0549
> Telephone: (210)258-9476
> e-mail: msh...@txbiomed.org
>
>
> On Aug 31, 2016, at 5:37 AM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > These are the packages i am using:
> > library(woe)  #WEIGHT OF EVIDENCE
> > library(InformationValue)  #INFORMATION VALUE
> >
> > The syntax used is :
> > WOE(X=SFDC1$log_caseage, Y=SFDC1$survey)
> > WOETable(X=SFDC1$case_age, Y=SFDC1$survey)
> > IV(X=SFDC1$case_age, Y=SFDC1$survey)
> >
> > On Wed, Aug 31, 2016 at 12:54 AM, Mark Sharp <msh...@txbiomed.org>
> wrote:
> > Shivi,
> >
> > What package(s) are you using. What functions are you using. How are you
> calling the functions. A reproducible sample has all of the actual code
> needed to create a representative error. There are multiple packages you
> could be using to look at weight of evidence and information value. For
> example, there is a WOE function in the Information package and a woe
> function in the woe package.
> >
> > Mark
> >
> >> On Aug 30, 2016, at 2:15 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >>
> >> Hi Mark,
> >> What i understand, probably when i run the WOE & IV to check
> significant variables that is where i get this error. Thanks for your
> assistance Mark really appreciate i will look into some other measure on
> this.
> >>
> >> On Wed, Aug 31, 2016 at 12:35 AM, Mark Sharp <msh...@txbiomed.org>
> wrote:
> >> Shivi,
> >>
> >> It is likely that William knows what you are trying to do because of
> his considerable experience, but I am not able to figure it out from what
> you have written. You have apparently sent the output from something like
> dput(SFDC[1:50, ]), but I still do not know what you did to get the error.
> >>
> >> I successfully assigned the structure you sent to the name SFDC and
> nothing seems amiss.
> >>
> >>
> >> Mark
> >>
> >> R. Mark Sharp, Ph.D.
> >> Director of Primate Records Database
> >> Southwest National Primate Research Center
> >> Texas Biomedical Research Institute
> >> P.O. Box 760549
> >> San Antonio, TX 78245-0549
> >> Telephone: (210)258-9476
> >> e-mail: msh...@txbiomed.org
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> > On Aug 30, 2016, at 12:32 PM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> >> >
> >> > Hi William/ Mark,
> >> >
> >> > I am using WOE & IV (weight of evidence) reduce the number of
> independent
> >> > vars.
> >> > I have read this data as a csv file.
> >> > reproducible example for your reference please:
> >> >
> >> > structure(list(date = structure(c(6L, 6L, 6L, 6L, 6L, 6L, 14L,
> >> > 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,
> >> >
> >> ... truncated
> >> > __
> >> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> > https://stat.ethz.ch/mailman/listinfo/r-help
> >> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> >> > and provide commented, minimal, self-contained, reproducible code.
> >>
> >> CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments
> transmitted, may contain privileged and confidential information and is
> intended solely for the exclusive use of the individual or entity to whom
> it is addressed. If you are not the intended recipient, you are hereby
> notified that any review, dissemination, distribution or copying of this
> e-mail and/or attachments is strictly prohibited. If you have received this
> e-mail in error, please immediately notify the sender stating that this
> transmission was misdirected; return the e-mail to sender; destroy all
> paper copies and delete all electronic copies from your system without
> disclosing its contents.
> >
> > CONFIDENTIALITY NOTIC

Re: [R] 0 rows> (or 0-length row.names)

2016-08-31 Thread Shivi Bhatia
These are the packages i am using:
library(woe)  #WEIGHT OF EVIDENCE
library(InformationValue)  #INFORMATION VALUE

The syntax used is :
WOE(X=SFDC1$log_caseage, Y=SFDC1$survey)
WOETable(X=SFDC1$case_age, Y=SFDC1$survey)
IV(X=SFDC1$case_age, Y=SFDC1$survey)

On Wed, Aug 31, 2016 at 12:54 AM, Mark Sharp <msh...@txbiomed.org> wrote:

> Shivi,
>
> What package(s) are you using. What functions are you using. How are you
> calling the functions. A reproducible sample has all of the actual code
> needed to create a representative error. There are multiple packages you
> could be using to look at weight of evidence and information value. For
> example, there is a WOE function in the Information package and a woe
> function in the woe package.
>
> Mark
>
> On Aug 30, 2016, at 2:15 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:
>
> Hi Mark,
> What i understand, probably when i run the WOE & IV to check significant
> variables that is where i get this error. Thanks for your assistance Mark
> really appreciate i will look into some other measure on this.
>
> On Wed, Aug 31, 2016 at 12:35 AM, Mark Sharp <msh...@txbiomed.org> wrote:
>
>> Shivi,
>>
>> It is likely that William knows what you are trying to do because of his
>> considerable experience, but I am not able to figure it out from what you
>> have written. You have apparently sent the output from something like
>> dput(SFDC[1:50, ]), but I still do not know what you did to get the error.
>>
>> I successfully assigned the structure you sent to the name SFDC and
>> nothing seems amiss.
>>
>>
>> Mark
>>
>> R. Mark Sharp, Ph.D.
>> Director of Primate Records Database
>> Southwest National Primate Research Center
>> Texas Biomedical Research Institute
>> P.O. Box 760549
>> San Antonio, TX 78245-0549
>> Telephone: (210)258-9476
>> e-mail: msh...@txbiomed.org <msh...@txbiomed.org>
>>
>>
>>
>>
>>
>>
>>
>> > On Aug 30, 2016, at 12:32 PM, Shivi Bhatia <shivipm...@gmail.com>
>> wrote:
>> >
>> > Hi William/ Mark,
>> >
>> > I am using WOE & IV (weight of evidence) reduce the number of
>> independent
>> > vars.
>> > I have read this data as a csv file.
>> > reproducible example for your reference please:
>> >
>> > structure(list(date = structure(c(6L, 6L, 6L, 6L, 6L, 6L, 14L,
>> > 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,
>> >
>> ... truncated
>> > __
>> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > https://stat.ethz.ch/mailman/listinfo/r-help
>> > PLEASE do read the posting guide http://www.R-project.
>> org/posting-guide.html <http://www.r-project.org/posting-guide.html>
>> > and provide commented, minimal, self-contained, reproducible code.
>>
>> CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments
>> transmitted, may contain privileged and confidential information and is
>> intended solely for the exclusive use of the individual or entity to whom
>> it is addressed. If you are not the intended recipient, you are hereby
>> notified that any review, dissemination, distribution or copying of this
>> e-mail and/or attachments is strictly prohibited. If you have received this
>> e-mail in error, please immediately notify the sender stating that this
>> transmission was misdirected; return the e-mail to sender; destroy all
>> paper copies and delete all electronic copies from your system without
>> disclosing its contents.
>>
>
> CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments
> transmitted, may contain privileged and confidential information and is
> intended solely for the exclusive use of the individual or entity to whom
> it is addressed. If you are not the intended recipient, you are hereby
> notified that any review, dissemination, distribution or copying of this
> e-mail and/or attachments is strictly prohibited. If you have received this
> e-mail in error, please immediately notify the sender stating that this
> transmission was misdirected; return the e-mail to sender; destroy all
> paper copies and delete all electronic copies from your system without
> disclosing its contents.
>

[[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] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
Hi Mark,
What i understand, probably when i run the WOE & IV to check significant
variables that is where i get this error. Thanks for your assistance Mark
really appreciate i will look into some other measure on this.

On Wed, Aug 31, 2016 at 12:35 AM, Mark Sharp <msh...@txbiomed.org> wrote:

> Shivi,
>
> It is likely that William knows what you are trying to do because of his
> considerable experience, but I am not able to figure it out from what you
> have written. You have apparently sent the output from something like
> dput(SFDC[1:50, ]), but I still do not know what you did to get the error.
>
> I successfully assigned the structure you sent to the name SFDC and
> nothing seems amiss.
>
>
> Mark
>
> R. Mark Sharp, Ph.D.
> Director of Primate Records Database
> Southwest National Primate Research Center
> Texas Biomedical Research Institute
> P.O. Box 760549
> San Antonio, TX 78245-0549
> Telephone: (210)258-9476
> e-mail: msh...@txbiomed.org
>
>
>
>
>
>
>
> > On Aug 30, 2016, at 12:32 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > Hi William/ Mark,
> >
> > I am using WOE & IV (weight of evidence) reduce the number of independent
> > vars.
> > I have read this data as a csv file.
> > reproducible example for your reference please:
> >
> > structure(list(date = structure(c(6L, 6L, 6L, 6L, 6L, 6L, 14L,
> > 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,
> >
> ... truncated
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments
> transmitted, may contain privileged and confidential information and is
> intended solely for the exclusive use of the individual or entity to whom
> it is addressed. If you are not the intended recipient, you are hereby
> notified that any review, dissemination, distribution or copying of this
> e-mail and/or attachments is strictly prohibited. If you have received this
> e-mail in error, please immediately notify the sender stating that this
> transmission was misdirected; return the e-mail to sender; destroy all
> paper copies and delete all electronic copies from your system without
> disclosing its contents.
>

[[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] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
uot;Governor Limits",
"IDE / ANT / Metadata API", "Identity Connect", "Lightning Connect",
"Managed Package Namespaces", "Managed Packages", "Mutual
Authentication",
"Network / ISP Latency", "Oauth", "Open CTI", "Other", "Outbound
Messaging",
"Post Install Script", "Quick Deploy", "REST API", "Salesforce
Maintenance",
"Salesforce1", "SAML", "Setup & Security", "Single Sign On",
"Site.com", "SOAP API", "SOQL Performance", "SOQL Queries",
"SOSL", "SSL Certificates", "Visual Process Manager", "Visualforce",
"WDC1.0", "Workflow", "WSDL2 Apex"), class = "factor"), score = c(9L,
10L, 2L, 10L, 10L, 2L, 8L, 10L, 10L, 10L, 10L, 10L, 10L,
2L, 10L, 4L, 4L, 10L, 9L, 10L, 10L, 10L, 10L, 5L, 9L, 10L,
8L, 10L, 10L, 10L, 10L, 10L, 10L, 1L, 9L, 8L, 10L, 10L, 10L,
10L, 9L, 10L, 10L, 10L, 9L, 10L, 8L, 8L, 10L, 9L), rep_score = c(9.5,
10, 2, 10, 10, 3.5, 7.5, 10, 10, 10, 10, 10, 10, 2, 10, 7.5,
    6, 10, 9.5, 10, 9, 10, 10, 5.5, 9, 10, 8, 10, 10, 10, 10,
10, 9.5, 1.5, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 9.5,
10, 10, 8, 10, 10), product_know = structure(c(4L, 4L, 5L,
4L, 1L, 3L, 11L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 4L, 10L, 9L,
4L, 4L, 4L, 11L, 4L, 4L, 9L, 12L, 4L, 11L, 4L, 4L, 4L, 4L,
4L, 12L, 3L, 12L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 11L, 4L, 4L), .Label = c("-", "0", "1", "10", "2",
"3", "4", "5", "6", "7", "8", "9"), class = "factor"),
understanding_issue = structure(c(12L,
4L, 5L, 4L, 4L, 9L, 10L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 4L,
11L, 9L, 4L, 12L, 4L, 4L, 4L, 4L, 8L, 12L, 4L, 11L, 1L, 4L,
4L, 4L, 4L, 4L, 5L, 12L, 11L, 4L, 4L, 4L, 4L, 4L, 4L, 1L,
4L, 12L, 4L, 4L, 11L, 4L, 4L), .Label = c("-", "0", "1",
"10", "2", "3", "4", "5", "6", "7", "8", "9"), class = "factor"),
case_age = c(24.84, 0.05, 13.38, 0.15, 11.11, 4.16, 8.13,
0.07, 3.61, 0, 3.11, 20.94, 0.21, 17.49, 1.11, 6.15, 4.32,
4.03, 0.08, 3.06, 4.74, 12.07, 4.79, 5.29, 0.21, 0.06, 3.95,
0.12, 7.27, 4.18, 2.49, 20.95, 0.15, 10.96, 6.99, 47.42,
4.96, 0.06, 4.92, 0.06, 6.84, 0.3, 0.01, 0.07, 15.74, 5.8,
2.85, 0.17, 16.02, 1.33), severity_level = structure(c(3L,
3L, 2L, 4L, 3L, 2L, 2L, 3L, 3L, 3L, 2L, 2L, 2L, 4L, 4L, 4L,
4L, 4L, 2L, 3L, 4L, 4L, 2L, 4L, 3L, 4L, 2L, 3L, 2L, 3L, 2L,
4L, 3L, 3L, 4L, 4L, 4L, 4L, 2L, 4L, 3L, 2L, 2L, 2L, 3L, 3L,
3L, 4L, 4L, 4L), .Label = c("Level 1 - Critical", "Level 2 - Urgent",
"Level 3 - High", "Level 4 - Medium"), class = "factor"),
case_status = structure(c(1L, 6L, 4L, 6L, 6L, 6L, 6L, 6L,
2L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 4L, 4L, 6L, 2L, 6L, 6L, 2L,
5L, 6L, 6L, 6L, 5L, 6L, 6L, 6L, 6L, 6L, 5L, 2L, 6L, 6L, 2L,
6L, 2L, 6L, 6L, 6L, 6L, 6L, 6L, 2L, 2L, 6L, 2L), .Label = c("Closed -
Bug Fix Submitted",
"Closed - Customer Closed", "Closed - Directed to IdeaExchange",
"Closed - No response from customer", "Closed - Request out of Scope",
"Closed - Resolved", "Closed - Routed to Internal Helpdesk",
"Pending Customer Approval", "Working"), class = "factor"),
account_segment = structure(c(3L, 8L, 4L, 3L, 9L, 3L, 4L,
4L, 8L, 9L, 1L, 4L, 3L, 3L, 3L, 9L, 4L, 3L, 9L, 3L, 3L, 3L,
9L, 3L, 9L, 8L, 9L, 8L, 8L, 2L, 8L, 9L, 4L, 8L, 9L, 2L, 3L,
3L, 3L, 9L, 8L, 3L, 9L, 9L, 4L, 4L, 9L, 3L, 9L, 4L), .Label = c("-",
"Flagship", "Large", "Medium", "Mega", "N/A", "Platinum",
"Small", "Top", "Very Small"), class = "factor"), sla_status =
structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L), .Label = c("Met", "Missed", "N/A", "Pending"
), class = "factor"), delivery_segmentation = structure(c(31L,
31L, 31L, 31L, 10L, 26L, 31L, 31L, 31L, 31L, 25L, 31L, 31L,
31L, 24L, 8L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L,
31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 31L, 28L, 24L,
31L, 31L, 31L, 31L, 31L, 31L, 5L, 31L, 31L, 32L, 33L, 31L,
31L), .Label = c("-", "AMER - IND - T3", "AMER Dev Port",
"AMER Mission Critical Success (MCS)", "AMER Tier 2 Port",
"AMER Tier 3 Port", "AMER TS Tier 2", "AMER TS Tier 2 DEV",
"AMER TS Tier 3", "APAC Mission Critical Success (MCS)",
"APAC TS Tier 2", "COGZ DESM Admin", "COGZ DESM Tier 2",
"COGZ MANL Tier 1", "COGZ MANL Tier 2", "COGZ PUNE Admin",
"COGZ PUNE Tier 1", "EMEA Mission Critical Success (MCS)",
"EMEA Premier T2", "EMEA TS Tier 2 DEV", "EMEA TS Tier 3",
"HCL MANL Tier 1", "HCL MANL Tier 2", "HYDR AMER TS Tier 2 DEV",
"HYDR APAC TS Tier 2 DEV", "HYDR EMEA TS Tier 2 DEV", "HYDR Premier
Internal Admin APAC",
"HYDR Premier Internal Tier 2 AMER", "HYDR Premier Internal Tier 2
APAC",
"HYDR Premier Internal Tier 2 EMEA", "India TS Tier 2 Dev Outsource",
"Japan Premier Internal Tier 2 (PSA)", "Japan TS Tier 1",
"Japan TS Tier 2 Internal", "Japan TS Tier 3", "JP Mission Critical
Success (MCS)",
"Partner - Internal"), class = "factor"), survey = c(1, 1,
0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1,
1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0, 0, 1, 1), repS = c(1, 1, 0, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1,
1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1), log_caseage = c(3.2519236789144, 0.048790164169432,
2.6658383522929, 0.139761942375159, 2.494031557565, 1.64093657949347,
2.21156569460688, 0.0676586484738148, 1.52822785700856, 0,
1.41342302850814, 3.08831145484708, 0.19062035960865, 2.91723004539903,
0.746687947487975, 1.96711235670592, 1.67147330335355,
1.61541998411165,
0.0769610411361283, 1.40118297361364, 1.74745921033147,
2.57031952763613,
1.7561322915849, 1.83896107071235, 0.19062035960865,
0.0582689081239758,
1.5993875765806, 0.113328685307003, 2.1126345090356, 1.64480505627139,
1.24990173621434, 3.08876713952118, 0.139761942375159,
2.48156774852249,
2.07819075977818, 3.87991295150991, 1.78507048107726,
0.0582689081239758,
1.77833644889591, 0.0582689081239758, 2.05923883436232,
0.262364264467491,
0.00995033085316808, 0.0676586484738148, 2.81780106506133,
1.91692261218206, 1.34807314829969, 0.157003748809665,
2.83438912314523,
0.845868267577609)), .Names = c("date", "month", "day", "agent",
"tenure", "support_cat", "region", "support_lvl", "skill_group",
"application_area", "functional_area", "score", "rep_score",
"product_know", "understanding_issue", "case_age", "severity_level",
"case_status", "account_segment", "sla_status", "delivery_segmentation",
"survey", "repS", "log_caseage"), row.names = c(NA, 50L), class =
"data.frame")



On Tue, Aug 30, 2016 at 10:30 PM, William Dunlap <wdun...@tibco.com> wrote:

> You did not say what operation gave you the error.
>
> I can get that message (which is not an "error") if I print
> an illegally constructed data.frame, one without the
> row.names attribute.
>
> > illegalDF <- structure(class="data.frame", list(ColumnA = 1:3))
> > illegalDF
> [1] ColumnA
> <0 rows> (or 0-length row.names)
> > str(illegalDF)
> 'data.frame':   0 obs. of  1 variable:
>  $ ColumnA: int  1 2 3
>
> Note how str() of the entire data.frame indirectly informs you of the
> problem: the number of observations does not match the length of the
> columns.
>
> How did you make the data.frame?
>
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Tue, Aug 30, 2016 at 9:24 AM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
>
>> I know this question has been asked zillion times but even after
>> consulting
>> Stack Overflow & other forum cant figure out the reason.
>>
>> I have one var in my data-set names case age. This variable is numeric as:
>>
>> class(SFDC$case_age)
>>
>> *numeric*
>>
>> however it throws this error:
>>
>> <0 rows> (or 0-length row.names)
>> As checked this only happens either there is some space at the end of the
>> variable name, or there are no values whereas this is a numeric variable
>> with no missing values and has a total of 5400 observations.
>>
>> This var has a range from 0 to 240 in number of days for case variable
>> hence i need to do a logarithm transformation & make it use in the model.
>> Total unique obs are around 1500.
>>
>> Please advice.
>>
>> [[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/posti
>> ng-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] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
Hi Mark,

It gives me num [1:5083]. I have used head also to see first 10 obs:

head(SFDC$case_age,10)
 [1] 24.84  0.05 13.38  0.15 11.11  4.16  8.13  0.07  3.61  0.00

Thanks.

On Tue, Aug 30, 2016 at 10:05 PM, Mark Sharp <msh...@txbiomed.org> wrote:

> What do you get from
> str(SFDC$case_age)
>
> Mark
>
> R. Mark Sharp, Ph.D.
> Director of Primate Records Database
> Southwest National Primate Research Center
> Texas Biomedical Research Institute
> P.O. Box 760549
> San Antonio, TX 78245-0549
> Telephone: (210)258-9476
> e-mail: msh...@txbiomed.org
>
>
>
>
>
>
>
> > On Aug 30, 2016, at 11:24 AM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > I know this question has been asked zillion times but even after
> consulting
> > Stack Overflow & other forum cant figure out the reason.
> >
> > I have one var in my data-set names case age. This variable is numeric
> as:
> >
> > class(SFDC$case_age)
> >
> > *numeric*
> >
> > however it throws this error:
> >
> > <0 rows> (or 0-length row.names)
> > As checked this only happens either there is some space at the end of the
> > variable name, or there are no values whereas this is a numeric variable
> > with no missing values and has a total of 5400 observations.
> >
> > This var has a range from 0 to 240 in number of days for case variable
> > hence i need to do a logarithm transformation & make it use in the model.
> > Total unique obs are around 1500.
> >
> > Please advice.
> >
> > [[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.
>
> CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments
> transmitted, may contain privileged and confidential information and is
> intended solely for the exclusive use of the individual or entity to whom
> it is addressed. If you are not the intended recipient, you are hereby
> notified that any review, dissemination, distribution or copying of this
> e-mail and/or attachments is strictly prohibited. If you have received this
> e-mail in error, please immediately notify the sender stating that this
> transmission was misdirected; return the e-mail to sender; destroy all
> paper copies and delete all electronic copies from your system without
> disclosing its contents.
>

[[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] 0 rows> (or 0-length row.names)

2016-08-30 Thread Shivi Bhatia
I know this question has been asked zillion times but even after consulting
Stack Overflow & other forum cant figure out the reason.

I have one var in my data-set names case age. This variable is numeric as:

class(SFDC$case_age)

*numeric*

however it throws this error:

<0 rows> (or 0-length row.names)
As checked this only happens either there is some space at the end of the
variable name, or there are no values whereas this is a numeric variable
with no missing values and has a total of 5400 observations.

This var has a range from 0 to 240 in number of days for case variable
hence i need to do a logarithm transformation & make it use in the model.
Total unique obs are around 1500.

Please advice.

[[alternative HTML version deleted]]

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


Re: [R] Error in riv package

2016-08-18 Thread Shivi Bhatia
Hi Ista, Thanks for your reply.

I had added a detailed explanation on this one & researched before asking.
May be someone did not read it i cant do much though David's explanation
helped as why it wasnt able to run the syntax.

Please see trail mail: (though i have already moved ahead and taken an
alternate package to calculate IV for each var at a time):


HI Team,
I am working to reduce the # of predictor variables from the model using woe
and iv values. For this i am using riv package. However i am
having a hard time installing this package:
install_github("riv","tomasgreif")
install.packages("DBI",dependencies=TRUE)
The error i receive is :
*Username parameter is deprecated. Please use tomasgreif/riv

and THEN this part:

The other approach i have to use the library(InformationValue). I have this  as
below:
 WOE(X=SFDC1$support_cat, Y=SFDC1$survey)
 WOETable(X=SFDC1$support_cat, Y=SFDC1$survey)
IV(X=SFDC1$support_cat, Y=SFDC1$survey)

This package assists me achieve what i am looking for but here i need to add
one independent variable at a time to see whether it is
predictive or not. Is there a way i can add all variables at a go or have
to add one by one,
For the above package (riv) i have seen an example which helps to take
the entire
data range and  predictive the power of each predictor. The
link for the same is:
 https://www.r-bloggers.com/r-credit-scoring-woe-
information-value-in-woe-package/



On Wed, Aug 17, 2016 at 10:35 PM, Ista Zahn <istaz...@gmail.com> wrote:

> On Aug 17, 2016 12:30 PM, "Jeff Newmiller" <jdnew...@dcn.davis.ca.us>
> wrote:
> >
> > Not our problem.
>
> Maybe maybe not. I'd say we don't have enough information to determine if
> this is on topic for R-help or not (I assume this is what you meant by 'not
> our problem').
>
> Shivi, if you want help from this list you need to tell us exactly what
> you did and exactly what happened. Refer to http://www.catb.org/esr/faqs/
> smart-questions.html and http://adv-r.had.co.nz/Reproducibility.html for
> guidance on how to ask for help effectively.
>
> Best,
> Ista
>
> Please correspond with the maintainer of that package.
> > --
> > Sent from my phone. Please excuse my brevity.
> >
> > On August 17, 2016 3:23:33 AM PDT, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> > >Hi David,
> > >
> > >If this has loaded correctly then it still does not allow me to run
> > >iv.multi command where a can add all the variables in the model and
> > >find
> > >their respective WOE and IV values.
> > >
> > >Thanks, Shivi
> > >
> > >On Wed, Aug 17, 2016 at 1:17 AM, David Winsemius
> > ><dwinsem...@comcast.net>
> > >wrote:
> > >
> > >>
> > >> > On Aug 16, 2016, at 11:07 AM, Shivi Bhatia <shivipm...@gmail.com>
> > >wrote:
> > >> >
> > >> > HI Team,
> > >> >
> > >> > I am working to reduce the # of predictor variables from the model
> > >using
> > >> > woe and iv values. For this i am using riv package. However i am
> > >having a
> > >> > hard time installing this package:
> > >> >
> > >> > install_github("riv","tomasgreif")
> > >> > install.packages("DBI",dependencies=TRUE)
> > >> >
> > >> > The error i receive is :
> > >> > *Username parameter is deprecated. Please use tomasgreif/riv *
> > >>
> > >> No. You did not get an error message. It was clearly labeled a
> > >:Warning
> > >> message". Here is the full console output from that call:
> > >>
> > >> > install_github("riv","tomasgreif")
> > >> Downloading GitHub repo tomasgreif/riv@master
> > >> from URL https://api.github.com/repos/tomasgreif/riv/zipball/master
> > >> Installing woe
> > >> '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file
> > >> --no-environ  \
> > >>   --no-save --no-restore --quiet CMD INSTALL  \
> > >>
> > >'/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s8gn/T/Rtmp6YDYoj/
> > >> devtoolsadc32ead1a82/tomasgreif-woe-43fcf26'  \
> > >>
> > >--library='/Library/Frameworks/R.framework/Versions/3.3/Resources/
> library'
> > >> \
> > >>   --install-tests
> > >>
> > >> * installing *source* package ‘woe’ ...
> > >> ** R
> > >> ** data
> > >> *** moving datasets to lazyload DB
> > >> ** demo
> > >> ** 

Re: [R] Error in riv package

2016-08-17 Thread Shivi Bhatia
WOW!!!

On Wed, Aug 17, 2016 at 8:15 PM, Jeff Newmiller <jdnew...@dcn.davis.ca.us>
wrote:

> Not our problem.  Please correspond with the maintainer of that package.
> --
> Sent from my phone. Please excuse my brevity.
>
> On August 17, 2016 3:23:33 AM PDT, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> >Hi David,
> >
> >If this has loaded correctly then it still does not allow me to run
> >iv.multi command where a can add all the variables in the model and
> >find
> >their respective WOE and IV values.
> >
> >Thanks, Shivi
> >
> >On Wed, Aug 17, 2016 at 1:17 AM, David Winsemius
> ><dwinsem...@comcast.net>
> >wrote:
> >
> >>
> >> > On Aug 16, 2016, at 11:07 AM, Shivi Bhatia <shivipm...@gmail.com>
> >wrote:
> >> >
> >> > HI Team,
> >> >
> >> > I am working to reduce the # of predictor variables from the model
> >using
> >> > woe and iv values. For this i am using riv package. However i am
> >having a
> >> > hard time installing this package:
> >> >
> >> > install_github("riv","tomasgreif")
> >> > install.packages("DBI",dependencies=TRUE)
> >> >
> >> > The error i receive is :
> >> > *Username parameter is deprecated. Please use tomasgreif/riv *
> >>
> >> No. You did not get an error message. It was clearly labeled a
> >:Warning
> >> message". Here is the full console output from that call:
> >>
> >> > install_github("riv","tomasgreif")
> >> Downloading GitHub repo tomasgreif/riv@master
> >> from URL https://api.github.com/repos/tomasgreif/riv/zipball/master
> >> Installing woe
> >> '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file
> >> --no-environ  \
> >>   --no-save --no-restore --quiet CMD INSTALL  \
> >>
> >'/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s8gn/T/Rtmp6YDYoj/
> >> devtoolsadc32ead1a82/tomasgreif-woe-43fcf26'  \
> >>
> >--library='/Library/Frameworks/R.framework/Versions/3.3/Resources/
> library'
> >> \
> >>   --install-tests
> >>
> >> * installing *source* package ‘woe’ ...
> >> ** R
> >> ** data
> >> *** moving datasets to lazyload DB
> >> ** demo
> >> ** preparing package for lazy loading
> >> ** help
> >> *** installing help indices
> >> ** building package indices
> >> ** testing if installed package can be loaded
> >> * DONE (woe)
> >> Warning message:
> >> Username parameter is deprecated. Please use tomasgreif/riv
> >>
> >>
> >> It's just telling you to use this next time:
> >>
> >> install_github("tomasgreif/riv")
> >>
> >> I will lay long odds that you already have the package installed.
> >>
> >> I cannot comment on what this package purports to do. I'm somewhat
> >> suspicious that it is statistically suspect.
> >>
> >> --
> >> David.
> >>
> >> >
> >> > The other approach i have to use the library(InformationValue). I
> >have
> >> this
> >> > as below:
> >> > WOE(X=SFDC1$support_cat, Y=SFDC1$survey)
> >> > WOETable(X=SFDC1$support_cat, Y=SFDC1$survey)
> >> > IV(X=SFDC1$support_cat, Y=SFDC1$survey)
> >> >
> >> > This package assists me achieve what i am looking for but here i
> >need to
> >> > add one independent variable at a time to see whether it is
> >predictive or
> >> > not. Is there a way i can add all variables at a go or have to add
> >one by
> >> > one,
> >> >
> >> > For the above package (riv) i have seen an example which helps to
> >take
> >> the
> >> > entire data range and  predictive the power of each predictor. The
> >link
> >> for
> >> > the same is:
> >> > https://www.r-bloggers.com/r-credit-scoring-woe-
> >> information-value-in-woe-
> >> > package/
> >> >
> >> > Thanks, Shivi
> >> >
> >> >   [[alternative HTML version deleted]]
> >> >
> >> > __
> >> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> > https://stat.ethz.ch/mailman/listinfo/r-help
> >> > PLEASE do read the posting guide http://www.R-project.org/
> >> posting-guide.html
> >> > and provide commented, minimal, self-contained, reproducible code.
> >>
> >> David Winsemius
> >> Alameda, CA, USA
> >>
> >>
> >
> >   [[alternative HTML version deleted]]
> >
> >__
> >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
>

[[alternative HTML version deleted]]

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

Re: [R] Error in riv package

2016-08-17 Thread Shivi Bhatia
Hi David,

If this has loaded correctly then it still does not allow me to run
iv.multi command where a can add all the variables in the model and find
their respective WOE and IV values.

Thanks, Shivi

On Wed, Aug 17, 2016 at 1:17 AM, David Winsemius <dwinsem...@comcast.net>
wrote:

>
> > On Aug 16, 2016, at 11:07 AM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > HI Team,
> >
> > I am working to reduce the # of predictor variables from the model using
> > woe and iv values. For this i am using riv package. However i am having a
> > hard time installing this package:
> >
> > install_github("riv","tomasgreif")
> > install.packages("DBI",dependencies=TRUE)
> >
> > The error i receive is :
> > *Username parameter is deprecated. Please use tomasgreif/riv *
>
> No. You did not get an error message. It was clearly labeled a :Warning
> message". Here is the full console output from that call:
>
> > install_github("riv","tomasgreif")
> Downloading GitHub repo tomasgreif/riv@master
> from URL https://api.github.com/repos/tomasgreif/riv/zipball/master
> Installing woe
> '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file
> --no-environ  \
>   --no-save --no-restore --quiet CMD INSTALL  \
>   '/private/var/folders/yq/m3j1jqtj6hq6s5mq_v0jn3s8gn/T/Rtmp6YDYoj/
> devtoolsadc32ead1a82/tomasgreif-woe-43fcf26'  \
>   --library='/Library/Frameworks/R.framework/Versions/3.3/Resources/library'
> \
>   --install-tests
>
> * installing *source* package ‘woe’ ...
> ** R
> ** data
> *** moving datasets to lazyload DB
> ** demo
> ** preparing package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** testing if installed package can be loaded
> * DONE (woe)
> Warning message:
> Username parameter is deprecated. Please use tomasgreif/riv
>
>
> It's just telling you to use this next time:
>
> install_github("tomasgreif/riv")
>
> I will lay long odds that you already have the package installed.
>
> I cannot comment on what this package purports to do. I'm somewhat
> suspicious that it is statistically suspect.
>
> --
> David.
>
> >
> > The other approach i have to use the library(InformationValue). I have
> this
> > as below:
> > WOE(X=SFDC1$support_cat, Y=SFDC1$survey)
> > WOETable(X=SFDC1$support_cat, Y=SFDC1$survey)
> > IV(X=SFDC1$support_cat, Y=SFDC1$survey)
> >
> > This package assists me achieve what i am looking for but here i need to
> > add one independent variable at a time to see whether it is predictive or
> > not. Is there a way i can add all variables at a go or have to add one by
> > one,
> >
> > For the above package (riv) i have seen an example which helps to take
> the
> > entire data range and  predictive the power of each predictor. The link
> for
> > the same is:
> > https://www.r-bloggers.com/r-credit-scoring-woe-
> information-value-in-woe-
> > package/
> >
> > Thanks, Shivi
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
>

[[alternative HTML version deleted]]

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

[R] Error in riv package

2016-08-16 Thread Shivi Bhatia
HI Team,

I am working to reduce the # of predictor variables from the model using
woe and iv values. For this i am using riv package. However i am having a
hard time installing this package:

install_github("riv","tomasgreif")
install.packages("DBI",dependencies=TRUE)

The error i receive is :
*Username parameter is deprecated. Please use tomasgreif/riv *

The other approach i have to use the library(InformationValue). I have this
as below:
WOE(X=SFDC1$support_cat, Y=SFDC1$survey)
WOETable(X=SFDC1$support_cat, Y=SFDC1$survey)
IV(X=SFDC1$support_cat, Y=SFDC1$survey)

This package assists me achieve what i am looking for but here i need to
add one independent variable at a time to see whether it is predictive or
not. Is there a way i can add all variables at a go or have to add one by
one,

For the above package (riv) i have seen an example which helps to take the
entire data range and  predictive the power of each predictor. The link for
the same is:
https://www.r-bloggers.com/r-credit-scoring-woe-information-value-in-woe-
package/

Thanks, Shivi

[[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] glm.fit: fitted probabilities numerically 0 or 1 occurred & glm.fit: algorithm did not converge

2016-08-12 Thread Shivi Bhatia
Hi Michael,

In all the masking process some of the variables were missed. Please find
the updated file.

Also here is the updated code: (i am removed one of the var as it had
missing information):

glm.fit= glm(survey ~ support_cat + region+ support_lvl+ skill_group+
application_area+ functional_area+
  repS+ case_age+ case_status+ severity_level+
  sla_status, data = new, family = binomial)

Kindly assist with the same.

On Fri, Aug 12, 2016 at 11:05 PM, Michael Dewey <li...@dewey.myzen.co.uk>
wrote:

> Your example code refers to a variable which is not in your dataset (repS)
> so I get an error message. If I assume repS is in fact rep_score I get
> another variable not found (delivery_segmentation).
>
> I am afraid that I am unable to sort that one out so this is going to
> remain a mystery. I endorse Bert's suggestion of getting local help.
>
> On 12/08/2016 17:24, Shivi Bhatia wrote:
>
>> Hi Bert,
>>
>> Does this text file help. Apologies if this does not help as i have a
>> hard time on many occasions to get a reproducible example.
>>
>> If this doesn't work a CSV with only 100kb of data i can share.
>>
>> Regards, Shivi
>>
>> On Fri, Aug 12, 2016 at 8:50 PM, Shivi Bhatia <shivipm...@gmail.com
>> <mailto:shivipm...@gmail.com>> wrote:
>>
>> Sure Burt, i will share the data after masking it.  it isn't big
>>
>> regards, Shivi
>>
>> On Fri, Aug 12, 2016 at 8:36 PM, Bert Gunter <bgunter.4...@gmail.com
>> <mailto:bgunter.4...@gmail.com>> wrote:
>>
>> 1. No, changing to factor will make no difference.
>>
>> 2. I think that most likely your problem is your model is not
>> estimable/your design matrix is singular.  You should resolve
>> this by
>> consulting with a local statistical expert or, if your data set
>> is not
>> too large or confidential, posting your full dataset using
>> dput() (see
>> ?dput for how to do this).
>>
>> Cheers,
>> Bert
>> Bert Gunter
>>
>> "The trouble with having an open mind is that people keep coming
>> along
>> and sticking things into it."
>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>
>>
>> On Fri, Aug 12, 2016 at 7:58 AM, Shivi Bhatia
>> <shivipm...@gmail.com <mailto:shivipm...@gmail.com>> wrote:
>> > Hi Michael,
>> >
>> > There is no output as the model does not generate any
>> coefficients and
>> > simply throws this error.
>> >
>> > I hope you are not asking for a reproducible example.
>> >
>> > On Fri, Aug 12, 2016 at 7:30 PM, Michael Dewey
>> <li...@dewey.myzen.co.uk <mailto:li...@dewey.myzen.co.uk>>
>>
>> > wrote:
>> >
>> >> Dear Shivi
>> >>
>> >> Can you show us the output?
>> >>
>> >> And please do not post in HTML as it will mangle your post into
>> >> unreadability.
>> >>
>> >> On 12/08/2016 10:10, Shivi Bhatia wrote:
>> >>
>> >>> Hi Team,
>> >>>
>> >>> I am creating *my first* Logistic regression on R Studio. I
>> am working on
>> >>> a
>> >>>
>> >>> C-SAT data where rating (score) 0-8 is a dis-sat whereas
>> 9-10 are SAT. As
>> >>> these were in numeric form so i had as below created 2
>> classes:
>> >>>
>> >>> new$survey[new$score>=0 & new$score<=8]<- 0
>> >>> new$survey[new$score>=9]<- 1
>> >>> This works fine however the class still shows as "numeric"
>> and levels
>> >>> shows
>> >>> as "NULL". Do i still need to use "as.factor" to let R know
>> these are
>> >>> categorical variables.
>> >>>
>> >>> Also i have used the below code to run a logistic regression
>> with all the
>> >>> possible predictor variables:
>> >>> glm.fit= glm(survey ~ support_cat + region+ support_lvl+
>> ski

Re: [R] glm.fit: fitted probabilities numerically 0 or 1 occurred & glm.fit: algorithm did not converge

2016-08-12 Thread Shivi Bhatia
Sure Burt, i will share the data after masking it.  it isn't big

regards, Shivi

On Fri, Aug 12, 2016 at 8:36 PM, Bert Gunter <bgunter.4...@gmail.com> wrote:

> 1. No, changing to factor will make no difference.
>
> 2. I think that most likely your problem is your model is not
> estimable/your design matrix is singular.  You should resolve this by
> consulting with a local statistical expert or, if your data set is not
> too large or confidential, posting your full dataset using dput() (see
> ?dput for how to do this).
>
> Cheers,
> Bert
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Fri, Aug 12, 2016 at 7:58 AM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> > Hi Michael,
> >
> > There is no output as the model does not generate any coefficients and
> > simply throws this error.
> >
> > I hope you are not asking for a reproducible example.
> >
> > On Fri, Aug 12, 2016 at 7:30 PM, Michael Dewey <li...@dewey.myzen.co.uk>
> > wrote:
> >
> >> Dear Shivi
> >>
> >> Can you show us the output?
> >>
> >> And please do not post in HTML as it will mangle your post into
> >> unreadability.
> >>
> >> On 12/08/2016 10:10, Shivi Bhatia wrote:
> >>
> >>> Hi Team,
> >>>
> >>> I am creating *my first* Logistic regression on R Studio. I am working
> on
> >>> a
> >>>
> >>> C-SAT data where rating (score) 0-8 is a dis-sat whereas 9-10 are SAT.
> As
> >>> these were in numeric form so i had as below created 2 classes:
> >>>
> >>> new$survey[new$score>=0 & new$score<=8]<- 0
> >>> new$survey[new$score>=9]<- 1
> >>> This works fine however the class still shows as "numeric" and levels
> >>> shows
> >>> as "NULL". Do i still need to use "as.factor" to let R know these are
> >>> categorical variables.
> >>>
> >>> Also i have used the below code to run a logistic regression with all
> the
> >>> possible predictor variables:
> >>> glm.fit= glm(survey ~ support_cat + region+ support_lvl+ skill_group+
> >>> application_area+ functional_area+
> >>>   repS+ case_age+ case_status+ severity_level+
> >>>   sla_status+ delivery_segmentation, data = SFDC, family =
> >>> binomial)
> >>>
> >>> But it throws an error:-
> >>> Warning messages:
> >>> 1: glm.fit: algorithm did not converge
> >>> 2: glm.fit: fitted probabilities numerically 0 or 1 occurred
> >>>
> >>> I checked online for the error and it says:
> >>> "glm() uses an iterative re-weighted least squares algorithm. The
> >>> algorithm
> >>> hit the maximum number of allowed iterations before signalling
> >>> convergence.
> >>> The default,
> >>> documented in ?glm.control is 25."
> >>>
> >>> Kindly suggest on the above case and if i have to change my outcome
> var as
> >>> as.factor.
> >>>
> >>> Thank you, Shivi
> >>>
> >>> [[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/posti
> >>> ng-guide.html
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>>
> >>>
> >> --
> >> Michael
> >> http://www.dewey.myzen.co.uk/home.html
> >>
> >
> > [[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] glm.fit: fitted probabilities numerically 0 or 1 occurred & glm.fit: algorithm did not converge

2016-08-12 Thread Shivi Bhatia
Hi Michael,

There is no output as the model does not generate any coefficients and
simply throws this error.

I hope you are not asking for a reproducible example.

On Fri, Aug 12, 2016 at 7:30 PM, Michael Dewey <li...@dewey.myzen.co.uk>
wrote:

> Dear Shivi
>
> Can you show us the output?
>
> And please do not post in HTML as it will mangle your post into
> unreadability.
>
> On 12/08/2016 10:10, Shivi Bhatia wrote:
>
>> Hi Team,
>>
>> I am creating *my first* Logistic regression on R Studio. I am working on
>> a
>>
>> C-SAT data where rating (score) 0-8 is a dis-sat whereas 9-10 are SAT. As
>> these were in numeric form so i had as below created 2 classes:
>>
>> new$survey[new$score>=0 & new$score<=8]<- 0
>> new$survey[new$score>=9]<- 1
>> This works fine however the class still shows as "numeric" and levels
>> shows
>> as "NULL". Do i still need to use "as.factor" to let R know these are
>> categorical variables.
>>
>> Also i have used the below code to run a logistic regression with all the
>> possible predictor variables:
>> glm.fit= glm(survey ~ support_cat + region+ support_lvl+ skill_group+
>> application_area+ functional_area+
>>   repS+ case_age+ case_status+ severity_level+
>>   sla_status+ delivery_segmentation, data = SFDC, family =
>> binomial)
>>
>> But it throws an error:-
>> Warning messages:
>> 1: glm.fit: algorithm did not converge
>> 2: glm.fit: fitted probabilities numerically 0 or 1 occurred
>>
>> I checked online for the error and it says:
>> "glm() uses an iterative re-weighted least squares algorithm. The
>> algorithm
>> hit the maximum number of allowed iterations before signalling
>> convergence.
>> The default,
>> documented in ?glm.control is 25."
>>
>> Kindly suggest on the above case and if i have to change my outcome var as
>> as.factor.
>>
>> Thank you, Shivi
>>
>> [[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/posti
>> ng-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>

[[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] glm.fit: fitted probabilities numerically 0 or 1 occurred & glm.fit: algorithm did not converge

2016-08-12 Thread Shivi Bhatia
Hi Team,

I am creating *my first* Logistic regression on R Studio. I am working on a
C-SAT data where rating (score) 0-8 is a dis-sat whereas 9-10 are SAT. As
these were in numeric form so i had as below created 2 classes:

new$survey[new$score>=0 & new$score<=8]<- 0
new$survey[new$score>=9]<- 1
This works fine however the class still shows as "numeric" and levels shows
as "NULL". Do i still need to use "as.factor" to let R know these are
categorical variables.

Also i have used the below code to run a logistic regression with all the
possible predictor variables:
glm.fit= glm(survey ~ support_cat + region+ support_lvl+ skill_group+
application_area+ functional_area+
  repS+ case_age+ case_status+ severity_level+
  sla_status+ delivery_segmentation, data = SFDC, family = binomial)

But it throws an error:-
Warning messages:
1: glm.fit: algorithm did not converge
2: glm.fit: fitted probabilities numerically 0 or 1 occurred

I checked online for the error and it says:
"glm() uses an iterative re-weighted least squares algorithm. The algorithm
hit the maximum number of allowed iterations before signalling convergence.
The default,
documented in ?glm.control is 25."

Kindly suggest on the above case and if i have to change my outcome var as
as.factor.

Thank you, Shivi

[[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] Creating Dummy Var in R for regression?

2016-08-07 Thread Shivi Bhatia
Thank you Jeremiah and all others for the assistance. This really helped.

On Sat, Aug 6, 2016 at 5:01 AM, jeremiah rounds <roundsjerem...@gmail.com>
wrote:

> Something like:
>
> d  =  data.frame(score = sample(1:10, 100, replace=TRUE))
> d$score_t = "low"
> d$score_t[d$score > 3] = "medium"
> d$score_t[d$score >7 ] = "high"
> d$score_t = factor(d$score_t, levels = c("low", "medium", "high"),
> ordered=TRUE)  #set ordered = FALSE for dummy variables
> X = model.matrix(~score_t, data=d)
> X
>
>
>
> On Fri, Aug 5, 2016 at 3:23 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:
>
>> Thanks you all for the assistance. This really helps.
>>
>> Hi Bert: While searching nabble i got to know R with factors variables
>> there is no need to create dummy variable. However please consider this
>> situation:
>> I am in the process of building a logistic regression model on NPS data.
>> The outcome variable is CE i.e. customer experience which has 3 rating so
>> ordinal logistic regression will be used. However most of my variables are
>> categorical. For instance one of the variable is agent knowledge which is
>> a
>> 10 point scale.
>>
>> This agent knowledge is again a 3 rated scale: high medium low hence i
>> need
>> to group these 10 values into 3 groups & then as you suggested i can
>> directly enter them in the model without creating n-1 categories.
>>
>> I have worked on SAS extensively hence found this a bit confusing.
>>
>> Thanks for the help.
>>
>> On Sat, Aug 6, 2016 at 2:30 AM, Bert Gunter <bgunter.4...@gmail.com>
>> wrote:
>>
>> > Just commenting on the email subject, not the content (which you have
>> > already been helped with): there is no need to *ever* create a dummy
>> > variable for regression in R if what you mean by this is what is
>> > conventionally meant. R will create the model matrix with appropriate
>> > "dummy variables" for factors as needed. See ?contrasts and ?C for
>> > relevant details and/or consult an appropriate R tutorial.
>> >
>> > Of course, if this is not what you meant, than ignore.
>> >
>> > Cheers,
>> > Bert
>> >
>> >
>> > Bert Gunter
>> >
>> > "The trouble with having an open mind is that people keep coming along
>> > and sticking things into it."
>> > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>> >
>> >
>> > On Fri, Aug 5, 2016 at 1:49 PM,  <ruipbarra...@sapo.pt> wrote:
>> > > Hello,
>> > >
>> > > Your ifelse will never work because
>> > > reasons$salutation== "Mr" & reasons$salutation=="Father" is always
>> FALSE
>> > > and so is reasons$salutation=="Mrs" & reasons$salutation=="Miss".
>> > > Try instead | (or), not & (and).
>> > >
>> > > Hope this helps,
>> > >
>> > > Rui Barradas
>> > >
>> > >
>> > >
>> > > Citando Shivi Bhatia <shivipm...@gmail.com>:
>> > >
>> > >> Dear Team,
>> > >>
>> > >> I need help with the below code in R:
>> > >>
>> > >> gender_rec<- c('Dr','Father','Mr'=1, 'Miss','MS','Mrs'=2, 3)
>> > >>
>> > >> reasons$salutation<- gender_rec[reasons$salutation].
>> > >>
>> > >> This code gives me the correct output but it overwrites the
>> > >> reason$salutation variable. I need to create a new variable gender to
>> > >> capture gender details and leave salutation as it is.
>> > >>
>> > >> i tried the below syntax but it is converting all to 1.
>> > >>
>> > >> reasons$gender<- ifelse(reasons$salutation== "Mr" &
>> reasons$salutation==
>> > >> "Father","Male", ifelse(reasons$salutation=="Mrs" &
>> > reasons$salutation==
>> > >> "Miss","Female",1))
>> > >>
>> > >> Please suggest.
>> > >>
>> > >> [[alternative HTML version deleted]]
>> > >>
>> > >> __
>> > >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > >> https://stat.ethz.ch/mailman/listinfo/r-help
>> > 

Re: [R] Creating Dummy Var in R for regression?

2016-08-05 Thread Shivi Bhatia
Thanks you all for the assistance. This really helps.

Hi Bert: While searching nabble i got to know R with factors variables
there is no need to create dummy variable. However please consider this
situation:
I am in the process of building a logistic regression model on NPS data.
The outcome variable is CE i.e. customer experience which has 3 rating so
ordinal logistic regression will be used. However most of my variables are
categorical. For instance one of the variable is agent knowledge which is a
10 point scale.

This agent knowledge is again a 3 rated scale: high medium low hence i need
to group these 10 values into 3 groups & then as you suggested i can
directly enter them in the model without creating n-1 categories.

I have worked on SAS extensively hence found this a bit confusing.

Thanks for the help.

On Sat, Aug 6, 2016 at 2:30 AM, Bert Gunter <bgunter.4...@gmail.com> wrote:

> Just commenting on the email subject, not the content (which you have
> already been helped with): there is no need to *ever* create a dummy
> variable for regression in R if what you mean by this is what is
> conventionally meant. R will create the model matrix with appropriate
> "dummy variables" for factors as needed. See ?contrasts and ?C for
> relevant details and/or consult an appropriate R tutorial.
>
> Of course, if this is not what you meant, than ignore.
>
> Cheers,
> Bert
>
>
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Fri, Aug 5, 2016 at 1:49 PM,  <ruipbarra...@sapo.pt> wrote:
> > Hello,
> >
> > Your ifelse will never work because
> > reasons$salutation== "Mr" & reasons$salutation=="Father" is always FALSE
> > and so is reasons$salutation=="Mrs" & reasons$salutation=="Miss".
> > Try instead | (or), not & (and).
> >
> > Hope this helps,
> >
> > Rui Barradas
> >
> >
> >
> > Citando Shivi Bhatia <shivipm...@gmail.com>:
> >
> >> Dear Team,
> >>
> >> I need help with the below code in R:
> >>
> >> gender_rec<- c('Dr','Father','Mr'=1, 'Miss','MS','Mrs'=2, 3)
> >>
> >> reasons$salutation<- gender_rec[reasons$salutation].
> >>
> >> This code gives me the correct output but it overwrites the
> >> reason$salutation variable. I need to create a new variable gender to
> >> capture gender details and leave salutation as it is.
> >>
> >> i tried the below syntax but it is converting all to 1.
> >>
> >> reasons$gender<- ifelse(reasons$salutation== "Mr" & reasons$salutation==
> >> "Father","Male", ifelse(reasons$salutation=="Mrs" &
> reasons$salutation==
> >> "Miss","Female",1))
> >>
> >> Please suggest.
> >>
> >> [[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.htmland provide commented,
> >> minimal, self-contained, reproducible code.
> >
> >
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


[R] Creating Dummy Var in R for regression?

2016-08-05 Thread Shivi Bhatia
Dear Team,

I need help with the below code in R:

gender_rec<- c('Dr','Father','Mr'=1, 'Miss','MS','Mrs'=2, 3)

reasons$salutation<- gender_rec[reasons$salutation].

This code gives me the correct output but it overwrites the
reason$salutation variable. I need to create a new variable gender to
capture gender details and leave salutation as it is.

i tried the below syntax but it is converting all to 1.

reasons$gender<- ifelse(reasons$salutation== "Mr" & reasons$salutation==
"Father","Male", ifelse(reasons$salutation=="Mrs" & reasons$salutation==
"Miss","Female",1))

Please suggest.

[[alternative HTML version deleted]]

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


Re: [R] Help with the RMD Output & rCharts Package

2016-08-04 Thread Shivi Bhatia
Found an alternative,

error A) was because the score.sentiment was calling the stringr package so
called it at the start of the RMD file
error B) looked for other alternative as rcharts didnt worked

On Thu, Aug 4, 2016 at 6:39 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:

> Dear Team,
>
> I am in need of urgent help on RMD output in html.
>
> A) I am working on a sentiment analysis problem and have built a sentiment
> model which works perfectly on R Studio however the same on the RMD shows
> all the processing steps and details.
>
> I have used echo= FALSE but i still the see the output as below:
> Loading required package: stringr
> Attaching package: 'stringr'
> The following object is masked from 'package:qdap':
> The following object is masked from 'package:igraph':%>%
>
> B) i am also using rcharts to create charts on the above but as mentioned
> above i dont see output in RMD whereas i see the output in R studio. The
> code for the same is"
> p4 <- nPlot(~ score, data = abc.sentiments, type = 'pieChart')
> p4$chart(donut = TRUE)
> p4
>
>
> Please let me know if i need to share the sentiment code in a text file.
>
>
>

[[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 with the RMD Output & rCharts Package

2016-08-04 Thread Shivi Bhatia
Dear Team,

I am in need of urgent help on RMD output in html.

A) I am working on a sentiment analysis problem and have built a sentiment
model which works perfectly on R Studio however the same on the RMD shows
all the processing steps and details.

I have used echo= FALSE but i still the see the output as below:
Loading required package: stringr
Attaching package: 'stringr'
The following object is masked from 'package:qdap':
The following object is masked from 'package:igraph':%>%

B) i am also using rcharts to create charts on the above but as mentioned
above i dont see output in RMD whereas i see the output in R studio. The
code for the same is"
p4 <- nPlot(~ score, data = abc.sentiments, type = 'pieChart')
p4$chart(donut = TRUE)
p4


Please let me know if i need to share the sentiment code in a text file.

[[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] WordCloud Does not display in RMD File in R Studio

2016-07-29 Thread Shivi Bhatia
Hi Yihui,

Seems like the issue was with the wordcloud. I used wordcloud2 and it
worked handsomely.

& thanks for suggesting wordcloud2 seems far better than wordcloud.

tc.

On Sat, Jul 30, 2016 at 12:00 AM, Shivi Bhatia <shivipm...@gmail.com> wrote:

> Thanks for the suggestion. even without png isnt not working.
>
> I will check this new package. Thank you.
>
> On Fri, Jul 29, 2016 at 11:45 PM, Yihui Xie <x...@yihui.name> wrote:
>
>> Typically you don't need to open the png() device manually. Try
>> comment out that line.
>>
>> BTW, I'm not sure which wordcloud package you were using, but this one
>> is the best one I have seen: https://github.com/Lchiffon/wordcloud2
>>
>> Regards,
>> Yihui
>> --
>> Yihui Xie <xieyi...@gmail.com>
>> Web: http://yihui.name
>>
>>
>> On Fri, Jul 29, 2016 at 11:53 AM, Shivi Bhatia <shivipm...@gmail.com>
>> wrote:
>> > Dear Team,
>> >
>> > I have created a text mining solution for one of my business owners.
>> >
>> > I am sharing with his using RMD via HTML. All is working ok however the
>> > WordCloud does not populate any output in RMD file.
>> >
>> > Few months back when this happened on R studio i searched and used
>> > dev.off() to shut down any concurrent running session but this also does
>> > not help.
>> >
>> > Other plots that i have created such ggplot and barpplot they are being
>> > displayed. similarly i can show wordcloud also in R Studio but not on
>> RMD.
>> >
>> > Not sure what i am doing wrong as i only get a message staing NULL when
>> i
>> > run wordcloud.
>> > Plz find the code for wordcloud if that helps:
>> > word0<- names(frequency)
>> > png("p3_sa_para.png", 640, 480)
>> >
>> >
>> > wordcloud(word0,frequency,random.order =F,
>> > colors = brewer.pal(8, "Dark2"),scale = c(5.5,0.5),min.freq = 100,
>> > max.words = Inf)
>> >
>>
>
>

[[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] WordCloud Does not display in RMD File in R Studio

2016-07-29 Thread Shivi Bhatia
Thanks for the suggestion. even without png isnt not working.

I will check this new package. Thank you.

On Fri, Jul 29, 2016 at 11:45 PM, Yihui Xie <x...@yihui.name> wrote:

> Typically you don't need to open the png() device manually. Try
> comment out that line.
>
> BTW, I'm not sure which wordcloud package you were using, but this one
> is the best one I have seen: https://github.com/Lchiffon/wordcloud2
>
> Regards,
> Yihui
> --
> Yihui Xie <xieyi...@gmail.com>
> Web: http://yihui.name
>
>
> On Fri, Jul 29, 2016 at 11:53 AM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> > Dear Team,
> >
> > I have created a text mining solution for one of my business owners.
> >
> > I am sharing with his using RMD via HTML. All is working ok however the
> > WordCloud does not populate any output in RMD file.
> >
> > Few months back when this happened on R studio i searched and used
> > dev.off() to shut down any concurrent running session but this also does
> > not help.
> >
> > Other plots that i have created such ggplot and barpplot they are being
> > displayed. similarly i can show wordcloud also in R Studio but not on
> RMD.
> >
> > Not sure what i am doing wrong as i only get a message staing NULL when i
> > run wordcloud.
> > Plz find the code for wordcloud if that helps:
> > word0<- names(frequency)
> > png("p3_sa_para.png", 640, 480)
> >
> >
> > wordcloud(word0,frequency,random.order =F,
> > colors = brewer.pal(8, "Dark2"),scale = c(5.5,0.5),min.freq = 100,
> > max.words = Inf)
> >
>

[[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] WordCloud Does not display in RMD File in R Studio

2016-07-29 Thread Shivi Bhatia
Dear Team,

I have created a text mining solution for one of my business owners.

I am sharing with his using RMD via HTML. All is working ok however the
WordCloud does not populate any output in RMD file.

Few months back when this happened on R studio i searched and used
dev.off() to shut down any concurrent running session but this also does
not help.

Other plots that i have created such ggplot and barpplot they are being
displayed. similarly i can show wordcloud also in R Studio but not on RMD.

Not sure what i am doing wrong as i only get a message staing NULL when i
run wordcloud.
Plz find the code for wordcloud if that helps:
word0<- names(frequency)
png("p3_sa_para.png", 640, 480)


wordcloud(word0,frequency,random.order =F,
colors = brewer.pal(8, "Dark2"),scale = c(5.5,0.5),min.freq = 100,
max.words = Inf)

[[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] Date Time in R

2016-07-26 Thread Shivi Bhatia
Thank you for all your tips. Will keep these checked.

Have a great day

On Wed, Jul 27, 2016 at 1:26 AM, William Dunlap <wdun...@tibco.com> wrote:

> Your original mail said
>Example of date - 05-30-16
>
>To change this i have used eir$date<- as.Date(eir$date, "%m-%d-%y")
>
> but by showing us the actual code I see you reversed the m and d and
> capitalized the Y in your first attempt, causing NA's since your data was
> not in that format.
>
> The big mistake was overwriting the raw data with this mistakenly
> processed data so subsequent attempts at processing it failed.
>
> I recommend never overwriting the raw data - read the data into a
> data.frame called, say, 'raw' and make a new data.frame called, say,
> 'cleaned' with all the transformations based on the raw data.  Iterate the
> cleaning step until you have it right but don't alter the raw data.  Use
> functions like head(), str(), plot(), and summary() to see if things look
> basically ok.   The transform() function may help with that.  E.g.,
>
> raw <- read.table(text="date\n05-30-16\n06-01-16\n06-27-16",
> header=TRUE)
> str(raw)
> #'data.frame':   3 obs. of  1 variable:
> #$ date: Factor w/ 3 levels "05-30-16","06-01-16",..: 1 2 3
> cleaned <- transform(raw, date=as.Date(date, format="%d-%m-%Y"))
> head(cleaned)
> #date
> #1   
> #2 0016-01-06
> #3   
> cleaned <- transform(raw, date=as.Date(date, format="%d-%m-%y"))
> head(cleaned)
> #date
> #1   
> #2 2016-01-06
> #3   
> cleaned <- transform(raw, date=as.Date(date, format="%m-%d-%y"))
> head(cleaned)
> #date
> #1 2016-05-30
>     #2 2016-06-01
> #3 2016-06-27
> That last one looks ok, so move on to your next tranformation step.
>
>
>
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Tue, Jul 26, 2016 at 9:59 AM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
>
>> These are some of the codes will i have
>> eir$date<- as.Date(eir$date, "%d-%m-%Y")
>> class(eir$date)
>> eir$week<- (eir$date)
>> eir$week<- weekdays(as.Date(eir$week))
>> eir$week<- as.factor(eir$week)
>>
>> On Tue, Jul 26, 2016 at 10:24 PM, Shivi Bhatia <shivipm...@gmail.com>
>> wrote:
>>
>>> Hi Bill,
>>>
>>> I have mentioned the transformation all on the email above.
>>>
>>> Regards, Shivi
>>>
>>> On Tue, Jul 26, 2016 at 10:19 PM, William Dunlap <wdun...@tibco.com>
>>> wrote:
>>>
>>>> Can you show us what transformations you tried when
>>>> you saw the column called 'date' was a factor?
>>>>
>>>> Bill Dunlap
>>>> TIBCO Software
>>>> wdunlap tibco.com
>>>>
>>>> On Tue, Jul 26, 2016 at 9:33 AM, Shivi Bhatia <shivipm...@gmail.com>
>>>> wrote:
>>>>
>>>>> Thanks Tom for the recommendation. This is now working.
>>>>>
>>>>> Apologies if this sounds like a juvenile but i am not very good with
>>>>> dates
>>>>> in R. What i initially did when i saw date as factor and then tried
>>>>> converting with lot many transformation that is where it went bad.
>>>>>
>>>>> But thanks to all this is really what i wanted.
>>>>>
>>>>> On Tue, Jul 26, 2016 at 9:58 PM, Tom Wright <t...@maladmin.com> wrote:
>>>>>
>>>>> > So this looks correct so far.
>>>>> >
>>>>> >
>>>>> >
>>>>> > # convert strings (or factors) to a date object
>>>>> >
>>>>> > a1$date <- as.Date(a1$date, “%m-%d-%y”)
>>>>> >
>>>>> >
>>>>> >
>>>>> > # Note the date object is now displayed in the format %Y-%m-%d by
>>>>> default
>>>>> >
>>>>> > # so no need for the mdy() or ymd() function
>>>>> >
>>>>> >
>>>>> >
>>>>> > # extract the weekdays as number
>>>>> >
>>>>> > weekdays <- wday(a1$date)
>>>>> >
>>>>> >
>>>>> >
>>>>> > # note can’t have spaces in variable names
>>>>> >
>>>>> > week_names <- wday(a1$date, label=TRUE)
>>>>> >
>>>>&

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
These are some of the codes will i have
eir$date<- as.Date(eir$date, "%d-%m-%Y")
class(eir$date)
eir$week<- (eir$date)
eir$week<- weekdays(as.Date(eir$week))
eir$week<- as.factor(eir$week)

On Tue, Jul 26, 2016 at 10:24 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:

> Hi Bill,
>
> I have mentioned the transformation all on the email above.
>
> Regards, Shivi
>
> On Tue, Jul 26, 2016 at 10:19 PM, William Dunlap <wdun...@tibco.com>
> wrote:
>
>> Can you show us what transformations you tried when
>> you saw the column called 'date' was a factor?
>>
>> Bill Dunlap
>> TIBCO Software
>> wdunlap tibco.com
>>
>> On Tue, Jul 26, 2016 at 9:33 AM, Shivi Bhatia <shivipm...@gmail.com>
>> wrote:
>>
>>> Thanks Tom for the recommendation. This is now working.
>>>
>>> Apologies if this sounds like a juvenile but i am not very good with
>>> dates
>>> in R. What i initially did when i saw date as factor and then tried
>>> converting with lot many transformation that is where it went bad.
>>>
>>> But thanks to all this is really what i wanted.
>>>
>>> On Tue, Jul 26, 2016 at 9:58 PM, Tom Wright <t...@maladmin.com> wrote:
>>>
>>> > So this looks correct so far.
>>> >
>>> >
>>> >
>>> > # convert strings (or factors) to a date object
>>> >
>>> > a1$date <- as.Date(a1$date, “%m-%d-%y”)
>>> >
>>> >
>>> >
>>> > # Note the date object is now displayed in the format %Y-%m-%d by
>>> default
>>> >
>>> > # so no need for the mdy() or ymd() function
>>> >
>>> >
>>> >
>>> > # extract the weekdays as number
>>> >
>>> > weekdays <- wday(a1$date)
>>> >
>>> >
>>> >
>>> > # note can’t have spaces in variable names
>>> >
>>> > week_names <- wday(a1$date, label=TRUE)
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
>>> > *Sent:* July 26, 2016 12:16 PM
>>> > *To:* Tom Wright <t...@maladmin.com>
>>> > *Cc:* David L Carlson <dcarl...@tamu.edu>; r-help <
>>> r-help@r-project.org>
>>>
>>> >
>>> > *Subject:* Re: [R] Date Time in R
>>> >
>>> >
>>> >
>>> > Hello Tom,
>>> >
>>> >
>>> >
>>> > Please find the details: (i have changed name from eir to a1, rest all
>>> is
>>> > same)
>>> >
>>> >
>>> >
>>> > str(a1$date)
>>> >
>>> >  Factor w/ 32 levels "05-30-16","05-31-16",..: 1 1 1
>>> >
>>> >
>>> >
>>> > head(a1$date)
>>> >
>>> > 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16
>>> >
>>> > 32 Levels: 05-30-16 05-31-16 06-01-16 06-02-16 06-03-16 06-04-16
>>> 06-05-16
>>> > 06-06-16 06-07-16 06-08-16
>>> >
>>> >
>>> >
>>> > Thanks again!!!
>>> >
>>> >
>>> >
>>> > On Tue, Jul 26, 2016 at 9:38 PM, Tom Wright <t...@maladmin.com> wrote:
>>> >
>>> > Hi again Shiva,
>>> > I think what we need to see is the output from:
>>> >
>>> > str(eid$date)
>>> >
>>> > and perhaps
>>> > head(eid$date)
>>> >
>>> > If you can send this information before doing any processing on the
>>> date
>>> > (i.e. before the as.Date() function) we may be able to help.
>>> >
>>> >
>>> >
>>> > -Original Message-
>>> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
>>> > Bhatia
>>> > Sent: July 26, 2016 11:46 AM
>>> > To: David L Carlson <dcarl...@tamu.edu>
>>> > Cc: r-help <r-help@r-project.org>
>>> > Subject: Re: [R] Date Time in R
>>> >
>>> > Hi David please see the code and some reproducible data:
>>> > eir$date<- as.Date(eir$date,format = "%m-%d-%y")  then i had used the
>>> > lubridate library to help with the dates:
>>> > install.packages("lubridate")
>>> > library(lubridate)
>>> > eir$date <- mdy(e

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
Hi Bill,

I have mentioned the transformation all on the email above.

Regards, Shivi

On Tue, Jul 26, 2016 at 10:19 PM, William Dunlap <wdun...@tibco.com> wrote:

> Can you show us what transformations you tried when
> you saw the column called 'date' was a factor?
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Tue, Jul 26, 2016 at 9:33 AM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
>
>> Thanks Tom for the recommendation. This is now working.
>>
>> Apologies if this sounds like a juvenile but i am not very good with dates
>> in R. What i initially did when i saw date as factor and then tried
>> converting with lot many transformation that is where it went bad.
>>
>> But thanks to all this is really what i wanted.
>>
>> On Tue, Jul 26, 2016 at 9:58 PM, Tom Wright <t...@maladmin.com> wrote:
>>
>> > So this looks correct so far.
>> >
>> >
>> >
>> > # convert strings (or factors) to a date object
>> >
>> > a1$date <- as.Date(a1$date, “%m-%d-%y”)
>> >
>> >
>> >
>> > # Note the date object is now displayed in the format %Y-%m-%d by
>> default
>> >
>> > # so no need for the mdy() or ymd() function
>> >
>> >
>> >
>> > # extract the weekdays as number
>> >
>> > weekdays <- wday(a1$date)
>> >
>> >
>> >
>> > # note can’t have spaces in variable names
>> >
>> > week_names <- wday(a1$date, label=TRUE)
>> >
>> >
>> >
>> >
>> >
>> > *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
>> > *Sent:* July 26, 2016 12:16 PM
>> > *To:* Tom Wright <t...@maladmin.com>
>> > *Cc:* David L Carlson <dcarl...@tamu.edu>; r-help <r-help@r-project.org
>> >
>>
>> >
>> > *Subject:* Re: [R] Date Time in R
>> >
>> >
>> >
>> > Hello Tom,
>> >
>> >
>> >
>> > Please find the details: (i have changed name from eir to a1, rest all
>> is
>> > same)
>> >
>> >
>> >
>> > str(a1$date)
>> >
>> >  Factor w/ 32 levels "05-30-16","05-31-16",..: 1 1 1
>> >
>> >
>> >
>> > head(a1$date)
>> >
>> > 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16
>> >
>> > 32 Levels: 05-30-16 05-31-16 06-01-16 06-02-16 06-03-16 06-04-16
>> 06-05-16
>> > 06-06-16 06-07-16 06-08-16
>> >
>> >
>> >
>> > Thanks again!!!
>> >
>> >
>> >
>> > On Tue, Jul 26, 2016 at 9:38 PM, Tom Wright <t...@maladmin.com> wrote:
>> >
>> > Hi again Shiva,
>> > I think what we need to see is the output from:
>> >
>> > str(eid$date)
>> >
>> > and perhaps
>> > head(eid$date)
>> >
>> > If you can send this information before doing any processing on the date
>> > (i.e. before the as.Date() function) we may be able to help.
>> >
>> >
>> >
>> > -Original Message-
>> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
>> > Bhatia
>> > Sent: July 26, 2016 11:46 AM
>> > To: David L Carlson <dcarl...@tamu.edu>
>> > Cc: r-help <r-help@r-project.org>
>> > Subject: Re: [R] Date Time in R
>> >
>> > Hi David please see the code and some reproducible data:
>> > eir$date<- as.Date(eir$date,format = "%m-%d-%y")  then i had used the
>> > lubridate library to help with the dates:
>> > install.packages("lubridate")
>> > library(lubridate)
>> > eir$date <- mdy(eir$date)
>> > weekdays <- wdy(eir$date)
>> > week names <- wdy(eir$date, label = TRUE)
>> >
>> > This the output from the file:
>> >
>> > structure(list(date = structure(c(NA_real_, NA_real_, NA_real_), class =
>> > "Date"),
>> >
>> > month = structure(c(2L, 2L, 2L), .Label = c("Jun","May"), class =
>> > "factor"),
>> >
>> > day = c(30L, 30L, 30L),
>> >
>> > weekday = structure(c(2L,2L, 2L), .Label = c("Fri", "Mon", "Sat", "Sun",
>> > "Thu", "Tue","Wed"), class = "factor"),
>> >
>> > survey_rating = c(3L, 2L, 3L), query_status = c("Yes", "Don't
>> kno

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
Thanks Tom for the recommendation. This is now working.

Apologies if this sounds like a juvenile but i am not very good with dates
in R. What i initially did when i saw date as factor and then tried
converting with lot many transformation that is where it went bad.

But thanks to all this is really what i wanted.

On Tue, Jul 26, 2016 at 9:58 PM, Tom Wright <t...@maladmin.com> wrote:

> So this looks correct so far.
>
>
>
> # convert strings (or factors) to a date object
>
> a1$date <- as.Date(a1$date, “%m-%d-%y”)
>
>
>
> # Note the date object is now displayed in the format %Y-%m-%d by default
>
> # so no need for the mdy() or ymd() function
>
>
>
> # extract the weekdays as number
>
> weekdays <- wday(a1$date)
>
>
>
> # note can’t have spaces in variable names
>
> week_names <- wday(a1$date, label=TRUE)
>
>
>
>
>
> *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
> *Sent:* July 26, 2016 12:16 PM
> *To:* Tom Wright <t...@maladmin.com>
> *Cc:* David L Carlson <dcarl...@tamu.edu>; r-help <r-help@r-project.org>
>
> *Subject:* Re: [R] Date Time in R
>
>
>
> Hello Tom,
>
>
>
> Please find the details: (i have changed name from eir to a1, rest all is
> same)
>
>
>
> str(a1$date)
>
>  Factor w/ 32 levels "05-30-16","05-31-16",..: 1 1 1
>
>
>
> head(a1$date)
>
> 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16
>
> 32 Levels: 05-30-16 05-31-16 06-01-16 06-02-16 06-03-16 06-04-16 06-05-16
> 06-06-16 06-07-16 06-08-16
>
>
>
> Thanks again!!!
>
>
>
> On Tue, Jul 26, 2016 at 9:38 PM, Tom Wright <t...@maladmin.com> wrote:
>
> Hi again Shiva,
> I think what we need to see is the output from:
>
> str(eid$date)
>
> and perhaps
> head(eid$date)
>
> If you can send this information before doing any processing on the date
> (i.e. before the as.Date() function) we may be able to help.
>
>
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
> Bhatia
> Sent: July 26, 2016 11:46 AM
> To: David L Carlson <dcarl...@tamu.edu>
> Cc: r-help <r-help@r-project.org>
> Subject: Re: [R] Date Time in R
>
> Hi David please see the code and some reproducible data:
> eir$date<- as.Date(eir$date,format = "%m-%d-%y")  then i had used the
> lubridate library to help with the dates:
> install.packages("lubridate")
> library(lubridate)
> eir$date <- mdy(eir$date)
> weekdays <- wdy(eir$date)
> week names <- wdy(eir$date, label = TRUE)
>
> This the output from the file:
>
> structure(list(date = structure(c(NA_real_, NA_real_, NA_real_), class =
> "Date"),
>
> month = structure(c(2L, 2L, 2L), .Label = c("Jun","May"), class =
> "factor"),
>
> day = c(30L, 30L, 30L),
>
> weekday = structure(c(2L,2L, 2L), .Label = c("Fri", "Mon", "Sat", "Sun",
> "Thu", "Tue","Wed"), class = "factor"),
>
> survey_rating = c(3L, 2L, 3L), query_status = c("Yes", "Don't know","No"),
>
>  a = c("05-30-16", "05-30-16", "05-30-16")), .Names = c("date","month",
> "day", "weekday", "survey_rating"), row.names = c(NA, 3L), class =
> "data.frame")
>
> There are several other variables that i have removed which are not
> relevant
> in this context.
>
> On Tue, Jul 26, 2016 at 8:55 PM, David L Carlson <dcarl...@tamu.edu>
> wrote:
>
> > Show us the output, don’t just tell us what you are seeing. If the
> > dates are correct in the csv file, show us the structure of the data
> > frame you created with read.csv() and show the command(s) you used to
> > convert the character data to date format. The solution is likely to
> > be simple if you will cut/paste the R console and not just describe what
> > is happening.
> >
> >
> >
> > David C
> >
> >
> >
>
> > *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
> > *Sent:* Tuesday, July 26, 2016 10:08 AM
> > *To:* David L Carlson
> >
> > *Subject:* Re: [R] Date Time in R
>
> >
> >
> >
> > Hi David,
> >
> > This gives the results accurately. The first line shows all the
> > variable names and the rest shows all values stored for each of the
> > variable. Here date is appearing as correct.
> >
> >
> >
> > Thanks, Shivi
> >
> >
> >
> > On Tue, Jul 26, 2016 a

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
Hello Tom,

Please find the details: (i have changed name from eir to a1, rest all is
same)

str(a1$date)
 Factor w/ 32 levels "05-30-16","05-31-16",..: 1 1 1

head(a1$date)
05-30-16 05-30-16 05-30-16 05-30-16 05-30-16 05-30-16
32 Levels: 05-30-16 05-31-16 06-01-16 06-02-16 06-03-16 06-04-16 06-05-16
06-06-16 06-07-16 06-08-16

Thanks again!!!

On Tue, Jul 26, 2016 at 9:38 PM, Tom Wright <t...@maladmin.com> wrote:

> Hi again Shiva,
> I think what we need to see is the output from:
>
> str(eid$date)
>
> and perhaps
> head(eid$date)
>
> If you can send this information before doing any processing on the date
> (i.e. before the as.Date() function) we may be able to help.
>
>
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
> Bhatia
> Sent: July 26, 2016 11:46 AM
> To: David L Carlson <dcarl...@tamu.edu>
> Cc: r-help <r-help@r-project.org>
> Subject: Re: [R] Date Time in R
>
> Hi David please see the code and some reproducible data:
> eir$date<- as.Date(eir$date,format = "%m-%d-%y")  then i had used the
> lubridate library to help with the dates:
> install.packages("lubridate")
> library(lubridate)
> eir$date <- mdy(eir$date)
> weekdays <- wdy(eir$date)
> week names <- wdy(eir$date, label = TRUE)
>
> This the output from the file:
>
> structure(list(date = structure(c(NA_real_, NA_real_, NA_real_), class =
> "Date"),
>
> month = structure(c(2L, 2L, 2L), .Label = c("Jun","May"), class =
> "factor"),
>
> day = c(30L, 30L, 30L),
>
> weekday = structure(c(2L,2L, 2L), .Label = c("Fri", "Mon", "Sat", "Sun",
> "Thu", "Tue","Wed"), class = "factor"),
>
> survey_rating = c(3L, 2L, 3L), query_status = c("Yes", "Don't know","No"),
>
>  a = c("05-30-16", "05-30-16", "05-30-16")), .Names = c("date","month",
> "day", "weekday", "survey_rating"), row.names = c(NA, 3L), class =
> "data.frame")
>
> There are several other variables that i have removed which are not
> relevant
> in this context.
>
> On Tue, Jul 26, 2016 at 8:55 PM, David L Carlson <dcarl...@tamu.edu>
> wrote:
>
> > Show us the output, don’t just tell us what you are seeing. If the
> > dates are correct in the csv file, show us the structure of the data
> > frame you created with read.csv() and show the command(s) you used to
> > convert the character data to date format. The solution is likely to
> > be simple if you will cut/paste the R console and not just describe what
> > is happening.
> >
> >
> >
> > David C
> >
> >
> >
> > *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
> > *Sent:* Tuesday, July 26, 2016 10:08 AM
> > *To:* David L Carlson
> >
> > *Subject:* Re: [R] Date Time in R
> >
> >
> >
> > Hi David,
> >
> > This gives the results accurately. The first line shows all the
> > variable names and the rest shows all values stored for each of the
> > variable. Here date is appearing as correct.
> >
> >
> >
> > Thanks, Shivi
> >
> >
> >
> > On Tue, Jul 26, 2016 at 7:39 PM, David L Carlson <dcarl...@tamu.edu>
> > wrote:
> >
> > What does this produce?
> >
> > > readLines("YourCSVfilename.csv", n=5)
> >
> > If the data are in Excel, the date format used in .csv files is not
> > always in the same as the format used when viewing dates in the
> > spreadsheet.
> >
> > -
> > David L Carlson
> > Department of Anthropology
> > Texas A University
> > College Station, TX 77840-4352
> >
> >
> >
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
> > Bhatia
> > Sent: Tuesday, July 26, 2016 7:42 AM
> > To: Marc Schwartz
> > Cc: R-help
> > Subject: Re: [R] Date Time in R
> >
> > Thanks Marc for the help. this really helps.
> > I think there is some issue with the data saved in csv format for this
> > variable as when i checked:
> > str(eir$date)- this results in :-
> > Date[1:5327], format: NA NA NA NA NA.
> >
> > Thanks again.
> >
> > On Tue, Jul 26, 2016 at 5:58 PM, Marc Schwartz <marc_schwa...@me.com>
> > wrote:
> >
> > > Hi,
> > >
> > > That eir$date might be a factor is irrel

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
Hi Team,

Please read wdy as wday it was mistakenly copied.


On Tue, Jul 26, 2016 at 9:15 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:

> Hi David please see the code and some reproducible data:
> eir$date<- as.Date(eir$date,format = "%m-%d-%y")  then i had used the
> lubridate library to help with the dates:
> install.packages("lubridate")
> library(lubridate)
> eir$date <- mdy(eir$date)
> weekdays <- wdy(eir$date)
> week names <- wdy(eir$date, label = TRUE)
>
> This the output from the file:
>
> structure(list(date = structure(c(NA_real_, NA_real_, NA_real_), class =
> "Date"),
>
> month = structure(c(2L, 2L, 2L), .Label = c("Jun","May"), class =
> "factor"),
>
> day = c(30L, 30L, 30L),
>
> weekday = structure(c(2L,2L, 2L), .Label = c("Fri", "Mon", "Sat", "Sun",
> "Thu", "Tue","Wed"), class = "factor"),
>
> survey_rating = c(3L, 2L, 3L), query_status = c("Yes", "Don't know",
> "No"),
>
>  a = c("05-30-16", "05-30-16", "05-30-16")), .Names = c("date","month",
> "day", "weekday", "survey_rating"), row.names = c(NA, 3L), class =
> "data.frame")
>
> There are several other variables that i have removed which are not
> relevant in this context.
>
> On Tue, Jul 26, 2016 at 8:55 PM, David L Carlson <dcarl...@tamu.edu>
> wrote:
>
>> Show us the output, don’t just tell us what you are seeing. If the dates
>> are correct in the csv file, show us the structure of the data frame you
>> created with read.csv() and show the command(s) you used to convert the
>> character data to date format. The solution is likely to be simple if you
>> will cut/paste the R console and not just describe what is happening.
>>
>>
>>
>> David C
>>
>>
>>
>> *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
>> *Sent:* Tuesday, July 26, 2016 10:08 AM
>> *To:* David L Carlson
>>
>> *Subject:* Re: [R] Date Time in R
>>
>>
>>
>> Hi David,
>>
>> This gives the results accurately. The first line shows all the variable
>> names and the rest shows all values stored for each of the variable. Here
>> date is appearing as correct.
>>
>>
>>
>> Thanks, Shivi
>>
>>
>>
>> On Tue, Jul 26, 2016 at 7:39 PM, David L Carlson <dcarl...@tamu.edu>
>> wrote:
>>
>> What does this produce?
>>
>> > readLines("YourCSVfilename.csv", n=5)
>>
>> If the data are in Excel, the date format used in .csv files is not
>> always in the same as the format used when viewing dates in the spreadsheet.
>>
>> -
>> David L Carlson
>> Department of Anthropology
>> Texas A University
>> College Station, TX 77840-4352
>>
>>
>>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
>> Bhatia
>> Sent: Tuesday, July 26, 2016 7:42 AM
>> To: Marc Schwartz
>> Cc: R-help
>> Subject: Re: [R] Date Time in R
>>
>> Thanks Marc for the help. this really helps.
>> I think there is some issue with the data saved in csv format for this
>> variable as when i checked:
>> str(eir$date)- this results in :-
>> Date[1:5327], format: NA NA NA NA NA.
>>
>> Thanks again.
>>
>> On Tue, Jul 26, 2016 at 5:58 PM, Marc Schwartz <marc_schwa...@me.com>
>> wrote:
>>
>> > Hi,
>> >
>> > That eir$date might be a factor is irrelevant. There is an as.Date()
>> > method for factors, which does the factor to character coercion
>> internally
>> > and then calls as.Date.character() on the result.
>> >
>> > Using the example data below:
>> >
>> > eir <- data.frame(date = c("05-30-16", "05-30-16", "05-30-16",
>> >"05-30-16", "05-30-16", "05-30-16"))
>> >
>> > > str(eir)
>> > 'data.frame':   6 obs. of  1 variable:
>> >  $ date: Factor w/ 1 level "05-30-16": 1 1 1 1 1 1
>> >
>> > > eir
>> >   date
>> > 1 05-30-16
>> > 2 05-30-16
>> > 3 05-30-16
>> > 4 05-30-16
>> > 5 05-30-16
>> > 6 05-30-16
>> >
>> > eir$date <- as.Date(eir$date, format = "%m-%d-%y")
>> >
>> > 

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
Hi David please see the code and some reproducible data:
eir$date<- as.Date(eir$date,format = "%m-%d-%y")  then i had used the
lubridate library to help with the dates:
install.packages("lubridate")
library(lubridate)
eir$date <- mdy(eir$date)
weekdays <- wdy(eir$date)
week names <- wdy(eir$date, label = TRUE)

This the output from the file:

structure(list(date = structure(c(NA_real_, NA_real_, NA_real_), class =
"Date"),

month = structure(c(2L, 2L, 2L), .Label = c("Jun","May"), class = "factor"),

day = c(30L, 30L, 30L),

weekday = structure(c(2L,2L, 2L), .Label = c("Fri", "Mon", "Sat", "Sun",
"Thu", "Tue","Wed"), class = "factor"),

survey_rating = c(3L, 2L, 3L), query_status = c("Yes", "Don't know","No"),

 a = c("05-30-16", "05-30-16", "05-30-16")), .Names = c("date","month",
"day", "weekday", "survey_rating"), row.names = c(NA, 3L), class =
"data.frame")

There are several other variables that i have removed which are not
relevant in this context.

On Tue, Jul 26, 2016 at 8:55 PM, David L Carlson <dcarl...@tamu.edu> wrote:

> Show us the output, don’t just tell us what you are seeing. If the dates
> are correct in the csv file, show us the structure of the data frame you
> created with read.csv() and show the command(s) you used to convert the
> character data to date format. The solution is likely to be simple if you
> will cut/paste the R console and not just describe what is happening.
>
>
>
> David C
>
>
>
> *From:* Shivi Bhatia [mailto:shivipm...@gmail.com]
> *Sent:* Tuesday, July 26, 2016 10:08 AM
> *To:* David L Carlson
>
> *Subject:* Re: [R] Date Time in R
>
>
>
> Hi David,
>
> This gives the results accurately. The first line shows all the variable
> names and the rest shows all values stored for each of the variable. Here
> date is appearing as correct.
>
>
>
> Thanks, Shivi
>
>
>
> On Tue, Jul 26, 2016 at 7:39 PM, David L Carlson <dcarl...@tamu.edu>
> wrote:
>
> What does this produce?
>
> > readLines("YourCSVfilename.csv", n=5)
>
> If the data are in Excel, the date format used in .csv files is not always
> in the same as the format used when viewing dates in the spreadsheet.
>
> -
> David L Carlson
> Department of Anthropology
> Texas A University
> College Station, TX 77840-4352
>
>
>
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi
> Bhatia
> Sent: Tuesday, July 26, 2016 7:42 AM
> To: Marc Schwartz
> Cc: R-help
> Subject: Re: [R] Date Time in R
>
> Thanks Marc for the help. this really helps.
> I think there is some issue with the data saved in csv format for this
> variable as when i checked:
> str(eir$date)- this results in :-
> Date[1:5327], format: NA NA NA NA NA.
>
> Thanks again.
>
> On Tue, Jul 26, 2016 at 5:58 PM, Marc Schwartz <marc_schwa...@me.com>
> wrote:
>
> > Hi,
> >
> > That eir$date might be a factor is irrelevant. There is an as.Date()
> > method for factors, which does the factor to character coercion
> internally
> > and then calls as.Date.character() on the result.
> >
> > Using the example data below:
> >
> > eir <- data.frame(date = c("05-30-16", "05-30-16", "05-30-16",
> >"05-30-16", "05-30-16", "05-30-16"))
> >
> > > str(eir)
> > 'data.frame':   6 obs. of  1 variable:
> >  $ date: Factor w/ 1 level "05-30-16": 1 1 1 1 1 1
> >
> > > eir
> >   date
> > 1 05-30-16
> > 2 05-30-16
> > 3 05-30-16
> > 4 05-30-16
> > 5 05-30-16
> > 6 05-30-16
> >
> > eir$date <- as.Date(eir$date, format = "%m-%d-%y")
> >
> > > str(eir)
> > 'data.frame':   6 obs. of  1 variable:
> >  $ date: Date, format: "2016-05-30" ...
> >
> > > eir
> > date
> > 1 2016-05-30
> > 2 2016-05-30
> > 3 2016-05-30
> > 4 2016-05-30
> > 5 2016-05-30
> > 6 2016-05-30
> >
> > eir$days <- weekdays(eir$date)
> >
> > > str(eir)
> > 'data.frame':   6 obs. of  2 variables:
> >  $ date: Date, format: "2016-05-30" ...
> >  $ days: chr  "Monday" "Monday" "Monday" "Monday" ...
> >
> > > eir
> > date   days
> > 1 2016-05-30 M

Re: [R] Date Time in R

2016-07-26 Thread Shivi Bhatia
Thanks Marc for the help. this really helps.
I think there is some issue with the data saved in csv format for this
variable as when i checked:
str(eir$date)- this results in :-
Date[1:5327], format: NA NA NA NA NA.

Thanks again.

On Tue, Jul 26, 2016 at 5:58 PM, Marc Schwartz <marc_schwa...@me.com> wrote:

> Hi,
>
> That eir$date might be a factor is irrelevant. There is an as.Date()
> method for factors, which does the factor to character coercion internally
> and then calls as.Date.character() on the result.
>
> Using the example data below:
>
> eir <- data.frame(date = c("05-30-16", "05-30-16", "05-30-16",
>"05-30-16", "05-30-16", "05-30-16"))
>
> > str(eir)
> 'data.frame':   6 obs. of  1 variable:
>  $ date: Factor w/ 1 level "05-30-16": 1 1 1 1 1 1
>
> > eir
>   date
> 1 05-30-16
> 2 05-30-16
> 3 05-30-16
> 4 05-30-16
> 5 05-30-16
> 6 05-30-16
>
> eir$date <- as.Date(eir$date, format = "%m-%d-%y")
>
> > str(eir)
> 'data.frame':   6 obs. of  1 variable:
>  $ date: Date, format: "2016-05-30" ...
>
> > eir
> date
> 1 2016-05-30
> 2 2016-05-30
> 3 2016-05-30
> 4 2016-05-30
> 5 2016-05-30
> 6 2016-05-30
>
> eir$days <- weekdays(eir$date)
>
> > str(eir)
> 'data.frame':   6 obs. of  2 variables:
>  $ date: Date, format: "2016-05-30" ...
>  $ days: chr  "Monday" "Monday" "Monday" "Monday" ...
>
> > eir
> date   days
> 1 2016-05-30 Monday
> 2 2016-05-30 Monday
> 3 2016-05-30 Monday
> 4 2016-05-30 Monday
> 5 2016-05-30 Monday
> 6 2016-05-30 Monday
>
>
> I would check to be sure that you do not have any typos in your code.
>
> Regards,
>
> Marc Schwartz
>
>
> > On Jul 26, 2016, at 6:58 AM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > Hello Again,
> >
> > While i tried your solution as you suggested above it seems to be
> working.
> > Here is the output
> > temp<- dput(head(eir$date))
> > c("05-30-16", "05-30-16", "05-30-16", "05-30-16", "05-30-16", "05-30-16")
> > however it still shows class(eir$date) as character and hence i cannot
> find
> > weekdays from this variable.
> >
> > Sorry but i still dont understand in totality how R reads dates even
> though
> > have tried enough.
> >
> > Regards, Shivi
> >
> >
> > On Tue, Jul 26, 2016 at 5:12 PM, Shivi Bhatia <shivipm...@gmail.com>
> wrote:
> >
> >> Thanks Duncan for the quick response. I will check again as you
> suggested.
> >> If that doesn't work i will share a reproducible example.
> >>
> >> Thanks again
> >>
> >> On Tue, Jul 26, 2016 at 4:43 PM, Duncan Murdoch <
> murdoch.dun...@gmail.com>
> >> wrote:
> >>
> >>> On 26/07/2016 7:05 AM, Shivi Bhatia wrote:
> >>>
> >>>> Hi Team,
> >>>>
> >>>> This scenario may have come across a number of times however i checked
> >>>> nabble & SO and couldn't find a solution hence request assistance.
> >>>>
> >>>> I have a date variable in my data-set eir. The class of this var was
> >>>> character while i had read the file in r studio. Example of date -
> >>>> 05-30-16
> >>>>
> >>>> To change this i have used eir$date<- as.Date(eir$date, "%m-%d-%y").
> This
> >>>> converts it to a date variable. However when i check few obs
> >>>> with head(eir$date) all the results are .
> >>>>
> >>>
> >>> I think you don't have character data like that, because I see
> >>>
> >>>> as.Date("05-30-16", "%m-%d-%y")
> >>> [1] "2016-05-30"
> >>>
> >>> I'd guess eir$date is really a factor, because character data is
> >>> frequently changed to factor automatically.  If that's the case, this
> >>> should work for the conversion:
> >>>
> >>> as.Date(as.character(eir$date), "%m-%d-%y")
> >>>
> >>> If that doesn't work, you'll need to post something reproducible.
> >>>
> >>> Duncan Murdoch
> >>>
> >>> I also need to create weekdays from this date variable but until i get
> >>>> this
> >>>> resolved i cant find a weekday. For weekday i have used:
> >>>> eir$week<- (eir$date)
> >>>> eir$week<- weekdays(as.Date(eir$week))
> >>>> class(eir$week)
> >>>> eir$week<- as.factor(eir$week)
> >>>> head(eir$week)
> >>>>
> >>>> Head of this eir$week results again as expected in  but shows
> Levels:
> >>>> Friday Monday Saturday Sunday Thursday Tuesday Wednesday
> >>>>
> >>>> Not sure what i should do here. Kindly suggest.
>
>

[[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] Date Time in R

2016-07-26 Thread Shivi Bhatia
Hello Again,

While i tried your solution as you suggested above it seems to be working.
Here is the output
temp<- dput(head(eir$date))
c("05-30-16", "05-30-16", "05-30-16", "05-30-16", "05-30-16", "05-30-16")
however it still shows class(eir$date) as character and hence i cannot find
weekdays from this variable.

Sorry but i still dont understand in totality how R reads dates even though
have tried enough.

Regards, Shivi


On Tue, Jul 26, 2016 at 5:12 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:

> Thanks Duncan for the quick response. I will check again as you suggested.
> If that doesn't work i will share a reproducible example.
>
> Thanks again
>
> On Tue, Jul 26, 2016 at 4:43 PM, Duncan Murdoch <murdoch.dun...@gmail.com>
> wrote:
>
>> On 26/07/2016 7:05 AM, Shivi Bhatia wrote:
>>
>>> Hi Team,
>>>
>>> This scenario may have come across a number of times however i checked
>>> nabble & SO and couldn't find a solution hence request assistance.
>>>
>>> I have a date variable in my data-set eir. The class of this var was
>>> character while i had read the file in r studio. Example of date -
>>> 05-30-16
>>>
>>> To change this i have used eir$date<- as.Date(eir$date, "%m-%d-%y"). This
>>> converts it to a date variable. However when i check few obs
>>> with head(eir$date) all the results are .
>>>
>>
>> I think you don't have character data like that, because I see
>>
>> > as.Date("05-30-16", "%m-%d-%y")
>> [1] "2016-05-30"
>>
>> I'd guess eir$date is really a factor, because character data is
>> frequently changed to factor automatically.  If that's the case, this
>> should work for the conversion:
>>
>> as.Date(as.character(eir$date), "%m-%d-%y")
>>
>> If that doesn't work, you'll need to post something reproducible.
>>
>> Duncan Murdoch
>>
>> I also need to create weekdays from this date variable but until i get
>>> this
>>> resolved i cant find a weekday. For weekday i have used:
>>> eir$week<- (eir$date)
>>> eir$week<- weekdays(as.Date(eir$week))
>>> class(eir$week)
>>> eir$week<- as.factor(eir$week)
>>> head(eir$week)
>>>
>>> Head of this eir$week results again as expected in  but shows Levels:
>>> Friday Monday Saturday Sunday Thursday Tuesday Wednesday
>>>
>>> Not sure what i should do here. Kindly suggest.
>>>
>>> [[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] Date Time in R

2016-07-26 Thread Shivi Bhatia
Thanks Duncan for the quick response. I will check again as you suggested.
If that doesn't work i will share a reproducible example.

Thanks again

On Tue, Jul 26, 2016 at 4:43 PM, Duncan Murdoch <murdoch.dun...@gmail.com>
wrote:

> On 26/07/2016 7:05 AM, Shivi Bhatia wrote:
>
>> Hi Team,
>>
>> This scenario may have come across a number of times however i checked
>> nabble & SO and couldn't find a solution hence request assistance.
>>
>> I have a date variable in my data-set eir. The class of this var was
>> character while i had read the file in r studio. Example of date -
>> 05-30-16
>>
>> To change this i have used eir$date<- as.Date(eir$date, "%m-%d-%y"). This
>> converts it to a date variable. However when i check few obs
>> with head(eir$date) all the results are .
>>
>
> I think you don't have character data like that, because I see
>
> > as.Date("05-30-16", "%m-%d-%y")
> [1] "2016-05-30"
>
> I'd guess eir$date is really a factor, because character data is
> frequently changed to factor automatically.  If that's the case, this
> should work for the conversion:
>
> as.Date(as.character(eir$date), "%m-%d-%y")
>
> If that doesn't work, you'll need to post something reproducible.
>
> Duncan Murdoch
>
> I also need to create weekdays from this date variable but until i get this
>> resolved i cant find a weekday. For weekday i have used:
>> eir$week<- (eir$date)
>> eir$week<- weekdays(as.Date(eir$week))
>> class(eir$week)
>> eir$week<- as.factor(eir$week)
>> head(eir$week)
>>
>> Head of this eir$week results again as expected in  but shows Levels:
>> Friday Monday Saturday Sunday Thursday Tuesday Wednesday
>>
>> Not sure what i should do here. Kindly suggest.
>>
>> [[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] Date Time in R

2016-07-26 Thread Shivi Bhatia
Hi Team,

This scenario may have come across a number of times however i checked
nabble & SO and couldn't find a solution hence request assistance.

I have a date variable in my data-set eir. The class of this var was
character while i had read the file in r studio. Example of date - 05-30-16

To change this i have used eir$date<- as.Date(eir$date, "%m-%d-%y"). This
converts it to a date variable. However when i check few obs
with head(eir$date) all the results are .
I also need to create weekdays from this date variable but until i get this
resolved i cant find a weekday. For weekday i have used:
eir$week<- (eir$date)
eir$week<- weekdays(as.Date(eir$week))
class(eir$week)
eir$week<- as.factor(eir$week)
head(eir$week)

Head of this eir$week results again as expected in  but shows Levels:
Friday Monday Saturday Sunday Thursday Tuesday Wednesday

Not sure what i should do here. Kindly suggest.

[[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] findAssocs in TM package in R help?

2016-07-17 Thread Shivi Bhatia
Hi Team,

Please suggest.

On Sun, Jul 17, 2016 at 2:55 AM, Shivi Bhatia <shivipm...@gmail.com> wrote:

> Good Day,
>
> I am working on a text mining assignment and have built the document
> matrix using the tm package.
>
> Now I need to run findAssocs from my dtm with some word say 'like' with a
> correlation of 0.70 but  as far as i have been researching it tells it this
> function is only viable when we have more than 1 doc however in my case i
> only have 1. So please suggest if there is an alternate to this issue.
>
> This is because there are words that correlate to each other in the data I
> am dealing with.
>
> Kindly advice.
>

[[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] findAssocs in TM package in R help?

2016-07-16 Thread Shivi Bhatia
Good Day,

I am working on a text mining assignment and have built the document matrix
using the tm package.

Now I need to run findAssocs from my dtm with some word say 'like' with a
correlation of 0.70 but  as far as i have been researching it tells it this
function is only viable when we have more than 1 doc however in my case i
only have 1. So please suggest if there is an alternate to this issue.

This is because there are words that correlate to each other in the data I
am dealing with.

Kindly advice.

[[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] 'ref' must be an existing level

2016-07-09 Thread Shivi Bhatia
Hi Peter,
It gives me breakdown of all categories with their respective freq.
Diploma general  honors
 50  45 105

On Sat, Jul 9, 2016 at 4:07 PM, peter dalgaard <pda...@gmail.com> wrote:

>
> What does table(m11$prog) tell you?
> -pd
>
> > On 09 Jul 2016, at 12:29 , Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > Dear Team,
> >
> > I am running a multinomial logistic regression model for one of the
> > fictitious data before i implement the same on my real data.
> > Here i am trying to predict based some scores and economic group whether
> a
> > person will go for a diploma, general or honors.
> >
> > The code below:
> > m11$prog2<- relevel(m11$prog, ref = "honors"
> >
> > already loaded the nnet library. However i got the below error:
> > Error in relevel.factor(m11$prog, ref = "honors") :
> >  'ref' must be an existing level
> >
> > I have tried searching on SO and nabble but did not find an answer that
> > could help.
> >
> > Please suggest what is incorrect. Also checked the class of the var and
> is
> > a factor variable.
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Office: A 4.23
> Email: pd@cbs.dk  Priv: pda...@gmail.com
>
>
>
>
>
>
>
>
>
>

[[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] 'ref' must be an existing level

2016-07-09 Thread Shivi Bhatia
Dear Team,

I am running a multinomial logistic regression model for one of the
fictitious data before i implement the same on my real data.
Here i am trying to predict based some scores and economic group whether a
person will go for a diploma, general or honors.

The code below:
m11$prog2<- relevel(m11$prog, ref = "honors"

already loaded the nnet library. However i got the below error:
Error in relevel.factor(m11$prog, ref = "honors") :
  'ref' must be an existing level

I have tried searching on SO and nabble but did not find an answer that
could help.

Please suggest what is incorrect. Also checked the class of the var and is
a factor variable.

[[alternative HTML version deleted]]

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


Re: [R] Help with the Cut Function

2016-06-25 Thread Shivi Bhatia
Hi David,

I tried as suggested however with this code:
Age11<- cut(desc$Age, breaks = c(-Inf, 20,30,40,Inf),labels =
c("Low","Mid","Top")) i receive an error message as below:

lengths of 'breaks' and 'labels' differ. Now as a result i have values
exceeding 40 as N/A.

On Sun, Jun 26, 2016 at 3:25 AM, David Winsemius <dwinsem...@comcast.net>
wrote:

>
> > On Jun 25, 2016, at 12:05 PM, Shivi Bhatia <shivipm...@gmail.com> wrote:
> >
> > Dear Team,
> >
> > Please see the code below:
> >
> > Age1<- cut(desc$Age, breaks = c(20,30,40,Inf),labels =
> c("Low","Mid","Top"))
>
> Try instead:
>
> Age1<- cut(desc$Age, breaks = c(-Inf, 20,30,40,Inf),labels =
> c("Low","Mid","Top"))
>
> Do note that values that are <= 20 will be in the lowest category. (You
> wrote only <20 whereas values of 20 would have not been in any interval.)
> The cut function also has a use.lowest argument, whose actions I don't
> fully understand but I usually set to to TRUE whereas is default is FALSE.
> I prefer the Hmisc::cut2 functions because its defaults mirror my usual
> interests. Like cut2, the findInterval function has closed intervals on the
> left.
>
> > here i am creating three categories as mentioned from the age var from
> desc
> > data set.
> > All the values are set correctly however the values which are below 20
> are
> > set to NA.
> > Is there anything i am doing incorrect.
> >
> > Regards, Shivi
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
>

[[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 with the Cut Function

2016-06-25 Thread Shivi Bhatia
Dear Team,

Please see the code below:

Age1<- cut(desc$Age, breaks = c(20,30,40,Inf),labels = c("Low","Mid","Top"))
here i am creating three categories as mentioned from the age var from desc
data set.
All the values are set correctly however the values which are below 20 are
set to NA.
Is there anything i am doing incorrect.

Regards, Shivi

[[alternative HTML version deleted]]

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


[R] Error in setwd() : argument "dir" is missing, with no default

2016-06-20 Thread Shivi Bhatia
Dear Team,

I have searched for this error at various forums but enable to find a
relevant solution.

When i had installed R studio the WD was saved at a particular location now
when i try to change it gives me this error:

Error in setwd() : argument "dir" is missing, with no default. I have tried
setting the WD using Shift+ Ctrl+ H or using setwd() command. While it
changes the WD for that particular session but when i restart the session
it is again reset to the old previous location hence every instance i have
to reset this as all my data and other files are saved at another location.
While searching at some of the forums like stat exchange it was advised to
use setwd("../") as it selects your WD one step back however with this also
i cant fix the issue.

Kindly advice at the earliest.

Thanks, Shivi

[[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] Warning Message With WordCloud

2016-02-23 Thread SHIVI BHATIA
Dear Team,

 

I am working on Wordcloud package for one of my projects. While it running
fine it is not showing the top most values in the output as it should. I
have ran it earlier and it was fine but now there seems to be an issue. 

 

The wordcloud image shows the values which are appearing only once or twice.
Below is the code I have used:

 

wordcloud(nnn,freq,random.order =F,colors=brewer.pal(8,"Dark2"),

  scale = c(5.5,0.5),min.freq = 50,

  max.words = Inf) 

 

There are words which are repetitive like 1000 times but none of those
appear. Not sure where I doing it wrong have checked multiple stats exchange
forum and help in r on wordcloud. 

 

This is really urgent. I have tried installing tm package. 

 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] R Memory Issue

2016-02-17 Thread SHIVI BHATIA
Dear Team,

 

Every now and then I face some weird issues with R. For instance it would
not read my csv file or any other read.table command and once I would close
the session and reopen again it works fine. 

 

It have tried using rm(list=ls()) & gc() to free some memory and restart R


 

Also today while closing the R session it took more than 10 minutes. I am
not sure as to what is leading to this. Kindly throw some light on this. Not
sure if I have provided enough information.  

 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Re: [R] Error with Twitter Authorization for Sentiment Analysis

2016-02-15 Thread SHIVI BHATIA
Hi Sandeep,

Here is my authorization code:

setup_twitter_oauth(consumer_key,consumer_secret,access_token,access_secret)
.

Prior to this I have just added my consumer key and the other var after
logging at https://apps.twitter.com. Does this help.

-Original Message-
From: Sandeep Rana [mailto:sunnysingha.analyt...@gmail.com]
Sent: Monday, February 15, 2016 5:52 PM
To: SHIVI BHATIA <shivi.bha...@safexpress.com>
Cc: r-help@r-project.org
Subject: Re: [R] Error with Twitter Authorization for Sentiment Analysis

Shivi,
Could you also share the piece of code to have a look at ?

Regards,
Sunny Singha

> On 14-Feb-2016, at 3:45 PM, SHIVI BHATIA <shivi.bha...@safexpress.com>
wrote:
>
> Dear Team,
>
>
>
> Every now and then I face issues while connecting to Twitter:
>
>
>
> Error in check_twitter_oauth() : OAuth authentication error:
>
> This most likely means that you have incorrectly called
> setup_twitter_oauth()'
>
>
>
> I have checked multiple github suggestion and statsexchange forum &
> have followed all suggestion such as to update httpuv package and
> calling out the library names in a certain manner however I am still
> not successful.. Also apart from these there was also recommendation
> on httr package to be called first though while calling the httr package I
got this message:
>
>
>
> Error in unloadNamespace(package) :
>  namespace 'httr' is imported by 'twitteR' so cannot be unloaded
>
>
> Not sure on what is to be done here hence require help from the forum.
>
>
>
>
>
> Thanks, Shivi
>
> Mb: 9891002021
>
>
>
> This e-mail is confidential. It may also be legally privileged. If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return e-mail.
Internet communications cannot be guaranteed to be timely, secure, error or
virus-free. The sender does not accept liability for any errors or
omissions.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.

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


[R] Error with Twitter Authorization for Sentiment Analysis

2016-02-15 Thread SHIVI BHATIA
Dear Team,

 

Every now and then I face issues while connecting to Twitter:

 

Error in check_twitter_oauth() : OAuth authentication error:

This most likely means that you have incorrectly called
setup_twitter_oauth()'

 

I have checked multiple github suggestion and statsexchange forum & have
followed all suggestion such as to update httpuv package and calling out the
library names in a certain manner however I am still not successful.. Also
apart from these there was also recommendation on httr package to be called
first though while calling the httr package I got this message:

 

Error in unloadNamespace(package) : 
  namespace 'httr' is imported by 'twitteR' so cannot be unloaded
 
 
Not sure on what is to be done here hence require help from the forum. 

 

 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] Error on Text Mining for WordCloud

2016-02-13 Thread SHIVI BHATIA
Dear Team, 

 

Please suggest on the below error while I am building a WordCloud on R for
one of user twitter account:

 

Error in UseMethod("TermDocumentMatrix", x) : 

  no applicable method for 'TermDocumentMatrix' applied to an object of
class "c('double', 'numeric')"

 

 

I have tried searching a lot on this issue however don't get much help. 

 

Used Tm package and corpus. Below are the expression below:

 

as.character(nwCorp1<- tm_map(corpuss1, removeNumbers))

as.character(nwCorp1<- tm_map(nwCorp1, removePunctuation))

as.character(nwCorp1<- tm_map(nwCorp1,PlainTextDocument))

as.character(nwCorp1<- tm_map(nwCorp1, removeWords,stopwords("english")))

as.character(nwCorp1<- tm_map(nwCorp1,stripWhitespace))

as.character(nwCorp1)

 

dtm11<- DocumentTermMatrix(nwCorp1)

dtm11

dtm12<- as.matrix(dtm11)

dtm12

frequency<- colSums(dtm12)

 

 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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 with the Twitter Analysis

2016-02-12 Thread SHIVI BHATIA
Dear Team, 

 

Kindly refer to the error below while generating a Twitter Analysis for my
firm:

 

# Warning message:

# In doRppAPICall("search/tweets", n, params = params, retryOnRateLimit =
retryOnRateLimit,  :

 

As I checked on forums such as StackOverflow and other r related literature
it mentioned that this error happened due to the reason that there were less
tweets than what I requested for. On further investigation I got to know
that due to twitter API restrictions we can't fetch older tweets i.e. any
tweet prior to 6-7 days. This seems to be a very big hurdle for me to build
a sentiment analysis for the company as the time frame is very low. 

 

Request to please advise if there is some work around for the same or best
possible alternative. 

 

Thanks, Shivi

Mb: 9891002021

 

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] Paste Funtion Help

2016-02-04 Thread SHIVI BHATIA
HI Team, 

 

Need help with the below syntax.

 

merge.salaries[, name:=paste("nameFirst","nameLast")]. Here merge.salaries
is the data set I have merged. 

 

There are 2 columns nameFirst and nameLast I need to merge these two into
one and name as name however I can getting an error:

 

Error in `[.data.frame`(merge.salaries, , `:=`(name, paste("nameFirst",  : 

  could not find function ":="

 

Please advice. 

 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] Dput Help in R

2015-12-31 Thread SHIVI BHATIA
Hi Duncan,
Please find the dput from the data.

ab<-read.csv("collection_last.csv",header=TRUE)
y<-ab[1:10,]


ab<- "2,458", "2,461", "2,462", "2,463", "2,464", "2,465", "2,468",
"2,469", "2,470", "2,473", "2,474", "2,475", "2,476", "2,477",
"2,478", "2,479", "2,480", "2,483", "2,484,267", "2,485",
"2,486", "2,487", "2,490", "2,491", "2,491,176", "2,492",
"2,494", "2,495,976", "2,496", "2,497", "2,498", "2,499",
"2,500", "2,500,001", "2,501", "2,502", "2,503", "2,504",
"2,506", "2,507", "2,508", "2,509", "2,510", "2,511", "2,512",
"2,513", "2,514", "2,515", "2,516", "2,517", "2,519", "2,520",
"2,521", "2,523", "2,523,257", "2,524", "2,525", "2,526",
"2,527", "2,528", "2,529", "2,530", "2,531", "2,535", "2,536",
"2,538", "2,539", "2,540", "2,542", "2,543", "2,544", "2,545",
"2,546", "2,547", "2,549", "2,550", "2,551", "2,553", "2,554",
"2,556", "2,557", "2,558", "2,559", "2,560", "2,561", "2,563",
"2,564", "2,565", "2,566", "2,567", "2,570", "2,572", "2,574",
"2,576", "2,577", "2,578", "2,579", "2,580", "2,582", "2,583",
"2,584", "2,585", "2,588", "2,589", "2,590", "2,591", "2,592",
"2,593", "2,594", "2,596", "2,599", "2,600", "2,601", "2,602",
"2,604", "2,605", "2,606", "2,607", "2,609", "2,611", "2,612",
"2,613", "2,614", "2,615", "2,616", "2,617", "2,618", "2,619",
"2,620", "2,621", "2,622", "2,624", "2,626", "2,627", "2,628",
"2,628,385", "2,629", "2,630", "2,633", "2,634", "2,636",
"2,637", "2,638", "2,640", "2,642", "2,644", "2,647", "2,648",
"2,649", "2,650", "2,651", "2,654", "2,655", "2,656", "2,658",
"2,660", "2,661", "2,663", "2,665", "2,666", "2,667", "2,668",
"2,670", "2,671", "2,672", "2,673", "2,674", "2,676", "2,677",
"2,678", "2,679", "2,679,505", "2,680", "2,682", "2,684",
"2,687", "2,688", "2,689", "2,690", "2,692", "2,694", "2,695",
"2,696", "2,697", "2,699", "2,700", "2,702", "2,703", "2,705",
"2,706", "2,707", "2,708", "2,709", "2,710", "2,711", "2,712",
"2,713", "2,714", "2,715", "2,716", "2,717", "2,718", "2,720",
"2,721", "2,722", "2,723", "2,727", "2,728", "2,730", "2,732",
"2,733", "2,736", "2,737", "2,738", "2,739", "2,742", "2,744",
"2,747", "2,748", "2,749", "2,750", "2,752", "2,753", "2,754",
"2,758", "2,759", "2,760", "2,761", "2,765,189", "2,766",
"2,767", "2,770", "2,772", "2,773", "2,774", "2,776", "2,778",
"2,780", "2,783", "2,784", "2,785", "2,786", "2,787", "2,789",
"2,790", "2,792", "2,793", "2,794", "2,795", "2,797", "2,798",
"2,799", "2,800", "2,803", "2,804", "2,806", "2,808", "2,808,003",
"2,809", "2,810", "2,812", "2,813", "2,814", "2,816", "2,818",
"2,820", "2,824", "2,825", "2,826", "2,832", "2,835", "2,839,850",
"2,840", "2,841", "2,842", "2,844", "2,845", "2,846", "2,847",
"2,848", "2,850", "2,851", "2,852", "2,853", "2,855", "2,856",
"2,857", "2,858", "2,859", "2,861", "2,864", "2,865", "2,866",
"2,867", "2,869", "2,870", "2,873", "2,874", "2,875", "2,876",
"2,877", "2,878", "2,879", "2,880", "2,883", "2,884", "2,885",
"2,886", "2,890", "2,891", "2,892", "2,893", "2,894", "2,895",
"2,896", "2,897", "2,898", "2,899", "2,902", "2,903", "2,904",
"2,905", "2,907", "2,908", "2,908,956", "2,910", "2,911",
"2,912", "2,913", "2,916", "2,917", "2,922", "2,923", "2,924",
"2,925", "2,926", "2,929", "2,930", "2,931", "2,932", "2,933",
"2,934", "2,936", "2,937", "2,939", "2,941", "2,943", "2,944",
"2,946", "2,947", "2,948", "2,950", "2,951", "2,953", "2,954",
"2,955", "2,957", "2,959", "2,960", "2,961", "2,965", "2,967",
"2,968", "2,970", "2,971", "2,973", "2,975", "2,976", "2,979",
"2,981", "2,982", "2,983", "2,987", "2,988", "2,989", "2,990",
"2,991", "2,992", "2,993", "2,994", "2,996", "2,997", "2,998",
"2,999", "20", "20,000", "20,001", "20,003", "20,004", "20,028",
"20,035", "20,054", "20,066", "20,071", "20,077", "20,079",
"20,088", "20,101", "20,104", "20,116", "20,120", "20,126",
"20,151", "20,153", "20,157", "20,174", "20,176", "20,190",
"20,191", "20,196", "20,199", "20,213", "20,214", "20,217",
"20,225", "20,257", "20,262", "20,263", "20,288", "20,294",
"20,307", "20,320", "20,325", "20,349", "20,356", "20,375",
"20,385", "20,387", "20,401", "20,405", "20,412", "20,425",
"20,443", "20,462", "20,517", "20,525", "20,526", "20,532",
"20,542", "20,547", "20,557", "20,576,265", "20,601", "20,612",
"20,623", "20,625", "20,641", "20,657", "20,690", "20,691",
"20,693", "20,700", "20,712", "20,725", "20,728", "20,752,792",
"20,754", "20,773", "20,779", "20,780", "20,784", "20,792",
"20,821", "20,830", "20,873", "20,882", "20,890", "20,900",
"20,906", "20,947", "20,956", "20,964", "20,979", "20,980",
"200", "200,000", "200,014", "200,023", "200,058", "200,105",
"200,372", "200,476", "200,736", "201", "201,583", "201,759",
"201,844", "202", "202,093", "202,278", "202,414", "202,753",
"203", "203,380", "203,388", "204", "204,184", "204,403",
"204,760", "204,846", "204,922", "205", "205,000", "205,307",
"205,559", "206", "206,705", "206,916", "207", "207,367",
"208", "208,096", "208,267", "208,284", "209", "209,075",
"209,355", "209,653", "21", "21,010", "21,042", 

[R] Dput Help in R

2015-12-30 Thread SHIVI BHATIA
Dear Team, 

 

I am facing an error while performing a manipulation using a dplyr package.
In the code below, I am using mutate to build a new calculated column:

 

kp<-read.csv("collection_last.csv",header=TRUE)

mutate(kp,dif=DOC_AMOUNT-RECEIPT_AMT+TDS_AMT+REBATE)

 

However it gives an error:-

Warning messages:

1: In Ops.factor(c(28831L, 28831L, 17504L, 4184L, 36187L, 25819L, 699L,  :

  '-' not meaningful for factors

2: In Ops.factor(c(28831L, 28831L, 17504L, 4184L, 36187L, 25819L, 699L,  :

  '+' not meaningful for factors

3: In Ops.factor(c(28831L, 28831L, 17504L, 4184L, 36187L, 25819L, 699L,  :

  '+' not meaningful for factors

 

This is an error when some of my variables are factors hence I have tried to
change these to numeric so used the expression as:

kp$DOC_TYPE=as.numeric(kp$DOC_TYPE). 

 

this now shows as variable type of as "double". So expedite help on this one
i was trying to create a reproducible example and i am highly struggling to 

create one. the data i have is approx. around 1 million rows with 21 columns
hence when i use a dput option it does not capture the entire detailing and
row level info required to share and even dput(head(kp$DOC_TYPE) does not
help either. 

I have seen many stack overflow & r help column before composing this email.
Hence i need help to create this reproducible example to share with the
experts in the community. Apologies if this is a repeat.

 

PLEASE HELP AS I AM HIGHLY STRUGGLING TO BUILD ANY OUTCOME. 

Regards, Shivi

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] Incorrect Summarization after As.numeric

2015-12-28 Thread SHIVI BHATIA
Dear Team,

 

I am working on aggregate function in R & have used the below code:

 

aggregate(a1$Final,list(Year=a1$Year),sum)

 

initially a1$Final was factor hence I used a1$Final= as.numeric(a1$Final) to
convert this into numeric. After conversion it shows the output but the
summarization from the aggregate is incorrect. This I have reconciled with
the excel pivot. 

 

Could you please suggest where could be the issue?

 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] Subscribe to Post

2015-12-27 Thread SHIVI BHATIA
This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] Subscribe to Post

2015-12-26 Thread SHIVI BHATIA
Dear Team, 

 

Kindly look into the same at the earliest. 

 

Regards, Shivi

 

From: SHIVI BHATIA [mailto:shivi.bha...@safexpress.com] 
Sent: Friday, December 25, 2015 6:10 PM
To: 'r-help@r-project.org' <r-help@r-project.org>
Subject: Subscribe to Post

 

Dear Team, 

 

I have recently re-subscribed to R help moving ahead from nabble. Got an
email where it asked to send email to the above group which will allow me to
post questions hence request to post questions. 

Thanks, Shivi

Mb: 9891002021

 

This e-mail is confidential. It may also be legally privileged. If you are not 
the addressee you may not copy, forward, disclose or use any part of it. If you 
have received this message in error, please delete it and all copies from your 
system and notify the sender immediately by return e-mail. Internet 
communications cannot be guaranteed to be timely, secure, error or virus-free. 
The sender does not accept liability for any errors or omissions.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.