Re: [R] convert list int data frame

2015-09-14 Thread Ivan Calandra
Hi Luigi, It depends on how you want to put the different elements of my.list into a data.frame. Basically, data.frames are lists, so doing data.frame(my.list) is straigthforward. HTH, Ivan -- Ivan Calandra, PhD University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade

Re: [R] Boolean expression

2015-09-14 Thread Jue Lin-Ye
​Dear Dr. Lemon, I am amazed, I did not know that a space could solve this issue. So you mean that, besides being sensible to letter capitalization, R is also sensible to spaces? Many thanks! Jue​ [[alternative HTML version deleted]] __

Re: [R] Boolean expression

2015-09-14 Thread Jim Lemon
Hi Jue, The character sequence "<-" is preferentially interpreted as "assign the value on the right to the name on the left". You can use parentheses to force the unary minus to be interpreted: if(a<(-1)) or you can just break the sequence with a space: if(a< -1) One less character, but

[R] convert list int data frame

2015-09-14 Thread Luigi Marongiu
Dear all, i would like to convert a list onto a data frame object. Is there an easy way of doing it? I know I should use unlist() but I am not sure about the implementation for the addition of the row numbers; or I could extract one member at the time with something like x <- my.list[[i]] but then

Re: [R] How to read CSV from web?

2015-09-14 Thread Gabor Grothendieck
Your read.csv call works for me under Windows on "R version 3.2.2 Patched (2015-08-25 r69180)" but not on "R version 3.1.3 Patched (2015-03-16 r68169)". Suggest you upgrade your R installation and try again. If you are on Windowsw and don't want to upgrade right now an alternative is to issue

Re: [R] convert list int data frame

2015-09-14 Thread Sarah Goslee
You don't say how you want the new data frame (which incidentally is also a list) to be constructed, so here are two options: > my.list <- replicate(5, matrix(1:(6*27), ncol = 6, byrow = TRUE), FALSE) > dim(my.list[[1]]) [1] 27 6 > dim(do.call(rbind.data.frame, my.list)) [1] 135 6 >

[R] Boolean expression

2015-09-14 Thread Jue Lin-Ye
Dear fellow R users, I would like to discuss something. First of all, I would like to make clear that I think that the current R software is great. I have noticed that, for example, in the boolean expression "if(a<-1)", it is not clear if what is asked is "if 'a' is 1" or "if 'a' is lesser than

Re: [R] 回覆︰ adding a line across plots in xy plot with panel.abline

2015-09-14 Thread Michael Dewey
Dear Christine The point of the ellipsis ... is to pass into the interior function any other parameters which were supplied to the exterior function. If you know for sure that there will never, never, never be such additional parameters then you can leave it out but that is a bit like not

[R] Trees (and Forests) with packages 'party' vs. 'partykit': Different results

2015-09-14 Thread apeshifter
Dear all, I'm currently exploring a dataset with the help of conditional inference trees (still very much a beginner with this technique & log. reg. methods as a whole t.b.h.), since they explained more variation in my dataset than a binary logistic regression with /glm/. I started out with the

[R] R lines type in a glm/predict model

2015-09-14 Thread laurafdez56
Hi everyone! I want to change the line type into a square/circle/triangle in a plot, and I can not find the way, could someone help me please?? I used the glm/predict function to predict the curves. Here is my code: glm1<-glm(Supervivencia~Temperatura*Especie,pinos,family=binomial)

Re: [R] 回覆︰ adding a line across plots in xy plot with panel.abline

2015-09-14 Thread Bert Gunter
Christine: You need to spend some time with an R tutorial ("An Intro to R" ships with R, but there are many on the web) where function arguments are explained more fully. That should go a long way to clearing up your "stupidity." Cheers, Bert Bert Gunter "Data is not information. Information

Re: [R] Boolean expression

2015-09-14 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jue > Lin-Ye > Sent: Monday, September 14, 2015 3:05 PM > To: Jim Lemon > Cc: r-help mailing list > Subject: Re: [R] Boolean expression > > ​Dear Dr. Lemon, > > I am amazed, I did not know that a

Re: [R] R lines type in a glm/predict model

2015-09-14 Thread Sarah Goslee
It's not clear to me quite what you want, but you might look at the type="b" argument to lines, or potentially ?points Sarah On Mon, Sep 14, 2015 at 8:11 AM, laurafdez56 wrote: > Hi everyone! > I want to change the line type into a square/circle/triangle in a plot,

Re: [R] Trees (and Forests) with packages 'party' vs. 'partykit': Different results

2015-09-14 Thread Achim Zeileis
Christopher, thanks for you interest. I'm currently exploring a dataset with the help of conditional inference trees (still very much a beginner with this technique & log. reg. methods as a whole t.b.h.), since they explained more variation in my dataset than a binary logistic regression

Re: [R] 回覆︰ adding a line across plots in xy plot with panel.abline

2015-09-14 Thread Duncan Mackay
forgot to send to list From: Duncan Mackay [mailto:dulca...@bigpond.com] Sent: Tuesday, 15 September 2015 01:47 To: 'Christine Lee' Subject: RE: 回覆︰ [R] adding a line across plots in xy plot with panel.abline Hi If your panel function was like this (just adding to plot the points with

Re: [R] igraph tree: increase vertex separation within tier (self-contained example)

2015-09-14 Thread Loris Bennett
Loris Bennett writes: > Hi, > > I am collecting data about network errors and would like to visualise > the results in some sort of graph which reflects the hierarchy of the > components in the network (i.e. core switches are connected to leaf > switches and nodes are

Re: [R] R lines type in a glm/predict model

2015-09-14 Thread Michael Dewey
Dear Laura The line type is usually something like: solid, dotted, dashed, ... The shapes you suggest are usually point symbols. When you repost perhaps it would be a good idea to 1 - give us a small dataset 2 - just supply code for two species 3 - tell us what you see, and what you really

[R] Error in principal component loadings calculation

2015-09-14 Thread Marcelo Kittlein
Hi all I have been using "princomp" to obtain the principal components of some data and find that the loadings returned by the function appear to have some error. in a simple example if a calculate de pc for a random matrix I get that all loadings for the different components have the same

Re: [R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread Nordlund, Dan (DSHS/RDA)
Another option is apply(X,2,function(x) x-mean(x)) Hope this is helpful, Dan Daniel Nordlund, PhD Research and Data Analysis Division Services & Enterprise Support Administration Washington State Department of Social and Health Services -Original Message- From: R-help

Re: [R] Is there any concise way to write a one-to-one mapping?

2015-09-14 Thread Jeff Newmiller
Assuming your data are in a data frame, make anorher data frame with the type and type2 columns and merge it with your original data frame. ?merge --- Jeff NewmillerThe . . Go

[R] Multinomial data

2015-09-14 Thread Iker Vaquero Alba
   Hello everyone,    I have some data I would like to analyse where my response variables are categorical data: several participants were asked to give answers in the form of 1 to 5 (for the degree of importance given to certain items). So, what I have now is response variables that can just

[R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread JORGE COLACO
I would greatly appreciate if you could let me know why the R does not make the right computations in the case below. Waiting for your reply Jorge Colaço R version 3.2.2 (2015-08-14) -- "Fire Safety" Copyright (C) 2015 The R Foundation for Statistical Computing Platform:

[R] I have trouble loading histogram :(

2015-09-14 Thread massmatics
Make a histogram and boxplot of the data sets: *south.csv*. south.csv (the following is how it is displayed in the excel file) x -> Acolumn, 1st row 12 10 10 13 12 12 14 7 16 18 8 29 12 14 33 10 6 18 11 25 8 16 14 11 10 20 14 11 12 13 -> Acolumn, 31st row This is the code I used to run but

[R] SSD vs RAM upgrade

2015-09-14 Thread Kulas, John T.
I have several lab computers that frequently lag/crash with R apparently due to low RAM (they're all 8 GB) I put in a request to up the RAM to 32 GB on a few, but my tech support is suggesting an SSD harddrive upgrade instead of the increased RAM. Any suggestions on the better approach (SSD

Re: [R] SSD vs RAM upgrade

2015-09-14 Thread Mark Sharp
John, Unless you are doing something very unusual (such as using a database to keep intermediate results) SSD hardware will have no affect on R being memory bound. According to the behavior you described, you need RAM. R. Mark Sharp, Ph.D. Director of Primate Records Database Southwest

[R] Is there any concise way to write a one-to-one mapping?

2015-09-14 Thread jpm miao
My code is: if(type=="none") type2<-"nc" if(type=="drift") type2<-"c" if(type=="trend") type2<-"ct" I am wondering if there's a concise way to write a mapping from type to type2, especially when the number of categories is high. Thanks! [[alternative HTML version deleted]]

Re: [R] Multinomial data

2015-09-14 Thread Rich Shepard
On Mon, 14 Sep 2015, Iker Vaquero Alba wrote:    I have some data I would like to analyse where my response variables are categorical data: several participants were asked to give answers in the form of 1 to 5 (for the degree of importance given to certain items). So, what I have now is

Re: [R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread Sarah Goslee
On Mon, Sep 14, 2015 at 11:11 AM, JORGE COLACO wrote: > I would greatly appreciate if you could let me know why the R does not make > the right computations in the case below. > Waiting for your reply > Jorge Colaço R made the correct computations: it did exactly what you told

Re: [R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread Rui Barradas
Hello, R subtracts the _column_ vector 'mean' to X (column by column). Apparently you want the transpose, or think 'mean' is a row vector. Try instead t(t(X) - mean) And use another name for 'mean', it already is the name of a function. Hope it helps, Rui Barradas Em 14-09-2015 16:11,

Re: [R] I have trouble loading histogram :(

2015-09-14 Thread Sarah Goslee
Is this homework? We don't do homework here. Two hints, though: use str() to look at your data after you read it into R. don't use attach(). Sarah On Mon, Sep 14, 2015 at 10:45 AM, massmatics <2hanl...@naver.com> wrote: > Make a histogram and boxplot of the data sets: *south.csv*. > > south.csv

Re: [R] R lines type in a glm/predict model

2015-09-14 Thread David Winsemius
On Sep 14, 2015, at 1:18 PM, laurafdez56 wrote: > Dear Michael! > Here is my database: Survival_help.csv > > That is just what I thought about the point symbols, but is there possible > to put square, circle or whatever instead

Re: [R] Error in principal component loadings calculation

2015-09-14 Thread David L Carlson
The sum of the squared loadings will always sum to 1 because they are standardized by dividing them by the standard deviation of each component. The terminology for principal components is not as consistent as we could hope. What princomp() calls loadings is really the structure matrix (the

[R] Plotting Numeric Values with Non-Numeric Values

2015-09-14 Thread mtilley3
I have looked for quite a long time and can't quite find the answer for what I'm looking for. I want to graph bmi vs gender, with male/female on the x-axis and the bmi numerical value on the y-axis. Can anyone explain how to do this? Thanks! -- View this message in context:

Re: [R] Error in principal component loadings calculation

2015-09-14 Thread David L Carlson
The quickest way to get that is > summary(pc) Importance of components: Comp.1Comp.2Comp.3Comp.4Comp.5 Standard deviation 1.1984186 1.1020461 0.9522896 0.9119038 0.7815774 Proportion of Variance 0.2872414 0.2429011 0.1813711 0.1663137 0.1221726

Re: [R] I have trouble loading histogram :(

2015-09-14 Thread John Kane
This looks a lot like homework and we have a no homework policy. However hist(south) is definitely not correct. Hint south is a data,frame not the variable. John Kane Kingston ON Canada > -Original Message- > From: 2hanl...@naver.com > Sent: Mon, 14 Sep 2015 07:45:18 -0700 (PDT) >

[R-es] escala

2015-09-14 Thread jbetancourt
Estimados Veo que se hacen escalas del 0 al uno con un gr�fico en forma de barras de colores horizontal ?como se formula este script? saludos cordiales Jos� [[alternative HTML version deleted]] ___ R-help-es mailing list

Re: [R] Plotting Numeric Values with Non-Numeric Values

2015-09-14 Thread William Dunlap
d <- data.frame( # data to make a self-contained example gender=rep(c("Female","Male"),c(4,6)), bmi=c(seq(24,25,len=4), seq(25,27,len=6)), age=c("Young","Old")[c(1,1,2,2,1,1,1,1,2,2)]) boxplot(bmi ~ gender, data=d) lattice::bwplot(bmi ~ gender, data=d) lattice::bwplot(bmi ~ gender |

Re: [R] [FORGED] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread Rolf Turner
On 15/09/15 03:11, JORGE COLACO wrote: I would greatly appreciate if you could let me know why the R does not make the right computations in the case below. Waiting for your reply. It is very irritating, at least to me, when list correspondents submit postings asserting that "R gets it

Re: [R] Plotting Numeric Values with Non-Numeric Values

2015-09-14 Thread Mark Sharp
Try ?boxplot 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 Sep 14, 2015, at 1:49 PM, mtilley3

Re: [R] Order of boxplots

2015-09-14 Thread li li
Hi Jeff, Thanks for replying. I actually tried "ordered(tmp$type, levels=c("c", "b", "a")." But I think only the order of the letters on x axis changed but the order of the boxplot did not. So there is some problem there. I also tried as.factor(tmp$type); levels(tmp$type)=c("c", "b", "a") and

[R] Order of boxplots

2015-09-14 Thread li li
Hi all, I have the following data "tmp" and I want to plot boxplots for each level of the factor "type" and the order the factor should be c, b ,a. In other words, the boxplot corresponding to the level "c" should be the first and so on. Any suggestions? Li > tmp result type 1 101

Re: [R] Order of boxplots

2015-09-14 Thread Jeff Newmiller
Make your factor variable deliberately. That is, specify the levels parameter with the values in order when you create the factor. --- Jeff NewmillerThe . . Go Live...

Re: [R] a question about data manipulation in R

2015-09-14 Thread John Kane
Please do not send email in HTML. The R-help mailer removes any HTML code and the result is a mess. Your results were readable but still a terrible mess. Also please reply to the R-help list not just to me. Your chances of getting an answer are much better if you reply to the list. Anyway here

Re: [R] Order of boxplots

2015-09-14 Thread Kristina Wolf
Have you tried: tmp$type= factor(tmp$type, levels = c("c", "b", "a")) Then try your boxplots. *​~ Kristina* ​​ Kristina Wolf ​ ​ Ph.D. Candidate, Graduate Group in Ecology M.S. Soil Science ​, ​ B.S. Animal Science​ ​ KristinaMWolf.com Restoration Ecology Lab ​ Department of Plant Sciences ​

Re: [R] R lines type in a glm/predict model

2015-09-14 Thread laurafdez56
Dear Michael! Here is my database: Survival_help.csv That is just what I thought about the point symbols, but is there possible to put square, circle or whatever instead lines solid, dotted, etc?? I draw the graphics with dotted

Re: [R] R lines type in a glm/predict model

2015-09-14 Thread laurafdez56
Dear Sara!! Thank you for your advice, but is very weird the graphic type="b. I only want to draw square line instead dotted line, do I explain myself? Thank you!! Laura -- View this message in context: http://r.789695.n4.nabble.com/R-lines-type-in-a-glm-predict-model-tp4712219p4712256.html

Re: [R] adding a line across plots in xy plot with panel.abline

2015-09-14 Thread Bert Gunter
You misspelled panel.abline as panel.labline in your code you included here. If that's the real code, that's why. -- Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Sun, Sep 13, 2015 at 8:43 PM,

Re: [R] adding a line across plots in xy plot with panel.abline

2015-09-14 Thread Duncan Mackay
Hi As Bert has intimated there was a misspelling in panel.abline To get points as well you need the appropriate arguments for a panel function otherwise you would only get a line. You only had a function for a line in panel function so adding panel.xyplot will give you points as well.

Re: [R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread Frank Schwidom
On Mon, Sep 14, 2015 at 04:11:57PM +0100, JORGE COLACO wrote: > > X-mean > [,1] [,2] [,3] [,4] [,5] [,6] > [1,] -0.8 -0.2 0.8 -1.2 0.8 -0.2 > [2,] -0.2 0.2 0.8 0.8 0.8 -1.2 > [3,] -1.2 -0.2 -0.8 0.8 -0.2 0.8 > [4,] 0.8 0.8 -1.2 -0.8 -0.2 -0.2 > [5,] -0.2 -0.2 0.8 0.8 -0.8 0.8 >

Re: [R] Is there any concise way to write a one-to-one mapping?

2015-09-14 Thread Duncan Murdoch
On 14/09/2015 1:35 PM, jpm miao wrote: My code is: if(type=="none") type2<-"nc" if(type=="drift") type2<-"c" if(type=="trend") type2<-"ct" These are concise: type2 <- c(none = "nc", drift = "c", trend = "ct")[type] type2 <- switch(type, none = "nc", drift = "c", trend =

Re: [R] Please read **URGENT** Need help with R

2015-09-14 Thread cryan
After your 4th line of code (your second read.csv statement) what is the output of str(EURUSD) --Chris Ryan Sent from my android device. -Original Message- From: Mehmet Dogan To: r-help@r-project.org Sent: Sun, 13 Sep 2015 17:57 Subject: [R] Please read **URGENT**

[R] 回覆︰ adding a line across plots in xy plot with panel.abline

2015-09-14 Thread Christine Lee via R-help
Thanks, Duncan, I am confused by the function(x,y, ...) and panel.xyplot(x,y,...).  Is this a must to put in "..."? I knew this may be a stupid question.  I am sorry. Christine Duncan Mackay 於 2015年09月14日 (週一) 3:56 PM 寫道﹕ Hi As Bert has intimated there was