[R] saveRDS() and readRDS() Why?

2018-11-06 Thread Patrick Connolly
>From a Windows R session, I do
 
> object.size(rawData)
31736 bytes  # from scraping a non-reproducible web address.
> saveRDS(rawData, file = "rawData.rds")

Then copy to a Linux session

> rawData <- readRDS(file = "rawData.rds")
> rawData
[1] "rawData"
> object.size(rawData)
112 bytes
> rawData
[1] "rawData" # only the name and something to make up 112 bytes
> 

Have I misunderstood the syntax?

It's an old version on Windows.  I haven't used Windows R since then.

major  3  
minor  2.4
year   2016   
month  03 
day16 


I've tried R-3.5.0 and R-3.5.1 Linux versions.

In case it's material ... 

I couldn't get the scraping to work on either of the R installations
but Windows users told me it worked for them.  So I thought I'd get
the R object and use it.  I could understand accessing the web address
could have different permissions for different OSes, but should that
affect the R objects?

TIA

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

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


Re: [R] POS tagging generating a string

2018-11-06 Thread Robert David Burbidge via R-help
Hi Elahe,
You could modify your count_verbs function from your previous post:

  * use scan to extract the tokens (words) from Message
  * use your previous grepl expression to index the tokens that are verbs
  * paste the verbs together to form the entries of a new column.

Here is one solution:

 >>>
library(openNLP)
library(NLP)

df <- data.frame(DocumentID = c(478920L, 510133L, 499497L, 930234L),
  Message = structure(c(4L, 2L, 3L, 1L), .Label = 
c("Thank you very much for your nice feedback.\n",
"THank you, added it", "Thanks for the well explained article.",
"The solution has been updated"), class = "factor"))


dput(df)

tagPOS <-  function(x, ...) {
   s <- as.String(x)
   if(s=="") return(list())
   word_token_annotator <- Maxent_Word_Token_Annotator()
   a2 <- Annotation(1L, "sentence", 1L, nchar(s))
   a2 <- annotate(s, word_token_annotator, a2)
   a3 <- annotate(s, Maxent_POS_Tag_Annotator(), a2)
   a3w <- a3[a3$type == "word"]
   POStags <- unlist(lapply(a3w$features, `[[`, "POS"))
   POStagged <- paste(sprintf("%s/%s", s[a3w], POStags), collapse = " ")
   list(POStagged = POStagged, POStags = POStags)
}

verbs <-function(x) {
   tagPOSx <- tagPOS(x)
   scanx <- scan(text=as.character(x), what="character")
   n <- length(scanx)
   paste(scanx[(1:n)[grepl("VB", tagPOSx$POStags)]], collapse="|")
}

library(dplyr)

df %>% group_by(DocumentID) %>% summarise(verbs = verbs(Message))
<

I'll leave it to you to extract a column of verbs from the result and 
rbind it to the original data.frame.

Btw, I don't this solution is efficient, I would guess that the 
processing that scan does in the verbs function is duplicating work 
already done in the tagPOS function by annotate, so you may want to 
return a list of tokens from tagPOS and use that instead of scan.

Rgds,
Robert

On 06/11/18 10:26, Elahe chalabi via R-help wrote:
> Hi all, In my df I would like to generate a new column which contains 
> a string showing all the verbs in each row of df$Message.
>> library(openNLP) library(NLP) dput(df) 
> structure(list(DocumentID = c(478920L, 510133L, 499497L, 930234L ), 
> Message = structure(c(4L, 2L, 3L, 1L), .Label = c("Thank you very much 
> for your nice feedback.\n", "THank you, added it", "Thanks for the 
> well explained article.", "The solution has been updated"), class = 
> "factor")), class = "data.frame", row.names = c(NA, -4L)) tagPOS <- 
> function(x, ...) { s <- as.String(x) word_token_annotator <- 
> Maxent_Word_Token_Annotator() a2 <- Annotation(1L, "sentence", 1L, 
> nchar(s)) a2 <- annotate(s, word_token_annotator, a2) a3 <- 
> annotate(s, Maxent_POS_Tag_Annotator(), a2) a3w <- a3[a3$type == 
> "word"] POStags <- unlist(lapply(a3w$features, `[[`, "POS")) POStagged 
> <- paste(sprintf("%s/%s", s[a3w], POStags), collapse = " ") 
> list(POStagged = POStagged, POStags = POStags) } Any help? Thanks in 
> advance! Elahe __ 
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> https://stat.ethz.ch/mailman/listinfo/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.


[ESS] Sagemath

2018-11-06 Thread Brett Presnell via ESS-help


Has anyone ever thought about adding sagemath 
(https://urldefense.proofpoint.com/v2/url?u=http-3A__www.sagemath.org_=DwIBAg=pZJPUDQ3SB9JplYbifm4nt2lEVG5pWx2KikqINpWlZM=BTroxrHfNcEzHKOXPWwak3427mntQBwn2I1HiDWVGsA=OhqYPV3NQzKt5zoRtLQJakmp0l0KISqzugGaCHD7ahY=jsFNfH9zQPL5ggX7XnbFvPb0NF4X2V-ioAxgAGLAeYc=)
to the list of "languages" supported by ESS?  There is an emacs mode
(sage-shell-mode) for it, but it feels incredibly clunky compared to
ESS.

Assuming the answer is no, any suggestions for a more ESS-like interface
for sagemath would also be appreciated.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] ESS R code evaluation in package

2018-11-06 Thread Cyrus Harmon via ESS-help


I’m having a number of related problems that may stem from fundamental 
misconceptions about how R code is eval’ed/load’ed/compile’d/etc… but it’s 
driving me crazy, so here goes. Also, bear in mind that I’m coming from the 
common lisp world and am a big fan of its package system and Emacs/SLIME for 
interacting editing/evaluation/etc…

I have a number of R libraries that I have developed and a number of other 
libraries that use these libraries. It appears that when I edit an R file with 
ESS that ESS is smart enough to figure out the appropriate namespace and 
displays it in a line on the bottom status bar like [pkg:mypkg] (please forgive 
me if I mix up the usage of R's namespaces and packages — it isn’t quite clear 
to me which term I should use when). This is promising but if I C-c C-r a chunk 
of code in that file (e.g. a function definition, or should I say an assignment 
of a function to a new variable) I would expect that the function would now be 
visible in my packages namespace (e.g. via ls(“package:foo”) but my new 
function doesn’t appear. I can eval ‘moose()’ from ESS and it is correctly 
called, so the function is somewhere, but it’s not in my package.

So, for a bunch of related questions?

1. How might I compile 'moose <- function () { “bar” }’ from Emacs/ESS and have 
moose show up in my package?

2. If it isn’t going into my package now, where is it going?

3. If I can’t do this is there some easy way to build an reinstall an existing 
R library without having to call me R process and restart every time I want to 
make a simple change to a library function (this is where I find myself now).

4. Am I missing something obvious here? Is there a better way to do all of this?

thanks,

Cyrus

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] polymode indents everything when editing Rmd file?

2018-11-06 Thread Nehemiah Obire via ESS-help
wgrggrggrggrggddggguggdgfggfgfgggdgdgdggdwgwugudugddhhuggudwguddgwgwgggywdwgdgywgdyywdgwyg

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Sum of Squares Type I, II, III for ANOVA

2018-11-06 Thread Thanh Tran
Dear   Prof. John Fox,

Thank you for your advice. I will take care in the future post.

Best regards,
Nhat Tran

Vào Th 4, 7 thg 11, 2018 vào lúc 11:41 Fox, John  đã
viết:

> Dear Thanh Tran,
>
> When you start a discussion on r-help, it's polite to keep it there so
> other people can see what transpires. I'm consequently cc'ing this response
> to the r-help list.
>
> The problem with your code is that anova(), as opposed to Anova(), has no
> type argument.
>
> Here's what I get with your data. I hope that the code and output don't
> get too mangled:
>
> > data <- read.csv("Saha research.csv", header=TRUE)
>
> > data <- within(data, {
> + tem <- as.factor(temperature)
> + ac <- as.factor (AC)
> + av <- as.factor(AV)
> + thick <- as.factor(Thickness)
> + })
>
> > library(car)
> Loading required package: carData
>
> > options(contrasts = c("contr.sum", "contr.poly"))
>
> > mod <- lm(KIC ~ tem*ac + tem*av + tem*thick + ac*av +ac*thick +
> av*thick,
> +   data=data)
>
> > anova(mod) # type I (sequential)
> Analysis of Variance Table
>
> Response: KIC
>Df  Sum Sq Mean Sq  F valuePr(>F)
> tem 2 15.3917  7.6958 427.9926 < 2.2e-16 ***
> ac  2  0.1709  0.0854   4.7510 0.0096967 **
> av  1  1.9097  1.9097 106.2055 < 2.2e-16 ***
> thick   2  0.2041  0.1021   5.6756 0.0040359 **
> tem:ac  4  0.5653  0.1413   7.8598 6.973e-06 ***
> tem:av  2  1.7192  0.8596  47.8046 < 2.2e-16 ***
> tem:thick   4  0.0728  0.0182   1.0120 0.4024210
> ac:av   2  0.3175  0.1588   8.8297 0.0002154 ***
> ac:thick4  0.0883  0.0221   1.2280 0.3003570
> av:thick2  0.0662  0.0331   1.8421 0.1613058
> Residuals 190  3.4164  0.0180
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> > Anova(mod) # type II
> Anova Table (Type II tests)
>
> Response: KIC
>Sum Sq  Df  F valuePr(>F)
> tem   15.3917   2 427.9926 < 2.2e-16 ***
> ac 0.1709   2   4.7510 0.0096967 **
> av 1.9097   1 106.2055 < 2.2e-16 ***
> thick  0.2041   2   5.6756 0.0040359 **
> tem:ac 0.5653   4   7.8598 6.973e-06 ***
> tem:av 1.7192   2  47.8046 < 2.2e-16 ***
> tem:thick  0.0728   4   1.0120 0.4024210
> ac:av  0.3175   2   8.8297 0.0002154 ***
> ac:thick   0.0883   4   1.2280 0.3003570
> av:thick   0.0662   2   1.8421 0.1613058
> Residuals  3.4164 190
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> > Anova(mod, type=3) # type III
> Anova Table (Type III tests)
>
> Response: KIC
>  Sum Sq  Df   F valuePr(>F)
> (Intercept) 102.430   1 5696.4740 < 2.2e-16 ***
> tem  15.392   2  427.9926 < 2.2e-16 ***
> ac0.171   24.7510 0.0096967 **
> av1.910   1  106.2055 < 2.2e-16 ***
> thick 0.204   25.6756 0.0040359 **
> tem:ac0.565   47.8598 6.973e-06 ***
> tem:av1.719   2   47.8046 < 2.2e-16 ***
> tem:thick 0.073   41.0120 0.4024210
> ac:av 0.318   28.8297 0.0002154 ***
> ac:thick  0.088   41.2280 0.3003570
> av:thick  0.066   21.8421 0.1613058
> Residuals 3.416 190
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> If you have questions about Minitab there's probably another place to ask.
> It's not my opinion that type-III tests are generally preferable to type-II
> tests. Focus, in my opinion, should be on what hypotheses are being tested.
> If you want to see more detail, you could consult the book with which the
> car package is associated: see citation(package="car").
>
> Best,
>  John
>
> > -Original Message-
> > From: Thanh Tran [mailto:masternha...@gmail.com]
> > Sent: Tuesday, November 6, 2018 9:15 PM
> > To: Fox, John 
> > Subject: Re: [R] Sum of Squares Type I, II, III for ANOVA
> >
> > Dear  Prof. John Fox,
> > Thank you for your answer. The CSV data was added as the attached file
> again.
> > I try to set the contrasts properly *before* I fit the model but I
> received a
> > problem as follows.
> >
> > >  setwd("C:/NHAT/HOC TAP/R/Test/Anova") data = read.csv("Saha
> > > research.csv", header =T)
> > > attach(data)
> > > tem = as.factor(temperature)
> > > ac= as.factor (AC)
> > >  av = as.factor(AV)
> > >  thick = as.factor(Thickness)
> > > library(car)
> > Loading required package: carData
> > > options(contrasts = c("contr.sum", "contr.poly")) mod <- lm(KIC ~
> > > tem*ac + tem*av + tem*thick + ac*av +ac*thick + av*thick)
> > > anova(mod,type= 3)
> > Error: $ operator is invalid for atomic vectors
> >
> >
> > Another problem is that in the paper that I read, the authors used
> MINITAB to
> > analyze Anova. The authors use "adjusted sums of squares" calculate the
> p-
> > value. So which should I use? Type I adjusted SS or Type III sequential
> SS?
> > Minitab help tells me that I would "usually" want to use type III
> adjusted SS, as
> > type I sequential "sums of squares can differ when your design is
> unbalanced"
> > - which mine is. The 

Re: [R] Sum of Squares Type I, II, III for ANOVA

2018-11-06 Thread Fox, John
Dear Thanh Tran,

When you start a discussion on r-help, it's polite to keep it there so other 
people can see what transpires. I'm consequently cc'ing this response to the 
r-help list.

The problem with your code is that anova(), as opposed to Anova(), has no type 
argument.

Here's what I get with your data. I hope that the code and output don't get too 
mangled:

> data <- read.csv("Saha research.csv", header=TRUE)

> data <- within(data, {
+ tem <- as.factor(temperature)
+ ac <- as.factor (AC)
+ av <- as.factor(AV)
+ thick <- as.factor(Thickness)
+ })

> library(car)
Loading required package: carData

> options(contrasts = c("contr.sum", "contr.poly"))

> mod <- lm(KIC ~ tem*ac + tem*av + tem*thick + ac*av +ac*thick + av*thick, 
+   data=data)

> anova(mod) # type I (sequential)
Analysis of Variance Table

Response: KIC
   Df  Sum Sq Mean Sq  F valuePr(>F)
tem 2 15.3917  7.6958 427.9926 < 2.2e-16 ***
ac  2  0.1709  0.0854   4.7510 0.0096967 ** 
av  1  1.9097  1.9097 106.2055 < 2.2e-16 ***
thick   2  0.2041  0.1021   5.6756 0.0040359 ** 
tem:ac  4  0.5653  0.1413   7.8598 6.973e-06 ***
tem:av  2  1.7192  0.8596  47.8046 < 2.2e-16 ***
tem:thick   4  0.0728  0.0182   1.0120 0.4024210
ac:av   2  0.3175  0.1588   8.8297 0.0002154 ***
ac:thick4  0.0883  0.0221   1.2280 0.3003570
av:thick2  0.0662  0.0331   1.8421 0.1613058
Residuals 190  3.4164  0.0180   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

> Anova(mod) # type II
Anova Table (Type II tests)

Response: KIC
   Sum Sq  Df  F valuePr(>F)
tem   15.3917   2 427.9926 < 2.2e-16 ***
ac 0.1709   2   4.7510 0.0096967 ** 
av 1.9097   1 106.2055 < 2.2e-16 ***
thick  0.2041   2   5.6756 0.0040359 ** 
tem:ac 0.5653   4   7.8598 6.973e-06 ***
tem:av 1.7192   2  47.8046 < 2.2e-16 ***
tem:thick  0.0728   4   1.0120 0.4024210
ac:av  0.3175   2   8.8297 0.0002154 ***
ac:thick   0.0883   4   1.2280 0.3003570
av:thick   0.0662   2   1.8421 0.1613058
Residuals  3.4164 190   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

> Anova(mod, type=3) # type III
Anova Table (Type III tests)

Response: KIC
 Sum Sq  Df   F valuePr(>F)
(Intercept) 102.430   1 5696.4740 < 2.2e-16 ***
tem  15.392   2  427.9926 < 2.2e-16 ***
ac0.171   24.7510 0.0096967 ** 
av1.910   1  106.2055 < 2.2e-16 ***
thick 0.204   25.6756 0.0040359 ** 
tem:ac0.565   47.8598 6.973e-06 ***
tem:av1.719   2   47.8046 < 2.2e-16 ***
tem:thick 0.073   41.0120 0.4024210
ac:av 0.318   28.8297 0.0002154 ***
ac:thick  0.088   41.2280 0.3003570
av:thick  0.066   21.8421 0.1613058
Residuals 3.416 190
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

If you have questions about Minitab there's probably another place to ask. It's 
not my opinion that type-III tests are generally preferable to type-II tests. 
Focus, in my opinion, should be on what hypotheses are being tested. If you 
want to see more detail, you could consult the book with which the car package 
is associated: see citation(package="car").

Best,
 John

> -Original Message-
> From: Thanh Tran [mailto:masternha...@gmail.com]
> Sent: Tuesday, November 6, 2018 9:15 PM
> To: Fox, John 
> Subject: Re: [R] Sum of Squares Type I, II, III for ANOVA
> 
> Dear  Prof. John Fox,
> Thank you for your answer. The CSV data was added as the attached file again.
> I try to set the contrasts properly *before* I fit the model but I received a
> problem as follows.
> 
> >  setwd("C:/NHAT/HOC TAP/R/Test/Anova") data = read.csv("Saha
> > research.csv", header =T)
> > attach(data)
> > tem = as.factor(temperature)
> > ac= as.factor (AC)
> >  av = as.factor(AV)
> >  thick = as.factor(Thickness)
> > library(car)
> Loading required package: carData
> > options(contrasts = c("contr.sum", "contr.poly")) mod <- lm(KIC ~
> > tem*ac + tem*av + tem*thick + ac*av +ac*thick + av*thick)
> > anova(mod,type= 3)
> Error: $ operator is invalid for atomic vectors
> 
> 
> Another problem is that in the paper that I read, the authors used MINITAB to
> analyze Anova. The authors use "adjusted sums of squares" calculate the p-
> value. So which should I use? Type I adjusted SS or Type III sequential SS?
> Minitab help tells me that I would "usually" want to use type III adjusted 
> SS, as
> type I sequential "sums of squares can differ when your design is unbalanced"
> - which mine is. The R functions I am using are clearly using the type I
> sequential SS.
> 
> Thanks
> Nhat Tran
> 
> 
> Vào Th 4, 7 thg 11, 2018 vào lúc 10:41 Fox, John   > đã viết:
> 
> 
>   Dear Nhat Tran,
> 
>   The output that you show is unreadable and as far as I can 

Re: [R] Sum of Squares Type I, II, III for ANOVA

2018-11-06 Thread Fox, John
Dear Nhat Tran,

One more thing: You could specify the model even more compactly as

  mod <- lm(KIC ~ (tem + ac + av + thick)^2)

Best,
 John

> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Fox, John
> Sent: Tuesday, November 6, 2018 8:41 PM
> To: Thanh Tran 
> Cc: r-help@r-project.org
> Subject: Re: [R] Sum of Squares Type I, II, III for ANOVA
> 
> Dear Nhat Tran,
> 
> The output that you show is unreadable and as far as I can see, the data 
> aren't
> attached, but perhaps the following will help: First, if you want Anova() to
> compute type III tests, then you have to set the contrasts properly *before*
> you fit the model, not after. Second, you can specify the model much more
> compactly as
> 
>   mod <- lm(KIC ~ tem*ac + tem*av + tem*thick + ac*av +ac*thick + av*thick)
> 
> Finally, as sound general practice, I'd not attach the data, but rather put 
> your
> recoded variables in the data frame and then specify the data argument to
> lm().
> 
> I hope that this helps,
>  John
> 
> -
> John Fox
> Professor Emeritus
> McMaster University
> Hamilton, Ontario, Canada
> Web: https://socialsciences.mcmaster.ca/jfox/
> 
> 
> 
> > -Original Message-
> > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thanh
> > Tran
> > Sent: Tuesday, November 6, 2018 6:58 PM
> > To: r-help@r-project.org
> > Subject: [R] Sum of Squares Type I, II, III for ANOVA
> >
> > Hi everyone,
> > I'm studying the ANOVA in R and have some questions to share. I
> > investigate the effects of 4 factors (temperature-3 levels, asphalt
> > content-3 levels, air
> > voids-2 levels, and sample thickness-3 levels) on the hardness of
> > asphalt concrete in the tensile test (abbreviated as KIC). These data
> > were taken from a acticle paper. The codes were wrriten as the follows:
> >
> > > data = read.csv("Saha research.csv", header =T)
> > > attach(data)
> > > tem = as.factor(temperature)
> > > ac= as.factor (AC)
> > > av = as.factor(AV)
> > > thick = as.factor(Thickness)
> > > model =
> > lm(KIC~tem+ac+av+thick+tem:ac+tem:av+tem:thick+ac:av+ac:thick+av:thick
> > )
> > > anova(model) #Type I tests
> > > library(car) Loading required package: carData >
> >
> anova(lm(KIC~tem+ac+av+thick+tem:ac+tem:av+tem:thick+ac:av+ac:thick+av
> > :thick),type=2)
> > Error: $ operator is invalid for atomic vectors
> > > options(contrasts = c("contr.sum", "contr.poly"))
> > > Anova(model,type="3") # Type III tests
> > > Anova(model,type="2") # Type II tests
> >
> > With R, three results from Type I, II, and III almost have the same as 
> > follows.
> >
> > Analysis of Variance Table Response: KIC Df Sum Sq Mean Sq F value
> > Pr(>F) tem 2 15.3917 7.6958 427.9926 < 2.2e-16 *** ac 2 0.1709 0.0854
> > 4.7510
> > 0.0096967 ** av 1 1.9097 1.9097 106.2055 < 2.2e-16 *** thick 2 0.2041
> > 0.1021 5.6756 0.0040359 ** tem:ac 4 0.5653 0.1413 7.8598 6.973e-06 ***
> > tem:av 2 1.7192 0.8596 47.8046 < 2.2e-16 *** tem:thick 4 0.0728 0.0182
> > 1.0120 0.4024210 ac:av 2 0.3175 0.1588 8.8297 0.0002154 *** ac:thick 4
> > 0.0883 0.0221 1.2280 0.3003570 av:thick 2 0.0662 0.0331 1.8421
> > 0.1613058 Residuals 190 3.4164 0.0180 --- Signif. codes: 0 ‘***’ 0.001 ‘**’
> 0.01 ‘*’
> > 0.05 ‘.’ 0.1 ‘ ’ 1
> >
> > However, these results are different from the results in the article,
> > especially for the interaction (air voids and sample thickness). The
> > results presented in the article are as follows:
> > Analysis of variance for KIC, using Adjusted SS for tests. Source DF
> > Seq SS Adj MS F-stat P-value Model findings Temperature 2 15.39355
> > 7.69677 426.68
> > <0.01 Significant AC 2 0.95784 0.47892 26.55 <0.01 Significant AV 1
> > 0.57035
> > 0.57035 31.62 <0.01 Significant Thickness 2 0.20269 0.10135 5.62 <0.01
> > Significant Temperature⁄AC 4 1.37762 0.34441 19.09 <0.01 Significant
> > Temperature⁄AV 2 0.8329 0.41645 23.09 <0.01 Significant
> > Temperature⁄thickness 4 0.07135 0.01784 0.99 0.415 Not significant
> > AC⁄AV 2
> > 0.86557 0.43279 23.99 <0.01 Significant AC⁄thickness 4 0.04337 0.01084
> > 0.6
> > 0.662 Not significant AV⁄thickness 2 0.17394 0.08697 4.82 <0.01
> > Significant Error 190 3.42734 0.01804 Total 215 23.91653
> >
> > Therefore, I wonder that whether there is an error in my code or there
> > is another type of ANOVA in R. If you could answer my problems, I
> > would be most grateful.
> > Best regards,
> > Nhat Tran
> > Ps: I also added a CSV file and the paper for practicing R.
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-
> > guide.html and provide commented, minimal, self-contained,
> > reproducible code.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 

Re: [R-es] Simple sequencia en suma

2018-11-06 Thread Javier Marcuzzi
Estimado David Montes

Se comprende perfecto lo que usted desea realizar, pero su lógica no
corresponde a R, pensando desde el lenguaje R es incomprensible lo que
usted escribe, es chino básico.
Tome un ejemplo cualquiera para comenzar a aprender R, no interpole desde
otro lenguaje, acepte que es R, la parte lógica es simple, casi todos los
lenguajes son iguales, pero primero borre lo que conoce, aprenda lo básico,
luego recupere lo que conoce y crezca todo lo que pueda.

Javier Rubén Marcuzzi

El vie., 2 nov. 2018 a las 20:51, David Montes ()
escribió:

> Este es mi primer ejercicio con errores es una simple sequencia en suma,
> muchas gracias.
>
> > mi_funcion "<-" function(x, y, operacion = "suma"){ if(operacion ==
> "suma"){ return (x + y) z=2}; (x * z = 2)+y} x=1;y=2;z=2; else echo "error";
>
> Error: unexpected string constant in "mi_funcion "<-""
>
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Sum of Squares Type I, II, III for ANOVA

2018-11-06 Thread Fox, John
Dear Nhat Tran,

The output that you show is unreadable and as far as I can see, the data aren't 
attached, but perhaps the following will help: First, if you want Anova() to 
compute type III tests, then you have to set the contrasts properly *before* 
you fit the model, not after. Second, you can specify the model much more 
compactly as

  mod <- lm(KIC ~ tem*ac + tem*av + tem*thick + ac*av +ac*thick + av*thick)

Finally, as sound general practice, I'd not attach the data, but rather put 
your recoded variables in the data frame and then specify the data argument to 
lm().

I hope that this helps,
 John

-
John Fox
Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: https://socialsciences.mcmaster.ca/jfox/



> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Thanh Tran
> Sent: Tuesday, November 6, 2018 6:58 PM
> To: r-help@r-project.org
> Subject: [R] Sum of Squares Type I, II, III for ANOVA
> 
> Hi everyone,
> I'm studying the ANOVA in R and have some questions to share. I investigate
> the effects of 4 factors (temperature-3 levels, asphalt content-3 levels, air
> voids-2 levels, and sample thickness-3 levels) on the hardness of asphalt
> concrete in the tensile test (abbreviated as KIC). These data were taken from 
> a
> acticle paper. The codes were wrriten as the follows:
> 
> > data = read.csv("Saha research.csv", header =T)
> > attach(data)
> > tem = as.factor(temperature)
> > ac= as.factor (AC)
> > av = as.factor(AV)
> > thick = as.factor(Thickness)
> > model =
> lm(KIC~tem+ac+av+thick+tem:ac+tem:av+tem:thick+ac:av+ac:thick+av:thick)
> > anova(model) #Type I tests
> > library(car) Loading required package: carData >
> anova(lm(KIC~tem+ac+av+thick+tem:ac+tem:av+tem:thick+ac:av+ac:thick+av
> :thick),type=2)
> Error: $ operator is invalid for atomic vectors
> > options(contrasts = c("contr.sum", "contr.poly"))
> > Anova(model,type="3") # Type III tests
> > Anova(model,type="2") # Type II tests
> 
> With R, three results from Type I, II, and III almost have the same as 
> follows.
> 
> Analysis of Variance Table Response: KIC Df Sum Sq Mean Sq F value Pr(>F)
> tem 2 15.3917 7.6958 427.9926 < 2.2e-16 *** ac 2 0.1709 0.0854 4.7510
> 0.0096967 ** av 1 1.9097 1.9097 106.2055 < 2.2e-16 *** thick 2 0.2041
> 0.1021 5.6756 0.0040359 ** tem:ac 4 0.5653 0.1413 7.8598 6.973e-06 ***
> tem:av 2 1.7192 0.8596 47.8046 < 2.2e-16 *** tem:thick 4 0.0728 0.0182
> 1.0120 0.4024210 ac:av 2 0.3175 0.1588 8.8297 0.0002154 *** ac:thick 4
> 0.0883 0.0221 1.2280 0.3003570 av:thick 2 0.0662 0.0331 1.8421 0.1613058
> Residuals 190 3.4164 0.0180 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’
> 0.05 ‘.’ 0.1 ‘ ’ 1
> 
> However, these results are different from the results in the article, 
> especially
> for the interaction (air voids and sample thickness). The results presented in
> the article are as follows:
> Analysis of variance for KIC, using Adjusted SS for tests. Source DF Seq SS 
> Adj
> MS F-stat P-value Model findings Temperature 2 15.39355 7.69677 426.68
> <0.01 Significant AC 2 0.95784 0.47892 26.55 <0.01 Significant AV 1 0.57035
> 0.57035 31.62 <0.01 Significant Thickness 2 0.20269 0.10135 5.62 <0.01
> Significant Temperature⁄AC 4 1.37762 0.34441 19.09 <0.01 Significant
> Temperature⁄AV 2 0.8329 0.41645 23.09 <0.01 Significant
> Temperature⁄thickness 4 0.07135 0.01784 0.99 0.415 Not significant AC⁄AV 2
> 0.86557 0.43279 23.99 <0.01 Significant AC⁄thickness 4 0.04337 0.01084 0.6
> 0.662 Not significant AV⁄thickness 2 0.17394 0.08697 4.82 <0.01 Significant
> Error 190 3.42734 0.01804 Total 215 23.91653
> 
> Therefore, I wonder that whether there is an error in my code or there is
> another type of ANOVA in R. If you could answer my problems, I would be
> most grateful.
> Best regards,
> Nhat Tran
> Ps: I also added a CSV file and the paper for practicing R.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/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] Sum of Squares Type I, II, III for ANOVA

2018-11-06 Thread Thanh Tran
Hi everyone,
I'm studying the ANOVA in R and have some questions to share. I investigate
the effects of 4 factors (temperature-3 levels, asphalt content-3 levels,
air voids-2 levels, and sample thickness-3 levels) on the hardness of
asphalt concrete in the tensile test (abbreviated as KIC). These data were
taken from a acticle paper. The codes were wrriten as the follows:

> data = read.csv("Saha research.csv", header =T)
> attach(data)
> tem = as.factor(temperature)
> ac= as.factor (AC)
> av = as.factor(AV)
> thick = as.factor(Thickness)
> model =
lm(KIC~tem+ac+av+thick+tem:ac+tem:av+tem:thick+ac:av+ac:thick+av:thick)
> anova(model) #Type I tests
> library(car) Loading required package: carData >
anova(lm(KIC~tem+ac+av+thick+tem:ac+tem:av+tem:thick+ac:av+ac:thick+av:thick),type=2)
Error: $ operator is invalid for atomic vectors
> options(contrasts = c("contr.sum", "contr.poly"))
> Anova(model,type="3") # Type III tests
> Anova(model,type="2") # Type II tests

With R, three results from Type I, II, and III almost have the same as
follows.

Analysis of Variance Table Response: KIC Df Sum Sq Mean Sq F value Pr(>F)
tem 2 15.3917 7.6958 427.9926 < 2.2e-16 *** ac 2 0.1709 0.0854 4.7510
0.0096967 ** av 1 1.9097 1.9097 106.2055 < 2.2e-16 *** thick 2 0.2041
0.1021 5.6756 0.0040359 ** tem:ac 4 0.5653 0.1413 7.8598 6.973e-06 ***
tem:av 2 1.7192 0.8596 47.8046 < 2.2e-16 *** tem:thick 4 0.0728 0.0182
1.0120 0.4024210 ac:av 2 0.3175 0.1588 8.8297 0.0002154 *** ac:thick 4
0.0883 0.0221 1.2280 0.3003570 av:thick 2 0.0662 0.0331 1.8421 0.1613058
Residuals 190 3.4164 0.0180 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’
0.05 ‘.’ 0.1 ‘ ’ 1

However, these results are different from the results in the article,
especially for the interaction (air voids and sample thickness). The
results presented in the article are as follows:
Analysis of variance for KIC, using Adjusted SS for tests. Source DF Seq SS
Adj MS F-stat P-value Model findings Temperature 2 15.39355 7.69677 426.68
<0.01 Significant AC 2 0.95784 0.47892 26.55 <0.01 Significant AV 1 0.57035
0.57035 31.62 <0.01 Significant Thickness 2 0.20269 0.10135 5.62 <0.01
Significant Temperature⁄AC 4 1.37762 0.34441 19.09 <0.01 Significant
Temperature⁄AV 2 0.8329 0.41645 23.09 <0.01 Significant
Temperature⁄thickness 4 0.07135 0.01784 0.99 0.415 Not significant AC⁄AV 2
0.86557 0.43279 23.99 <0.01 Significant AC⁄thickness 4 0.04337 0.01084 0.6
0.662 Not significant AV⁄thickness 2 0.17394 0.08697 4.82 <0.01 Significant
Error 190 3.42734 0.01804 Total 215 23.91653

Therefore, I wonder that whether there is an error in my code or there is
another type of ANOVA in R. If you could answer my problems, I would be
most grateful.
Best regards,
Nhat Tran
Ps: I also added a CSV file and the paper for practicing R.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Importing JSON Files

2018-11-06 Thread Jeff Reichman
Kimmo

Didn't perform exactly how I wanted but got me looking in the right area.
Thank you

Jeff

-Original Message-
From: R-help  On Behalf Of K. Elo
Sent: Monday, November 5, 2018 1:14 PM
To: r-help@r-project.org
Subject: Re: [R] Importing JSON Files

Hi!

Have you tried to use 'fromJSON' with the parameter 'simplifyDataFrame'
set to TRUE?

See: 
https://cran.r-project.org/web/packages/jsonlite/vignettes/json-aaquickstart
.html
 -> Section "Data Frames" explains how this affects the data frame
structure. IMHO this should solve your problem...

Best,
Kimmo

2018-11-05 19:00 +, JEFFERY REICHMAN wrote:
> r-help Forum
> 
> Struggling with importing and creating a data.fram from a JSON file.  
> I used the jsonlite package (fromJSON function) and I can see the 
> resulting table but one of the attributes is a list (of lists) So I 
> have something that looks like .
> 
> favorites (attribute)
> list(favoriteValue = c("12345", 23456"), resourceType = c("abc", 
> "def"), classification = c("xxx","yyy"))
> 
> So when I attempt to create a data.frame R errors out.  I'm assuming 
> it is because of the list(s).  Don't know what to do with it (the 
> list).  I need the "favoriteValue (s)."
> 
> Ultimate I want to run the arules package
> 
> Jeff Reichman
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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

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


[R] Obtain coordinates for city names

2018-11-06 Thread Miluji Sb
I have a dataframe (more than 50,000 observations), of cities in the EU.

My goal is to assign NUTS-2 code to each of these cities. However, I am not
aware of any direct way of achieving this, so I wanted to first assign
coordinates to the cities and then use the 'over' function to match with
NUTS regions from EU shapefile.

I have tried to use 'geocode' from the ggmap package but there is a 2,500
per day limit. Is there any other solution? Any help will be greatly
appreciated.

Cross-posed yesterday on r-sig-ge,

Sincerely,

Milu

[[alternative HTML version deleted]]

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


Re: [R] jsonlite

2018-11-06 Thread William Dunlap via R-help
It would make helping you easier if you presented your data
in a format that others could copy and paste into R.  E.g.,

z <- list(data.frame(favoriteValue=c(23527,21837),
Classification=c("","xyxy")),
   data.frame(favoriteValue=c(25427,21237,21997),
Classification=c("","xyxy","xyxy")),
   data.frame(favoriteValue=c(99427), Classification=c("")))

You asked from something that "looks like" comma-separated strings of
numerals.

> zAll <- do.call(rbind, z)
> zAll$ID <- rep(seq_along(z), vapply(z, nrow, 0)) # which data.frame each
row came from
> zAll
  favoriteValue Classification ID
1 23527     1
2 21837   xyxy  1
3 25427     2
4 21237   xyxy  2
5 21997   xyxy  2
6 99427     3
> library(dplyr)
> zAll %>% group_by(ID) %>% summarize(favoriteValue = paste(favoriteValue,
collapse=","))
# A tibble: 3 x 2
 ID favoriteValue
   
1 1 23527,21837
2 2 25427,21237,21997
3 3 99427

It is usually better say how you intend the use the result of your data
manipulation, rather that how it looks when printed.  The comma-separated
strings are not handy for answering questions like "what are the most
common favoriteValues?" or "who has the most favoriteValues?" - the format
used in zAll is better for that.


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Tue, Nov 6, 2018 at 11:06 AM, JEFFERY REICHMAN 
wrote:

> r-help Forum
>
> With a bit of r-help yesterday I was able to structure a JSON file such
> that I can read it within the R environment and export what I need except
> for one list object.
>
> So when I run 
>
> location <- json.raw[["favorites"]]
> thead(location)
>
> # R returns something like ...
>
> [[1]]
>   favoriteValue  favoriteType  Classification
> 1  23527   https:// .
> 2  21837   https:// .xyxy
>
> [[2]]
>   favoriteValue  favoriteType  Classification
> 1  25427   https:// .
> 2  21237   https:// .xyxy
> 3  21997   https:// .xyxy
>
> [[3]]
>   favoriteValue  favoriteType  Classification
> 1  99427   https:// .
>
>
> What I want (need) is a data frame that looks like
>
> favoriteValue
> 1  23527, 21837
> 2  25427, 21237, 21997
> 3  99427
>
> Jeff Reichman
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/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] jsonlite

2018-11-06 Thread JEFFERY REICHMAN
r-help Forum

With a bit of r-help yesterday I was able to structure a JSON file such that I 
can read it within the R environment and export what I need except for one list 
object.

So when I run 

location <- json.raw[["favorites"]]
thead(location)

# R returns something like ...

[[1]]
  favoriteValue  favoriteType  Classification
1  23527   https:// .
2  21837   https:// .xyxy

[[2]]
  favoriteValue  favoriteType  Classification
1  25427   https:// .
2  21237   https:// .xyxy
3  21997   https:// .xyxy

[[3]]
  favoriteValue  favoriteType  Classification
1  99427   https:// .


What I want (need) is a data frame that looks like 

favoriteValue
1  23527, 21837
2  25427, 21237, 21997
3  99427

Jeff Reichman

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

2018-11-06 Thread David sjöberg
Dear R-users,

The new package hablar help R-users to convert columns to new data types. 
Also helps with summary functions like min and mean with vectors that contain 
NA, Inf, NaN or when they are empty.

Three functions you may consider to use:
  
install.packages("hablar")
library(hablar)


1. convert()

mtcars %>%
  convert(num(vs),
  int(am, gear),
  chr(cyl:drat))

this simple code chunk converts column 'vs' to numeric, 
'am' and 'gear' to integer and 'cyl' through 'drat' to character.


2. retype()

mtcars <- mtcars %>%
  convert(chr(everything()))

mtcars %>% retype()

This function is for us lazy R-programmers. It converts columns 
to the simplest data type possible, without loosing information.

3. s()

min(c()) # base R returns Inf
min(s(c())) # with s it returns NA

max(c(NaN, Inf)) # base R returns NaN
max(s(c(NaN, Inf))) # with s it returns NA

mean(c(NA, 2, 4, NA)) # base R returns NA
mean(c(NA, 2, 4, NA), na.rm = TRUE) # base R with na.rm = T returns 3
mean(s(c(NA, 2, 4, NA))) # with s it returns 3 without using na.rm = TRUE
mean_(c(NA, 2, 4, NA)) # s-wrapper mean_  returns 3

s always returns a real value, otherwise NA. This helps you
avoid the problem of getting Inf when trying to minimize 
empty or vectors with infinite or NaN values. You can also skip na.rm = T
to simplify code syntax.


More information on hablar:
https://cran.r-project.org/web/packages/hablar/readme/README.html
https://github.com/davidsjoberg/hablar
https://davidsjoberg.github.io/blog/
  
Happy coding!
David

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

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

2018-11-06 Thread Elahe chalabi via R-help
Hi all,

In my df I would like to generate a new column which contains a string showing 
all the verbs in each row of df$Message.



> library(openNLP) 
> library(NLP) 
> dput(df) 
structure(list(DocumentID = c(478920L, 510133L, 499497L, 930234L 
), Message = structure(c(4L, 2L, 3L, 1L), .Label = c("Thank you very much for 
your nice feedback.\n", 
"THank you, added it", "Thanks for the well explained article.", 
"The solution has been updated"), class = "factor")), class = "data.frame", 
row.names = c(NA, 
-4L)) 

tagPOS <-  function(x, ...) { 
s <- as.String(x) 
word_token_annotator <- Maxent_Word_Token_Annotator() 
a2 <- Annotation(1L, "sentence", 1L, nchar(s)) 
a2 <- annotate(s, word_token_annotator, a2) 
a3 <- annotate(s, Maxent_POS_Tag_Annotator(), a2) 
a3w <- a3[a3$type == "word"] 
POStags <- unlist(lapply(a3w$features, `[[`, "POS")) 
POStagged <- paste(sprintf("%s/%s", s[a3w], POStags), collapse = " ") 
list(POStagged = POStagged, POStags = POStags) 
} 



Any help?
Thanks in advance!
Elahe

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

2018-11-06 Thread Martin Maechler
> Jeff Newmiller 
> on Mon, 5 Nov 2018 18:47:00 -0800 writes:

> Well, you may or may not have ruled out the Putty settings
> (your hand waving is a bit hard for me to interpret), and
> there may still be host side terminal settings involved,
> or if you compiled R yourself you may have setup something
> wrong. However, in either case the R-sig-fedora mailing
> list would be more appropriate than R-help for discussing
> configure options under Red Hat-derived distributions.  

Also, why are you using R 3.3.2  when current R is 3.5.1 ?

Even if there might have been problematic behavior of R's
"console" in that version of R, we will not be able to improve
that version retrospectively... but rather the next version of
R.

So please update your R to 3.5.1 (or even "R-devel" ideally, for
checking about potential bugs).

> On November 5, 2018 3:12:59 PM PST, Ben 
> wrote:
>> Hi Jeff - thanks.  I forgot to add originally that I use
>> putty as a terminal for the old version of R I mentioned
>> as well as the new, and also I can see the same issue
>> with the new version of R when run in xterm.  I’ve messed
>> with some of the options putty offers and it doesnt
>> change the new R behavior. Also this behavior does not
>> occur at the shell prompt, or in other prompts, like
>> interactive python. So while I agree that it doesnt seem
>> like an R issue on the surface, it only happens in R as
>> far as I can tell!
>> 
>> 
>> On Mon, Nov 5, 2018 at 2:44 PM Jeff Newmiller
>>  wrote:
>> 
>>> I am pretty sure this is not an R issue (so it is
>>> off-topic here)...
>> it
>>> sounds like the kind of misconfiguration that was common
>>> back when
>> there
>>> were dozens of competing terminal manufacturers and the
>>> solution was
>> to
>>> configure your Linux TERM variable and/or terminfo
>>> database to match
>> up
>>> with your terminal emulator program (e.g. [1]). With
>>> modem
>> autocofiguration
>>> on the OS side it may be as simple as changing your
>>> terminal emulator settings and logging in again... or
>>> not.
>>> 
>>> [1]
>>> https://www.tldp.org/HOWTO/Text-Terminal-HOWTO-7.html
>>> 
>>> On November 5, 2018 1:53:42 PM PST, Ben
>>>  wrote: >Hi all -
>>> >
>>> >I’m seeing a weird issue. I’m running R v3.3.2 on
>>> CentOS 7 Linux.
>> The
>>> >behavior of the command prompt when entering very long
>>> commands on a >single >line is strange compared to my
>>> use in older versions. Specifically, >after >hitting
>>> enter, the prompt continues on the line immediately
>>> after
>> the
>>> >previous prompt. In other words, it skips back up past
>>> all of the >previous >input on that one wrapped line.
>>> >
>>> >One way to see it clearly is to force it to display
>>> many newline >characters >with ctrl-v ctrl-j and then
>>> hit enter. In bash and my earlier R >console, >the new
>>> prompt is right at the end of the newline sequence, but
>>> in
>> the
>>> >new >versions the prompt jumps back up to the line
>>> after the previous >prompt.
>>> >
>>> >If anyone has ideas on whats going on, I’d love to hear
>>> them!
>> Thanks,
>>> >
>>> >Ben
>>> >
>>> > [[alternative HTML version deleted]]
>>> >
>>> >__
>>> >R-help@r-project.org mailing list -- To UNSUBSCRIBE and
>>> more, see >https://stat.ethz.ch/mailman/listinfo/r-help
>>> >PLEASE do read the posting guide
>>> >http://www.R-project.org/posting-guide.html >and
>>> provide commented, minimal, self-contained, reproducible
>>> code.
>>> 
>>> --
>>> Sent from my phone. Please excuse my brevity.
>>> 

> -- 
> Sent from my phone. Please excuse my brevity.

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

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