[R] Windows 7, update.packages problem: "unable to move temporary installation"?

2011-04-17 Thread Tal Galili
Hello all, I am using R 2.13.0 with windows 7, after giving my user full privileges to the R folder (as described here ). This allows me to install new packages just fine. However, when using update.packages(), to update existing

[R] time dependent hazard ratios

2011-04-17 Thread array chip
Hi, I am new to time-dependent Cox model to estimate time dependent hazard ratios. Let me use aml dataset from survival package: > aml3<-survSplit(aml2,cut=c(5,10,20),end="time",start="start", event="status",episode="i") If I want to esimate hazard ratio for each of the time intervals 0-5,

[R] Odp: boxplot with 2 treatments and 2 variables (with 2 corresponding y-axes)

2011-04-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.04.2011 16:20:23: > Hi, > > I am a complete newcomer to R and although I can plot standard box-plots I am > struggling with this... > > I have two treatments - A & B, and 2 variables 1 & 2. I want to compare > boxplots of variable 1 with variable

Re: [R] Deleting the last value of a vector

2011-04-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.04.2011 04:51:20: > Or perhaps even more parsimoniously (by a couple of characters) - > > r <- c(1, 2, 3, 4, 5) > r2<-r[-length(r)] Maybe even shorter head(x,-1) Regards Petr > > Min-Han > > On Sun, Apr 17, 2011 at 10:23 PM, Daisy Englert Duur

[R] error message while running IRT model

2011-04-17 Thread Haillie
I have been struggling with the same problem for the past few hours and am desperately in need of some help. The code I am running is as follows: ## opening a data set on the desktop setwd("C:/Users/haillie/Desktop") UN2010<- read.csv("UN2010.csv",header=TRUE) ##calling libraries library(reshape)

Re: [R] How to retrieve a vector of a data.frame's variable attributes?

2011-04-17 Thread Bacou, Melanie
David, Thanks very much. That was the right method. --Mel. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Sunday, April 17, 2011 6:00 PM To: Bacou, Melanie Cc: r-help@r-project.org Subject: Re: [R] How to retrieve a vector of a data.frame's variable attri

[R] Using jitter function with differing variable lengths

2011-04-17 Thread Danica Horrell
Hi, I am trying to make a scatter plot with 4 different categories using the jitter function. My code returns a variable length error and will not plot because my four categories have different numbers of samples. When I delete samples from my spreadsheet so that each of the categories has the s

[R] covariance matrix: a erro and simple mixed model question, but id not know answer sorry

2011-04-17 Thread Maya Joshi
Dear list I need your help: Execuse me for my limited R knowledge. #example data set set.seed (134) lm=c(1:4) block = c(rep(lm,6)) gen <- c(rep(1, 4), rep(2, 4), rep(3, 4), rep(4, 4),rep(5, 4),rep(6, 4)) X1 = c( rnorm (4, 10, 4), rnorm (4, 12, 6), rnorm (4, 10, 7),rnorm (4, 5, 2), rnorm (4, 8,

[R] Print out data frames into neat images

2011-04-17 Thread Santosh Srinivas
Hi Group, I often need to print out data frames with results of analysis into a neat little image to copy and paste into documents. I need apply formatting like bold, currency signs, number formats, header shading etc. I currently output the data into csv and format using good old excel. Any sugg

[R] cairo device and locator on windows

2011-04-17 Thread Richard M. Heiberger
In several tries, I am finding the locator and identify functions on the cairo device on Windows, with R-2.13.0, do not seem to work correctly. Here is my experience with locator where I click the four corners of the device window. First, with the windows() device, the results are consistent with

Re: [R] Repeating a function

2011-04-17 Thread Dennis Murphy
Hi: The r functions are vectorized, so the loop is unnecessary: drift <- rbinom(55, 80, 0.4) or within a function, drift <- function(p0 = 0.4, N = 40, ngen = 55) rbinom(ngen, 2 * N, p0) To repeat it 1000 times, you have at least two options: (1) [1000 columns] simmat <- replicate(1000, drif

Re: [R] Deleting the last value of a vector

2011-04-17 Thread Min-Han Tan
Or perhaps even more parsimoniously (by a couple of characters) - r <- c(1, 2, 3, 4, 5) r2<-r[-length(r)] Min-Han On Sun, Apr 17, 2011 at 10:23 PM, Daisy Englert Duursma < daisy.duur...@gmail.com> wrote: > A easier solution: > > r <- c(1, 2, 3, 4, 5) > r2<-r[1:length(r)-1] > > > > > On Mon, Apr

Re: [R] Deleting the last value of a vector

2011-04-17 Thread Daisy Englert Duursma
A easier solution: r <- c(1, 2, 3, 4, 5) r2<-r[1:length(r)-1] On Mon, Apr 18, 2011 at 10:51 AM, empyrean wrote: > Hey guys, > > I've search a few threads about deleting a value from a vector, but no one > has addressed this question so far. > > I want to delete the last value from a string of

Re: [R] Deleting the last value of a vector

2011-04-17 Thread baptiste auguie
Hi, Try this, snip = function(x, n=1) { rand = sample(1:3, 1) print(paste("using algorithm #", rand)) switch(rand, '1' = head(x, length(x) - n), '2' = x[ seq(1, length(x) - n) ], '3' = x[ - seq(length(x), by=-1, length=n) ]) } snip(1:5) HTH, but please

[R] Deleting the last value of a vector

2011-04-17 Thread empyrean
Hey guys, I've search a few threads about deleting a value from a vector, but no one has addressed this question so far. I want to delete the last value from a string of values I have: r = [ 1, 2, 3, 4, 5 ], and i want to make r2 = to [ 1, 2, 3, 4] So that r2 is just like r, except that it mis

Re: [R] Repeating a function

2011-04-17 Thread helin_susam
Hi, try this; output <- list() times <- 1000 drift <-function(p0=0.4,N=40,ngen=55){ p = p0 for( i in 1:ngen){ p = rbinom(1,2*N,p)/(2*N) } return( p ) } for(i in 1:times){ result <- drift(0.4, 40, 55) output <- c(output, list(resu

[R] Repeating a function

2011-04-17 Thread Sclera
Hello all, I currently have this function: drift <-function(p0=0.4,N=40,ngen=55){ p = p0 for( i in 1:ngen){ p = rbinom(1,2*N,p)/(2*N) } return( p ) } I want to repeat it 1000 times, then do some analysis on the results. I've tried u

[R] as.Date error

2011-04-17 Thread Wonjae Lee
Thank you for replying the as.Date error question. I have one more question as below. I used cbind command, and data x changed, 2010-11-16 to 14929, 2010-11-17 to 14930. What happened to them? What should I do to see -mm-dd format data? > x=c("11/16/2010","11/17/2010","11/18/2010","11/19/201

Re: [R] Incremental ReadLines

2011-04-17 Thread Frederik Lang
Hi again, Changing my code by defining vectors outside the loop and combining them afterwards helped a lot so now the code does not slow down anymore and I was able to parse the file in less than 2 hours. Not fantastic but it works. I will William's the last suggestion of how to parse it without

[R] NEW ONLINE R COURSE: Fundamentals of Using R

2011-04-17 Thread Geoffrey Hubona
EARLY REGISTRATION ENDS APRIL 22 The non-profit organization *Information Institute* ( http://www.information-institute.org) and faculty from Virginia Commonwealth University (VCU) are offering a live, interactive, synchronous online course entitled Fundamentals of Using R. The early registratio

Re: [R] URL Scan

2011-04-17 Thread jmsc
The site does not require a login/password. Another way to access the first site would be to go to the second site, click Connecticut, click Canterbury, CT, enter the online database, click search under Query by Location with nothing in the search fields, and click the first property. Viewing the f

Re: [R] Dump the "source code" of data frame

2011-04-17 Thread jim holtman
If you want to save it so that you can read it back later, then look at 'save' and 'load'. On Wed, Apr 13, 2011 at 3:09 AM, C.H. wrote: > Dear R experts, > > I remember a similar function existed and have been mentioned in > R-help before. I tried my best to search but I really can't find it > ou

Re: [R] side by side histogram after splitting data by year

2011-04-17 Thread jim holtman
Will one of these do it for you: > str(x) 'data.frame': 550 obs. of 5 variables: $ year: Factor w/ 2 levels "one","two": 1 1 1 1 1 1 1 1 1 1 ... $ size: Factor w/ 2 levels "large","small": 2 2 2 2 2 2 2 2 2 2 ... $ distance: num 30.9 121.5 46.1 46.1 46.1 ... $ taken : int 10 2 1

[R] different colors in a segplot centers (package latticeExtra)

2011-04-17 Thread barbara costa
Hi, how can I change colors in the centers of my segplot? I'm not interested in coloring the lines (Standard error limits) but the centers (means)? here's my code: segplot(reorder(factor(Species), MeanBiom) ~ MinSEBiom + MaxSEBiom , data=dfRatioAftBefBiom, draw.bands = FALSE, centers = MeanBiom

Re: [R] URL Scan

2011-04-17 Thread Barry Rowlingson
On Sun, Apr 17, 2011 at 9:40 PM, jmsc wrote: > I am wondering why when I try to input data from the first site listed below > into R using the scan() function, a different page is read in instead (the > second site listed): > > http://data.visionappraisal.com/CanterburyCT/parcel.asp?pid=1242 > > h

Re: [R] How to retrieve a vector of a data.frame's variable attributes?

2011-04-17 Thread David Winsemius
On Apr 17, 2011, at 4:21 PM, Bacou, Melanie wrote: Hi, I have a data.frame with 100 variables and I have assigned a "label", "units" and "category" attribute to each variable. I would like to reorder the variables in the data.frame by the "category" attributes but can't find a way. Som

Re: [R] Box plot with 5th and 95th percentiles instead of 1.5 * IQR: problems implementing an existing solution...

2011-04-17 Thread Frank Harrell
Try require(Hmisc) ?panel.bpplot This implements extended box plots that can show a variety of quantiles. Frank Paul Raftery wrote: > > Hi all, > > I'm just getting started with R and I would appreciate some help. I'm > having > trouble creating a boxplot with whiskers at the 95th and 5th perc

Re: [R] as.Date function error

2011-04-17 Thread Achim Zeileis
On Sun, 17 Apr 2011, Wonjae Lee wrote: Hi, I have some problems with as.Date function. After I applied as.Date for my data, "2010" changed to "2020" as below Where am I wrong? You used %y (two-digit year, here: "20" and then expanded to "2020") instead of %Y (four-digit year, here "2010").

[R] R Reference Card for Data Mining

2011-04-17 Thread Yanchang Zhao
An R Reference Card for Data Mining is available for free download at http://www.rdatamining.com. It can be a quick reference card for you to use R for data mining applications. Regards -- Yanchang Zhao PhD Data Miner Email: yanchangz...@gmail.com RDataMining: http://www.rdatamining.com Twitter:

Re: [R] 600 people's time series

2011-04-17 Thread Jannis
Your questions are as basic that it smells like home/classwork. Try to formulate precise questions and not questions like "how do I solve this general problem" and you are much mor likely to get answers. To get you started: For questions on how to plot values from dataframes please have a look

Re: [R] (no subject)

2011-04-17 Thread Bryan Hanson
Is there any news on this issue? I have the same problem but on a Mac. I have upgraded R and updated the built packages. The console output and sessionInfo are below. The problem is triggered by library(ggplot2) my .Rprofile If I do library(ggplot2) after the aborted start up ggplot2 is loaded

[R] URL Scan

2011-04-17 Thread jmsc
I am wondering why when I try to input data from the first site listed below into R using the scan() function, a different page is read in instead (the second site listed): http://data.visionappraisal.com/CanterburyCT/parcel.asp?pid=1242 http://www.visionappraisal.com/databases/ I am wondering i

[R] Color Key in RColorBrewer

2011-04-17 Thread chakri_amateur
Hello, I am using RcolorBrewer for plotting "similarity scores", starting with pair-wise similarity matrix as input. "similarity scores" range is 0 to1, with 1 meaning 100% similar (see two maps below) http://r.789695.n4.nabble.com/file/n3455953/lingosimilarity.jpg http://r.789695.n4.nabble.com/f

Re: [R] as.Date function error

2011-04-17 Thread Dennis Murphy
as.Date(x,"%m/%d/%Y") [1] "2010-11-16" "2010-11-17" "2010-11-18" "2010-11-19" Notice the Y (four digit date). Dennis On Sun, Apr 17, 2011 at 6:34 AM, Wonjae Lee wrote: > Hi, > > I have some problems with as.Date function. > After I applied as.Date for my data, "2010" changed to "2020" as below

[R] converting data.frame into a numeric ( integer) form

2011-04-17 Thread Haillie
Hi Everyone, I am relatively new to R and would appreciate your help on this problem that I encontered this morning. When running an ordinal IRT model using Ratings package on R, I keep getting this error message. ord.out<-ordrating(UNORD, burnin = 1000, mcmc = 40,000, thin = 400, tune = 1, verbo

[R] Box plot with 5th and 95th percentiles instead of 1.5 * IQR: problems implementing an existing solution...

2011-04-17 Thread Paul Raftery
Hi all, I'm just getting started with R and I would appreciate some help. I'm having trouble creating a boxplot with whiskers at the 95th and 5th percentiles instead of at 1.5 * IQR. I have read the relevant documentation, and checked existing mails on this topic. I found a small modification that

[R] side by side histogram after splitting data by year

2011-04-17 Thread Stratford, Jeffrey
Hi everyone, I'm looking to produce a side-by-side histogram of the number of trips taken by jays with a particular number of acorns after accounting for year (year "one" and year "two"). I know this involves indexing first then creating a histogram but I'm not sure how I'd do this. I want to e

[R] How to retrieve a vector of a data.frame's variable attributes?

2011-04-17 Thread Bacou, Melanie
Hi, I have a data.frame with 100 variables and I have assigned a "label", "units" and "category" attribute to each variable. I would like to reorder the variables in the data.frame by the "category" attributes but can't find a way. For example, the first variable is: > attributes(hh$aez) $levels

[R] reporting lme results

2011-04-17 Thread Pennell, Tanya
Hi, I have used lme4 and I have found a significant result when using anova to compare model 1 and model 2 (where I took out an interaction). The result looks like this: model.3: DIFFERENCE ~ (1 | MALE.ID) model.2: DIFFERENCE ~ MALE.SPECIES + (1 | MALE.ID) DfAICBIC logLik Chisq

Re: [R] cajolst

2011-04-17 Thread egle
Well, it was a simple phrase problem. Maybe it is going to be useful for someone: summary(ca.jo(sjd,ecdet="const",type="eigen",K=2,spec="longrun",season=4)) summary(cajolst(sjd,season=4)) cajolst(sjd,season=4)@bp -- View this message in context: http://r.789695.n4.nabble.com/cajolst-tp3454306p34

Re: [R] Multinomial Logit Model with lots of Dummy Variables

2011-04-17 Thread ghpow1
Hi Thanks to Jeremy for his response... I have been able to generate the factors and generate mlogit data using his code: mldata<-mlogit.data(mydata, varying=NULL, choice="pitch_type_1", shape="wide") my mlogit data looks like: "dependent_var","A variable","B Var","chid","alt" FALSE,"110","19

[R] as.Date function error

2011-04-17 Thread Wonjae Lee
Hi, I have some problems with as.Date function. After I applied as.Date for my data, "2010" changed to "2020" as below Where am I wrong? Thanks Wonjae > x=c("11/16/2010","11/17/2010","11/18/2010","11/19/2010") > x=as.Date(x,"%m/%d/%y") > x [1] "2020-11-16" "2020-11-17" "2020-11-18" "2020-11-19"

Re: [R] Rsquared for anova

2011-04-17 Thread Dorien Herremans
Thanks everyone. Yes Peter, I already added nh1=factor(nh1) to the 'routine'. Mostly, my collegues are helping me work out the results and they know more about regression, it has been a while for me... They just asked if I could also provide an R2, to see how good the model fits... therefore the

[R] multiple instance learning

2011-04-17 Thread zem
Hi all, know somebody a package for R where are implemented multiple instance learning algos? I've just checked the forum, but couldnt find anythink... thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/multiple-instance-learning-tp3455505p3455505.html Sent from

Re: [R] Rsquared for anova

2011-04-17 Thread Peter Ehlers
On 2011-04-17 02:34, Dorien Herremans wrote: Thanks for your remarks. I've been reading about R for the last two days, but I don't really get when I should use lm or aov. I don't think that reading about R is the answer at this stage. It appears to me that you need to learn more about regressio

Re: [R] Boxplot with two or more Y vectors

2011-04-17 Thread Uwe Ligges
On 13.04.2011 15:58, Håvard Wahl Kongsgård wrote: Hi, for a simple boxplot in R, in the formula is it possible to include two or more Y vectors directly. Or is that only possibility by aggregating the data first? Do you think about something like boxplot(cbind(y1, y2)) ? Uwe Ligges _

Re: [R] boxplot with 2 treatments and 2 variables (with 2 corresponding y-axes)

2011-04-17 Thread Uwe Ligges
On 15.04.2011 16:20, Ellis, David wrote: Hi, I am a complete newcomer to R and although I can plot standard box-plots I am struggling with this... I have two treatments - A& B, and 2 variables 1& 2. I want to compare boxplots of variable 1 with variable 2 for each treatment. I would also

Re: [R] startup script with library call to ggplot2 in R-2.13.0; was: (no subject)

2011-04-17 Thread Uwe Ligges
1. Please do read the posting guide and perovide a sensible subject line. 2. Have you updated ggplot for R-2.13.0 before reporting the error? E.g. please try update.packages(checkBuilt=TRUE) and afterwards report again. Uwe Ligges On 16.04.2011 22:25, Steve Lianoglou wrote: Out of curiosit

Re: [R] sweave options with variable

2011-04-17 Thread Henrik Bengtsson
[Forgot to cc: the list] Hi. On Sun, Apr 17, 2011 at 8:04 AM, Kai Ying wrote: > thanks, >   It can work but not as elegant as I expect because it add extra code to > every chunk of code. > I have tried the cache for this purpose it works in most case but have a lot > of other problems so I decid

Re: [R] sweave options with variable

2011-04-17 Thread Gabor Grothendieck
On Sun, Apr 17, 2011 at 11:04 AM, Kai Ying wrote: > thanks, >   It can work but not as elegant as I expect because it add extra code to > every chunk of code. > I have tried the cache for this purpose it works in most case but have a lot > of other problems so I decided to control it by myself. >

Re: [R] sweave options with variable

2011-04-17 Thread Kai Ying
thanks, It can work but not as elegant as I expect because it add extra code to every chunk of code. I have tried the cache for this purpose it works in most case but have a lot of other problems so I decided to control it by myself. I guess that sweave running R code before tex, so tex variable

Re: [R] adding two colmns of a data frame

2011-04-17 Thread John Kane
You mean like this? mydata <- data.frame(aa=1:5, bb=1:5) mydata[,3] <- mydata[,1] + mydata[,2] mydata --- On Sat, 4/16/11, ozgrerg wrote: > From: ozgrerg > Subject: [R] adding two colmns of a data frame > To: r-help@r-project.org > Received: Saturday, April 16, 2011, 4:22 PM > It seems very sim

Re: [R] Rsquared for anova

2011-04-17 Thread Mike Marchywka
( did this msg make it through the lists as rich text? hotmail didn't seem to think it was plain text?) Anyway, having come in in the middle of this it isn't clear if your issues are with R or stats or both. Usually the hard core stats people punt the stats questions to other places but both ca

Re: [R] sweave options with variable

2011-04-17 Thread Duncan Murdoch
On 11-04-17 2:41 AM, Kai Ying wrote: hello: Do any one know how to set sweave option by variable, for example I want set some of my selected code chunk with: <>= rather than<>=, so I can change the action only in the head by change the variable "needRun" one times. I have tried use "\Def" an

Re: [R] how to get the plot like this by R?

2011-04-17 Thread wangxipei
Thank you, John, for the blog website and the kind reminding. Thank Jinsong and Jinyan for your kindness. Xipei Wang, Ph.D. student Beijing, China At 2011-04-16 21:21:33£¬"John Kane" wrote: I posted my response to you to the mailing list. You replied only to me so other R-help readers will n

Re: [R] cube root

2011-04-17 Thread Sascha Vieweg
On 11-04-17 07:51, Branimir K. Hackenberger wrote: This is some interesting: -8^(1/3) [1] -2 x=(-8:8) y=x^(1/3) y [1] NaN NaN NaN NaN NaN NaN NaN NaN 0.00 1.00 [11] 1.259921 1.442250 1.587401 1.709976 1.817121 1.912931 2.00 So,

Re: [R] cube root

2011-04-17 Thread David Winsemius
Hey :) In addition, although (-2)^3 = -8, (-8)^(1/3) != -2, mathematically. A fractional power of a negative number is complex. _Not_ in addition. The citation of FAQ 7.33 did not address the correct issue since the sequence was enclosed in parens. Yours is the only correct answer. For further

Re: [R] prb with data.table

2011-04-17 Thread yoda55
I upgraded to R.2.13.0 and the problem disappeared. Thx -- View this message in context: http://r.789695.n4.nabble.com/prb-with-data-table-tp3454478p3455103.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] if else statements in data frame

2011-04-17 Thread ozgrerg
Thanks alot B77S. That was a critical post. -- View this message in context: http://r.789695.n4.nabble.com/if-else-statements-in-data-frame-tp3454646p3455077.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailin

Re: [R] cube root

2011-04-17 Thread Tsjerk Wassenaar
Hey :) In addition, although (-2)^3 = -8, (-8)^(1/3) != -2, mathematically. A fractional power of a negative number is complex. And this can be obtained properly in R: > (-8+0i)^(1/3) [1] 1+1.732051i Cheers, Tsjerk >> This is some interesting: >> >>> -8^(1/3) >> >> [1] -2 >> >>> x=(-8:8) >> >>