[R] scale_*_manual in ggplot2

2014-08-13 Thread Pavneet Arora
Data this is the data I used for the following problems: dput(sdf) structure(list(weeks = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30), values = c(9.45, 7.99, 9.29, 11.66, 12.16, 10.18, 8.04, 11.46, 9.2, 10.34, 9.03, 11.47,

[R] Legend in ggplot2

2014-08-07 Thread Pavneet Arora
Hi All Following is my dataset. dput(tabu) structure(list(weeks = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30), values = c(9.45, 7.99, 9.29, 11.66, 12.16, 10.18, 8.04, 11.46, 9.2, 10.34, 9.03, 11.47, 10.51, 9.4, 10.08, 9.37,

[R] Differencing between 2 previous values

2014-07-28 Thread Pavneet Arora
Hello All, I am trying to do a simple thing of calculating the absolute difference between 2 previous values. Since my original data consists of 30 rows, this column where I am storing my absolute difference values only consists of 29 rows (called the ?differ?)! And I am having troubling cbind

Re: [R] Differencing between 2 previous values

2014-07-28 Thread Pavneet Arora
Thank you for that simple answer. Really appreciate it. From: PIKAL Petr petr.pi...@precheza.cz To: Pavneet Arora/UK/RoyalSun@RoyalSun, r-help@r-project.org r-help@r-project.org Date: 28/07/2014 10:26 Subject:RE: [R] Differencing between 2 previous values Hi see in line

[R] using foumula to calculate a column in dataframe

2014-07-28 Thread Pavneet Arora
Hello All, I need to calculate a column (Vupper) using a formula, but I am not sure how to. It will be easier to explain with an example. Again this is my dataset: dput(nd) structure(list(week = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,

[R] Creating Functions in R

2014-07-24 Thread Pavneet Arora
Hello Guys I am new at writing Functions in R, and as a result am struggling with it. I am trying to use Google other resources, but it's hard to find solutions when you don't know what to look for. I have the following small dataset dput(sub) structure(list(week = c(1, 2, 3, 4, 5, 6, 7, 8,

Re: [R] Creating Functions in R

2014-07-24 Thread Pavneet Arora
me with this. From: Sarah Goslee sarah.gos...@gmail.com To: Pavneet Arora/UK/RoyalSun@RoyalSun Cc: r-help r-help@r-project.org Date: 24/07/2014 15:04 Subject:Re: [R] Creating Functions in R Hi, On Thu, Jul 24, 2014 at 9:35 AM, Pavneet Arora pavneet.ar...@uk.rsagroup.com

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-23 Thread Pavneet Arora
) # readline(prompt=Press [enter] to continue) } dev.off() Hope this is much clearer? From: Jeff Newmiller jdnew...@dcn.davis.ca.us To: Pavneet Arora/UK/RoyalSun@RoyalSun, r-help@r-project.org Date: 22/04/2014 16:09 Subject:Re: [R] Fw: Save multiple plots

Re: [R] Read.table mucks up headers

2014-04-22 Thread Pavneet Arora
Hello Uwe I tried both the options you mentioned, but it didnt work. All i get as output then is the header line and the headers as row.names and X. I am using R-Studio v0.98 From: Uwe Ligges lig...@statistik.tu-dortmund.de To: Pavneet Arora/UK/RoyalSun@RoyalSun, r-help@r

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-16 Thread Pavneet Arora
...@statistik.tu-dortmund.de To: Pavneet Arora/UK/RoyalSun@RoyalSun, r-help@r-project.org, pavnee...@yahoo.co.uk Date: 15/04/2014 14:08 Subject:Re: [R] Fw: Save multiple plots as pdf or jpeg You have 1e6 observations and your lines() have these many segments, try to plot the sensity only

Re: [R] Read.table mucks up headers

2014-04-15 Thread Pavneet Arora
Thank you Milan, the fileEncoding bit worked perfectly. From: Milan Bouchet-Valat nalimi...@club.fr To: Jeff Newmiller jdnew...@dcn.davis.ca.us Cc: Pavneet Arora/UK/RoyalSun@RoyalSun, r-help@r-project.org, pavnee...@yahoo.co.uk Date: 14/04/2014 18:03 Subject:Re: [R

[R] Save multiple plots as pdf or jpeg

2014-04-15 Thread Pavneet Arora
Hello All, I have multiple plots that I want to save it a single file. At the moment, I am saving as pdf. Each plot has a qqnorm, qqline, tiny histogram in the top left graph with its density drawn top of it and the normal superimposed on the histogram. As a result, the pdf takes forever to

[R] Fw: Save multiple plots as pdf or jpeg

2014-04-15 Thread Pavneet Arora
Hello All, I have multiple plots that I want to save it a single file. At the moment, I am saving as pdf. Each plot has a qqnorm, qqline, tiny histogram in the top left graph with its density drawn top of it and the normal superimposed on the histogram. As a result, the pdf takes forever to

[R] Read.table mucks up headers

2014-04-14 Thread Pavneet Arora
Hey All I am trying to read in a small text file using read.table. dput(sim) structure(list(ï...X. = 1:7, Y1 = c(2.5501, 4.105, 5.4687, 7.0009, 8.5066, 9.785, 11.5167), Y2 = c(2.5501, 4.105, 5.4687, 11.0009, 8.5066, 9.785, 11.5167), Y3 = c(2.5501, 4.105, 5.4687, 7.0009, 8.5066, 9.785,

Re: [R] Principal Components Loadings

2014-03-26 Thread Pavneet Arora
, 18.5, 18.5, 18.8, 18.5, 20.1, 18, 19.8, 20.9 )), .Names = c(neck, chest, abdomen, hip, thigh, knee, ankle, biceps, forearm, wrist), class = data.frame, row.names = c(NA, -252L)) Hope this helps. From: John Kane jrkrid...@inbox.com To: Pavneet Arora/UK/RoyalSun@RoyalSun Date: 25/03/2014

[R] Digits in R

2014-03-25 Thread Pavneet Arora
Hello All, I am new in R, so please excuse the basic questions. But how do you change the number of digits to be displayed? I have done the following, hoping I will get 4 decimal places in my answer: vars - var(cbind(Sepal.l,Sepal.w,Petal.l,Petal.w)) print(vars,digits=4) But as seen below

Re: [R] Digits in R

2014-03-25 Thread Pavneet Arora
Thank you Qiang Kou , it worked :) Appreciate it. From: Qiang Kou q...@umail.iu.edu To: Pavneet Arora/UK/RoyalSun@RoyalSun Cc: R help r-help@r-project.org Date: 25/03/2014 13:37 Subject:Re: [R] Digits in R Have you tried round(vars, digits = 4) ? KK On Tue, Mar 25

[R] Principal Components Loadings

2014-03-25 Thread Pavneet Arora
Hello All, I have a dataset bodysize.Rdata from Journal of Statistics Education Data Archive, which I have attached here. I am trying to do principal components analysis on it using princomp, and it seems to be working fine. However, I am really struggling in interpretating the loadings of

[R] Fwd: R basic data manipulation Queries

2014-03-18 Thread Pavneet Arora
Sent from Samsung Mobile Original message Subject: R basic data manipulation Queries From: Pavneet Arora pavneet.ar...@uk.rsagroup.com To: pavnee...@yahoo.co.uk CC: Hello Guys I am new in R, so please excuse the really basic questions. I have tried reading numeral