Re: [R] How to keep the command 'R CMD INSTALL -l' running, even when some error is encountered?

2011-08-22 Thread Prof Brian Ripley
On Mon, 22 Aug 2011, thmsfuller...@gmail.com wrote: Hi, 'R CMD INSTALL -l' will stop if some error is encountered. I don't find in the manual an option to keep the command running. Is there such an option? No. Why would you want to install a package with errors? If you mean that R CMD INST

Re: [R] Package Installation in osx

2011-08-22 Thread Prof Brian Ripley
This was garbled en route, but (a) Your R is far too old: please update as the posting guide asked of you. (You seem to be using a pre-release of 2.11.0.) (b) You need to set DISPLAY, as the message says. It usually is set at a Mac OS X console, so perhaps you need to ask on R-sig-mac about

[R] Marginal Effects for Beta Regression

2011-08-22 Thread Chris_h
Hi, Im just doing some Beta-Regressions with the betareg package. My question is now, is there a possibility to calculate the marginal effects with the betareg package or is there another package which can handle marginal effects on regression output for the "beta" class? I try to calculate the m

Re: [R] Using R for grouped data based calculations ???

2011-08-22 Thread David Winsemius
On Aug 23, 2011, at 12:34 AM, Amit Jain wrote: Hi, Has Anyone used R for descriptive statistics of Grouped Data. I have an example below It seems to be a big night for homework on Rhelp. Can someone calculate the Median of the following data using R Miles Driven Number of Res

Re: [R] Linear Regression with 2 grouping variables

2011-08-22 Thread Dennis Murphy
Hi: You're kind of on the right track, but there is no conditioning formula in lm(); it's not lattice :) This is relatively easy to do with the plyr package, though: library('plyr') # Generate a list of models - the subsetting variables (Site, Vial) are # used to generate the data splits and the

[R] Using R for grouped data based calculations ???

2011-08-22 Thread Amit Jain
Hi, Has Anyone used R for descriptive statistics of Grouped Data. I have an example below Can someone calculate the Median of the following data using R Miles Driven             Number of Residents 0-2999                           10 3000-5999                     28 6000-8999                    

Re: [R] GLM question

2011-08-22 Thread Joshua Wiley
Hi Andra, There are several problems with what you are doing (by the way, I point them out so you can learn and improve, not to be harsh or rude). The good news is there is a solution (#3) that is easier than what you are doing right now! 1) glm.fit() is a function so it is a good idea not to us

[R] GLM question

2011-08-22 Thread Andra Isan
Hi All, I am trying to fit my data with glm model, my data is a matrix of size n*100. So, I have n rows and 100 columns and my vector y is of size n which contains the labels (0 or 1) My question is: instead of manually typing the model as glm.fit = glm(y~ x[,1]+x[,2]+...+x[,100], family=bino

Re: [R] How can I do these simulations with R code

2011-08-22 Thread Rolf Turner
Do your own homework!!! On 23/08/11 13:49, Mauro Sznelwar wrote: 1) The Pareto P(alfa) distribution is defined by its density f(x|alfa) =alfa*X^(-alfa-1) over (1 to infinity). Show that it can be generated as the -1/alfa power of a uniforme variate. Plot the histogram and the density. 2) The

Re: [R] Auto key legend does not match plot

2011-08-22 Thread Deepayan Sarkar
On Sat, Aug 20, 2011 at 3:53 AM, markm0705 wrote: > Dear R-help members.  I am an 'R-learner' (about 6 hours so far) using the > lattice library to create a ranked dotplot and am colour coding the dots by > a variable called "Commodity".  However when i use autokey to make a legend > the size (cex

Re: [R] Using the ConText editor?

2011-08-22 Thread Jim Holtman
if you are running on Windows, the install AutoHotKey and this will allow you to setup some macros to accomplish this. this is what notepad++ does and it is easybto extend. Sent from my iPad On Aug 22, 2011, at 9:07, Robert Lundqvist wrote: > In my orgainzation, the people resonsible for the

Re: [R] How can I do these simulations with R code

2011-08-22 Thread Joshua Wiley
Hi Mauro, This list is not meant to help with homework problems or contrived exercises. Please see your instructor or find a more appropriate forum. Cheers, Josh On Mon, Aug 22, 2011 at 6:49 PM, Mauro Sznelwar wrote: > 1) The Pareto P(alfa) distribution is defined by its density f(x|alfa) >

[R] How can I do these simulations with R code

2011-08-22 Thread Mauro Sznelwar
1) The Pareto P(alfa) distribution is defined by its density f(x|alfa) =alfa*X^(-alfa-1) over (1 to infinity). Show that it can be generated as the -1/alfa power of a uniforme variate. Plot the histogram and the density. 2) The Poisson distribution P(lambda) is connected to the exponential distr

[R] How to keep the command 'R CMD INSTALL -l' running, even when some error is encountered?

2011-08-22 Thread thmsfuller...@gmail.com
Hi, 'R CMD INSTALL -l' will stop if some error is encountered. I don't find in the manual an option to keep the command running. Is there such an option? -- Tom __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] CDFs

2011-08-22 Thread R. Michael Weylandt
On Mon, Aug 22, 2011 at 7:17 PM, David Winsemius wrote: > > On Aug 22, 2011, at 6:26 PM, R. Michael Weylandt wrote: > > >> >> On Mon, Aug 22, 2011 at 4:57 PM, David Winsemius >> wrote: >> >> On Aug 22, 2011, at 4:34 PM, David Winsemius wrote: >> >> >> On Aug 22, 2011, at 3:50 PM, R. Michael Weyla

Re: [R] Duplicate Rows in xts

2011-08-22 Thread R. Michael Weylandt
Without example code or data I can't guarantee this is your problem, but have you looked at using xts(...,unique = F) instead of the default true. Alternatively, let us see what your data actually looks like to R (dput) and we'll help. But what you've got sounds like a problem in the date format,

Re: [R] Sequence

2011-08-22 Thread R. Michael Weylandt
Two general R tips: 1) Don't name variables seq or var. These are two really important R functions and you can get all sorts of unexpected craziness if you overload them. Going forward, also watch out for t,c, T, F as well. 2) As others have noted, it's very possible to implement this without an

Re: [R] Efficiency of random and fixed effects estimator

2011-08-22 Thread Bert Gunter
Daniel: Your question should be addressed to R-sig-mixed-models, as it really does not belong on r-help. -- Bert On Mon, Aug 22, 2011 at 5:11 PM, Daniel Malter wrote: > Small bugs in my simulated data (corrected code below). However, that does > not affect my question: > > id<-rep(c(1:100),eac

Re: [R] Sequence

2011-08-22 Thread Claudio Zanettini
I definitely used too much lines s of code because I still don't know how to do some staff. but it works: seq=5 #starting value var=5# starting value long= 1:10 # length of the vector for (x in long){ var=var+((var/100)*40) seq=append(seq,var) } seq=round(seq) seq=cums

Re: [R] Sequence

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 9:53 PM, Claudio Zanettini wrote: > Thanks guys, > I did not know the fun cumsum > I will work on that. A very compact method would be: cumsum( round(1.4^(0:20)*rep(5, 21)) ) (And I was wrong about it increasing more rapidly if it had been in hte mamer I imagined.) -- D

Re: [R] Change Variable Labels in Quantile Plot

2011-08-22 Thread Roger Koenker
It should be possible to say plot(..., xlab = "foo", ylab = "bar") ) if not please let me know. Roger Koenker rkoen...@illinois.edu On Aug 22, 2011, at 9:00 PM, Kitty Lee wrote: I have spent hours on this ---looked through the quantreg manual and r-help site--- still couldn't figure ou

[R] Change Variable Labels in Quantile Plot

2011-08-22 Thread Kitty Lee
I have spent hours on this ---looked through the quantreg manual and r-help site--- still couldn't figure out the answer. Can someone please help me on this? I plot the result from quantile regression and want to change the variable labels: temp<-rq(dep~inc+age50, data=newdata, tau=1:9/10)

Re: [R] Sequence

2011-08-22 Thread Claudio Zanettini
Thanks guys, I did not know the fun cumsum I will work on that. HVZ 2011/8/22 David Winsemius > > On Aug 22, 2011, at 8:36 PM, Claudio Zanettini wrote: > > Hello everyone, >> I would like to generate a sequence >> such as, starting from 5, every value is >> 40% of the value before+ all the pr

Re: [R] Sequence

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 8:36 PM, Claudio Zanettini wrote: Hello everyone, I would like to generate a sequence such as, starting from 5, every value is 40% of the value before+ all the preceeding values. es: this is the seq of all the value+40% of the preceding value: 5 7101

Re: [R] Linear Regression with 2 grouping variables

2011-08-22 Thread Weidong Gu
You can do something like this sp<-split(dat, list(dat$Vial,dat$Site)) seq.model<-lapply(sp, function(x) lm(x$InRFU~x$Time)) Then, extract whatever you want from seq.model Weidong Gu On Mon, Aug 22, 2011 at 9:15 PM, Nathan Miller wrote: > Hi all, > > I have a data set that looks a bit li

[R] Linear Regression with 2 grouping variables

2011-08-22 Thread Nathan Miller
Hi all, I have a data set that looks a bit like this. feed1 RFU Site Vial Time lnRFU 1 811 10 10.702075 2 4752111 20 10.768927 3 4290511 30 10.66674 4 4686711 40 10.755069 5 4299511 50 10.668839 6 4307411

Re: [R] Sequence

2011-08-22 Thread Jorge I Velez
?cumsum cumsum(yoursequence) HTH, Jorge On Mon, Aug 22, 2011 at 8:36 PM, Claudio Zanettini <> wrote: > Hello everyone, > I would like to generate a sequence > such as, starting from 5, every value is > 40% of the value before+ all the preceeding values. > es: > this is the seq of all the valu

[R] Duplicate Rows in xts

2011-08-22 Thread Muhammad Abuizzah
I read enourmous comment about this questions stating that it was answered before.  I have been looking for the answer for a week without luck !!!  I searched the archives the xts. vignitte , googled for an answer but couldn't find one so her it is:   the Vignette states that xts "doesn't inforc

[R] Sequence

2011-08-22 Thread Claudio Zanettini
Hello everyone, I would like to generate a sequence such as, starting from 5, every value is 40% of the value before+ all the preceeding values. es: this is the seq of all the value+40% of the preceding value: 5 71014192738 5374 103

Re: [R] Efficiency of random and fixed effects estimator

2011-08-22 Thread Daniel Malter
Small bugs in my simulated data (corrected code below). However, that does not affect my question: id<-rep(c(1:100),each=2) obs<-rep(c(0:1),100) d<-rep(sample(c(-1,1),100,replace=T),each=2) base.happy<-rep(rnorm(100),each=2) happy<-base.happy+1.5*d*obs+rnorm(200) data<-data.frame(id,obs,d,happy)

[R] Efficiency of random and fixed effects estimator

2011-08-22 Thread Daniel Malter
Hi all, I am statistically confused tonight. When the assumptions to a random effects estimator are warranted, random effects should be the more efficient estimator than the fixed effects estimator because it uses fewer degrees of freedom (estimating just the variance parameter of the normal rathe

Re: [R] Threads in R

2011-08-22 Thread Peter Langfelder
On Mon, Aug 22, 2011 at 3:12 PM, Immanuel wrote: > Hello, > > thanks for the input. Below is a small example, simpler then expected :) >  I'm just curious why I can't see any output from print(i). > > -- > library(multicore) > > f_long <- function() { >    for (i in 1:1

Re: [R] CDFs

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 6:26 PM, R. Michael Weylandt wrote: On Mon, Aug 22, 2011 at 4:57 PM, David Winsemius > wrote: On Aug 22, 2011, at 4:34 PM, David Winsemius wrote: On Aug 22, 2011, at 3:50 PM, R. Michael Weylandt wrote: Yes. The xCDF/yCDF objects that are returned by the ecdf function

[R] Package Installation in osx

2011-08-22 Thread Ehsan Karim
Dear List: Wondering how to get around the following problem: any suggestions are welcome. Cheers, Ehsan > install.packages("geepack")Warning in install.packages("geepack") :  argument > 'lib' is missing: using '/home/grad/student/Library/R/2.11/library'--- Please > select a CRAN mirror for u

Re: [R] looping with paste

2011-08-22 Thread Rolf Turner
As Sarah has said, you probably don't need to use "paste()" at all. However if "command" is a text string containing a (syntactically correct) R command you can execute it via eval(parse(text=command)) E.g.: command <- "x <- 42" eval(parse(text=command)) x [1] 42 I find t

[R] Time series and ggplot2

2011-08-22 Thread ashz
Hi, I made a time-series plot using ggplot. All the points are shown in the graph but unfortunately it does not display all the months in the graph X-axis text/labels but only one month per year. Furthermore, the data contain some NA as not all the month as Y values. Therefore, how can I displ

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Sébastien Vigneau
Thank you for your answer! I have two additional questions, in line with the previous one: 1. how can I obtain tick marks flanking the labels, instead of being aligned with them (similar to the pipe symbols on my example)? 2. how can I obtain tick marks of different sizes, so that the ma

Re: [R] CDFs

2011-08-22 Thread R. Michael Weylandt
On Mon, Aug 22, 2011 at 4:57 PM, David Winsemius wrote: > > On Aug 22, 2011, at 4:34 PM, David Winsemius wrote: > > >> On Aug 22, 2011, at 3:50 PM, R. Michael Weylandt wrote: >> >> Yes. The xCDF/yCDF objects that are returned by the ecdf function can be >>> called like functions. >>> >> >> Becaus

Re: [R] Threads in R

2011-08-22 Thread Immanuel
Hello, thanks for the input. Below is a small example, simpler then expected :) I'm just curious why I can't see any output from print(i). -- library(multicore) f_long <- function() { for (i in 1:1){ a=i} print(i) return("finished") } p_long <- para

Re: [R] Counting Elements Conditionally

2011-08-22 Thread Edward Patzelt
that is exactly correct, assuming we did not start at the beginning, but started at the first transition (this is the correct way to think about it) On Mon, Aug 22, 2011 at 4:08 PM, Jean V Adams wrote: > > So, using the full data set, what should the result look like? > > c(NA, NA, NA, 3, NA

Re: [R] Counting Elements Conditionally

2011-08-22 Thread Jean V Adams
So, using the full data set, what should the result look like? c(NA, NA, NA, 3, NA,NA, NA, 2) ? Jean Edward Patzelt wrote on 08/22/2011 03:58:38 PM: > [image removed] > > Re: [R] Counting Elements Conditionally > > Edward Patzelt > > to: > > Jean V Adams > > 08/22/2011 03:58

Re: [R] CDFs

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 4:34 PM, David Winsemius wrote: On Aug 22, 2011, at 3:50 PM, R. Michael Weylandt wrote: Yes. The xCDF/yCDF objects that are returned by the ecdf function can be called like functions. Because they _are_ functions. > "function" %in% class(xCDF) [1] TRUE > is.function(

Re: [R] Counting Elements Conditionally

2011-08-22 Thread Edward Patzelt
after it sees the first occurrence of 0 in FF following a transition, I want it to ignore all further elements until the next transition. On Mon, Aug 22, 2011 at 3:58 PM, Edward Patzelt wrote: > Awesome, this is close, couple changes. Below is full data set for 1 > person. I want the code to l

Re: [R] Counting Elements Conditionally

2011-08-22 Thread Edward Patzelt
Awesome, this is close, couple changes. Below is full data set for 1 person. I want the code to look at the first time it sees a 0 in FF after the transition in Rev. I then want it to test whether bin is also a 0. If and only if this is the first 0 in FF after the transition, and bin = 0, then

Re: [R] Counting Elements Conditionally

2011-08-22 Thread Jean V Adams
> Re: [R] Counting Elements Conditionally > Jean V Adams > to: > Edward Patzelt > 08/22/2011 03:53 PM > > > [R] Counting Elements Conditionally > > Edward Patzelt > > to: > > r-help > > 08/22/2011 02:33 PM > > > > R - > > > > I have 3 variables with data below. Variable "Rev" is a vector that

Re: [R] Counting Elements Conditionally

2011-08-22 Thread Jean V Adams
> [R] Counting Elements Conditionally > Edward Patzelt > to: > r-help > 08/22/2011 02:33 PM > > R - > > I have 3 variables with data below. Variable "Rev" is a vector that changes > from 1 to 2, 2 to 3, etc Variable "FF" is a binary variable with 1's > and 0's. Variable "bin" is a diffe

Re: [R] looping with paste

2011-08-22 Thread Sarah Goslee
Juta, On Mon, Aug 22, 2011 at 4:29 PM, Juta Kawalerowicz wrote: > Dear list, > > I have a spacialPolygonDataFrame where variables were unnecessarily imported > as factors. So I am trying to unfactor variables from > spatialPolygonDataFrame@data with a loop > > > for (i in (1:length(names( spati

Re: [R] Selecting cases from matrices stored in lists

2011-08-22 Thread mdvaan
Thanks Jean, changing c[[t]] to c[[year]] solved the issue. Math Jean V Adams wrote: > >> Re: [R] Selecting cases from matrices stored in lists >> mdvaan >> to: >> r-help >> 08/22/2011 09:46 AM >> >> Jean V Adams wrote: >> > >> >> [R] Selecting cases from matrices stored in lists >> >> mdvaa

[R] looping with paste

2011-08-22 Thread Juta Kawalerowicz
Dear list, I have a spacialPolygonDataFrame where variables were unnecessarily imported as factors. So I am trying to unfactor variables from spatialPolygonDataFrame@data with a loop for (i in (1:length(names( spatialPolygonDataFrame{ command<-paste("spatialPolygonDataF

Re: [R] CDFs

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 3:50 PM, R. Michael Weylandt wrote: Yes. The xCDF/yCDF objects that are returned by the ecdf function can be called like functions. Because they _are_ functions. > "function" %in% class(xCDF) [1] TRUE > is.function(xCDF) [1] TRUE For example: x = rnrom(50); xCDF = e

Re: [R] Threads in R

2011-08-22 Thread Peter Langfelder
On Mon, Aug 22, 2011 at 12:39 PM, Immanuel wrote: > Hello all, > > I posted a questions on how to terminate a function call that does not > return after a certain time ( I can not modify the function code) some > time ago. > Since I didn't find a solution I just came up with the idea to run the >

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Sébastien Vigneau
Thanks! Sebastien On Mon, Aug 22, 2011 at 2:11 PM, Marc Schwartz wrote: > On Aug 22, 2011, at 12:14 PM, Sébastien Vigneau wrote: > > > Hi, > > > > I would like to draw a stacked bar chart with four bars (say "a", "b", > "c", > > "d") . Two bars belong to group A and the two others to group B. >

Re: [R] CDFs

2011-08-22 Thread R. Michael Weylandt
Yes. The xCDF/yCDF objects that are returned by the ecdf function can be called like functions. For example: x = rnrom(50); xCDF = ecdf(x); xCDF(0.3) # This value tells you what fraction of x is less than 0.3 You can also assign this behavior to a function: F <- function(z) { xCDF(z) } F does

Re: [R] I have a problem with R!!

2011-08-22 Thread David L Carlson
When you read Excel data from the Windows clipboard, the delimiter is a tab, not a comma. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Original Message- From: r-help-boun...@r-proj

[R] Threads in R

2011-08-22 Thread Immanuel
Hello all, I posted a questions on how to terminate a function call that does not return after a certain time ( I can not modify the function code) some time ago. Since I didn't find a solution I just came up with the idea to run the functions call in a separate thread who I could terminate a wil

Re: [R] Problem with xtable

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 3:18 PM, ea819 wrote: Dear all, I am having trouble creating LaTex tables using the xtable command. I am using the bayesm package to analyse data. However, I am unable to generate LaTex tables converting the output from summary(out$deltadraws.) I have made several att

[R] Counting Elements Conditionally

2011-08-22 Thread Edward Patzelt
R - I have 3 variables with data below. Variable "Rev" is a vector that changes from 1 to 2, 2 to 3, etc Variable "FF" is a binary variable with 1's and 0's. Variable "bin" is a different binary variable with 1's and 0's. I want to calculate the number of elements: 1. Starting with the f

[R] Problem with xtable

2011-08-22 Thread ea819
Dear all, I am having trouble creating LaTex tables using the xtable command. I am using the bayesm package to analyse data. However, I am unable to generate LaTex tables converting the output from summary(out$deltadraws.) I have made several attempts using xtable but have been unsuccessful and re

Re: [R] CDFs

2011-08-22 Thread R. Michael Weylandt
Number 1 can be done as follows: x = rnorm(50); y = rnorm(50) xCDF = ecdf(x); yCDF = ecdf(y) plot(xCDF) lines(yCDF,col=2) For the other ones, you are going to have to be a little more specific as to how you want to do the approximation...but ?density might be a place to start for #4, assuming yo

Re: [R] CDFs

2011-08-22 Thread Jim Silverton
Hello all, I have two columns of numbers. I would like to do the following: (1) Plot both cdfs, F1 and F2 on the same graph. (2) Find smoothed approximations of F1 and F2 lets call them F1hat and F2hat (3) Find values for F1hat when we substitue a value of x in it. (4) Find the corresponding densi

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Marc Schwartz
On Aug 22, 2011, at 12:14 PM, Sébastien Vigneau wrote: > Hi, > > I would like to draw a stacked bar chart with four bars (say "a", "b", "c", > "d") . Two bars belong to group A and the two others to group B. Therefore, > I would like to have, on the x-axis, a label for each bar and an additional

Re: [R] Extracting columns with specific string in their names

2011-08-22 Thread David Winsemius
On Aug 22, 2011, at 1:45 PM, Dennis Murphy wrote: Hi: You need a leading ^ in your grep string. Here's a reproducible example to illustrate: df <- data.frame(Xyz1 = rnorm(5), Xyz2 = rnorm(5), Xyz3 = rnorm(5), Abc1 = rnorm(5), Abc2 = rnorm(5)) df[, grep('^Xyz', names(df))] df[

Re: [R] Two-levels labels on x-axis?

2011-08-22 Thread Joshua Wiley
Hi Sébastien, Not sure about an elegant, general way but here is something quick and dirty: p <- barplot(matrix(1:8, 2)) axis(1, at = p, labels = letters[1:4]) axis(1, at = c(mean(p[1:2]), mean(p[3:4])), labels = paste("\n", LETTERS[1:2]), padj = 1) Cheers, Josh On Mon, Aug 22, 2011 at 10:14

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
Thanks, Michael! You have an heart of gold! Appreciated! On Mon, Aug 22, 2011 at 10:53 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > The different lengths work because R recycles values whenever you try to do > a binary operation on things of different lengths: in essence, R co

[R] Two-levels labels on x-axis?

2011-08-22 Thread Sébastien Vigneau
Hi, I would like to draw a stacked bar chart with four bars (say "a", "b", "c", "d") . Two bars belong to group A and the two others to group B. Therefore, I would like to have, on the x-axis, a label for each bar and an additional label for each group, positioned underneath. To give an idea, the

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread R. Michael Weylandt
The different lengths work because R recycles values whenever you try to do a binary operation on things of different lengths: in essence, R copies 10 however many times needed to make something that has the right length for an elementwise comparison with x.** If you did something like x != c(1,1

Re: [R] Extracting columns with specific string in their names

2011-08-22 Thread Dennis Murphy
Hi: You need a leading ^ in your grep string. Here's a reproducible example to illustrate: df <- data.frame(Xyz1 = rnorm(5), Xyz2 = rnorm(5), Xyz3 = rnorm(5), Abc1 = rnorm(5), Abc2 = rnorm(5)) df[, grep('^Xyz', names(df))] df[, grep('^Abc', names(df))] HTH, Dennis On Mon, Aug

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
HI, Michael, Sorry for my numb, I have one more question. When you use function(x){any (x != 10), here x is a vector, x!=10 will give a vector of logical value, right? If it is, how can vector be compared to a scale, 10 in this case? Thanks! On Mon, Aug 22, 2011 at 10:16 AM, R. Michael Weyl

Re: [R] Calculating p-value for 1-tailed test in a linear model

2011-08-22 Thread Albyn Jones
For H_0: beta >= 0, then the correct p-value is pt(tvalue,df) regardless of the sign of tvalue. Negative tvalues of large magnitude will yield small p-values. albyn On Mon, Aug 22, 2011 at 05:22:06PM +, Ben Bolker wrote: > Campomizzi, Andrew J neo.tamu.edu> writes: > > > On 20/0

Re: [R] automatic file input

2011-08-22 Thread Ista Zahn
On Mon, Aug 22, 2011 at 1:25 PM, Bansal, Vikas wrote: > Because i have to use the value of i in for loop also.example- > >  for(i in 1:100){ > >  df=read.table($i.out,fill=T,colClasses = "character") > if(i<=50){ >  df$V6 <- sapply(df$V6, function(a) >  paste(as.integer(charToRaw(a)), collapse = '

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
THANKS SO MUCH, Michael! Appreciated! On Mon, Aug 22, 2011 at 10:16 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > This isn't the most beautiful code, but I think it should work for you: > > # Some sample data > M = > cbind(matrix(rnorm(10),ncol=2),matrix(sample(c(10,1),15,repl

Re: [R] automatic file input

2011-08-22 Thread Bansal, Vikas
Because i have to use the value of i in for loop also.example- for(i in 1:100){ df=read.table($i.out,fill=T,colClasses = "character") if(i<=50){ df$V6 <- sapply(df$V6, function(a) paste(as.integer(charToRaw(a)), collapse = ' '))} else{ df$V5 <- sapply(df$V6, function(a) paste(as.integer(c

Re: [R] Calculating p-value for 1-tailed test in a linear model

2011-08-22 Thread Ben Bolker
Campomizzi, Andrew J neo.tamu.edu> writes: > On 20/08/11 10:20, Andrew Campomizzi wrote: > > Hello, > > > > I'm having trouble figuring out how to calculate a p-value for a 1-tailed > > test of beta_1 in a linear model fit using command lm. My model has only 1 > > continuous, predictor variable.

Re: [R] email with authentication

2011-08-22 Thread Ben Bolker
Ben qant gmail.com> writes: > > Hello, > > I'd like to send an email from R using Windows Outlook. > The sendmailR package doesn't allow for authentication (usernames and > passwords). I don't know about Outlook, but you can try install.packages("Rmail",repos="http://www.math.mcmaster.ca/bo

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread R. Michael Weylandt
This isn't the most beautiful code, but I think it should work for you: # Some sample data M = cbind(matrix(rnorm(10),ncol=2),matrix(sample(c(10,1),15,replace=T),ncol=3)) colnames(M) = c("Thing1","Thing2",paste("array",1:3,sep="")) colsToCheck = grepl("array",colnames(M)) # Isolate the "array" co

Re: [R] automatic file input

2011-08-22 Thread Ista Zahn
Why don't you just use list.files() and iterate over the result in your for loop? fileNames <- list.files(pattern = "\\.out") myFiles <- list() for(i in fileNames) { myFiles[[i]] <- read.table(i, fill=T,colClasses = "character") } ? Best, Ista On Mon, Aug 22, 2011 at 12:34 PM, Bansal, Vikas w

Re: [R] Reading DESCRIPTION files to create dependency diagram

2011-08-22 Thread Uwe Ligges
On 22.08.2011 18:43, Rainer M Krug wrote: Hi I want to create a dependence diagram of a subset of the packages on CRAN and would therefore like to read the DEACRIPTION files into a list. The list should be as follow for each package: - package name: list - Package: character - Version:

Re: [R] Convert week value to date

2011-08-22 Thread Folkes, Michael
Here is my solution to produce a date value if your data set only has week values associated with data (ie no date). It gives the first monday of the week. Michael Folkes s <- seq(as.Date("2010-01-01"), as.Date("2010-12-31"), by = "day") #produce all days of the year series.

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
HI, Michael, What I want to do is remove all the rows, for which array1, array2, ..array15 are all equal to 10. I want to keep all the rows at least one of the array variables are not equal to 10. sorry for the confusion. On Mon, Aug 22, 2011 at 9:52 AM, R. Michael Weylandt < michael.weyla..

[R] email with authentication

2011-08-22 Thread Ben qant
Hello, I'd like to send an email from R using Windows Outlook. The sendmailR package doesn't allow for authentication (usernames and passwords). Is there any other way to do this? From the Windows command line? Right now I am using a .bat file to send an email via a program called Blat. I'd like

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread R. Michael Weylandt
"I want to select the array columns that are not equal to 10." is ambiguous to me. Just to clarify, do you want to simply drop the column named array10 or do you want to check each column for having one/all 10's as values and drop based on that test? Michael On Mon, Aug 22, 2011 at 12:35 PM, Cha

[R] Reading DESCRIPTION files to create dependency diagram

2011-08-22 Thread Rainer M Krug
Hi I want to create a dependence diagram of a subset of the packages on CRAN and would therefore like to read the DEACRIPTION files into a list. The list should be as follow for each package: - package name: list - Package: character - Version: character - Date: character - ... - Depend

Re: [R] automatic file input

2011-08-22 Thread Bansal, Vikas
Dear Ista I have searched about the problem and came to know that we can make a list of our file names.But the thing is I am using this code- define<- function() { repeat{ hojy=readline("Enter the name of your file: ") if(file.exists(hojy)==T) {return(hojy) break} else print("File does not

Re: [R] test if vector contains elements of another vector (disregarding the position)

2011-08-22 Thread Henrique Dallazuanna
Try this: i %in% j * 1 On Mon, Aug 22, 2011 at 12:51 PM, Martin Batholdy wrote: > Hi, > > > I have the following problem: > > > I have two vectors: > > i <- c('a','c','g','h','b','d','f','k','l','e','i') > > j <- c('a', 'b', 'c') > > > > now I would like to generate a vector with the length of i

[R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
Dear R community, I have a data set like the following: probe_name chr_id position array1 array2 array3 array4 array5 array6 array7 1C-3 10 16566949 10 10 10 10 10 10 10 2C-3AAAB 17 33478940 10 10 10 10 10 10 10 3C-3AAAC

Re: [R] Multiple regression in R - unstandardised coefficients a

2011-08-22 Thread Ted Harding
On 22-Aug-11 15:37:40, JC Matthews wrote: > Hello, > > I have a statistical problem that I am using R for, but I am > not making sense of the results. I am trying to use multiple > regression to explore which variables (weather conditions) > have the greater effect on a local atmospheric variable.

Re: [R] automatic file input

2011-08-22 Thread Ista Zahn
Hi Vikas, please do make an effort to search for the answer before posting. A google search for "R read multiple files" will give you everything you need. Best, Ista On Mon, Aug 22, 2011 at 12:08 PM, Bansal, Vikas wrote: > Dear all, > > I have 100 files which are used as input.and I have to inpu

Re: [R] Extracting columns with specific string in their names

2011-08-22 Thread Jay
Sorry, my mistake. The thing is that the command return no results at all. However, when I just tried a simpler version of this (I had no capital letters or no spaces in the string), it worked fine. I cant figure it out, I think it all boils down to the fact that I'm no expert at regexp's... On

[R] automatic file input

2011-08-22 Thread Bansal, Vikas
Dear all, I have 100 files which are used as input.and I have to input the name of my files again and again.the name of the files are 1.out, 2.out..100.out. I want to know if there is anything like perl so that i can use something like this- for($f = 1; $f <= 100; $f++) { $file = $f.".o

Re: [R] Multiple regression in R - unstandardised coefficients are a different sign to standardised coefficients, is this correct?

2011-08-22 Thread Ista Zahn
Hi JC, You have interactions in your model, which means that your models specifies that the coefficients for hum, wind, and rain should vary depending on the value of the other two (and depending on their own value actually, since you also have quadratic effects for each of these variables in your

Re: [R] Ignoring loadNamespace errors when loading a file

2011-08-22 Thread Allan Engelhardt
On 22/08/11 12:26, Martin Morgan wrote: On 08/21/2011 11:52 PM, Allan Engelhardt wrote: [...] Obligatory reproducible example: On the Unix machine do library("multicore") a <- list(data = 1:10, fun = mclapply) save(a, file = "a.RData") and then try to load the "a.RData" file on Windows. The

Re: [R] test if vector contains elements of another vector (disregarding the position)

2011-08-22 Thread R. Michael Weylandt
%in% Here, i %in% j Hope this helps, Michael On Mon, Aug 22, 2011 at 11:51 AM, Martin Batholdy wrote: > Hi, > > > I have the following problem: > > > I have two vectors: > > i <- c('a','c','g','h','b','d','f','k','l','e','i') > > j <- c('a', 'b', 'c') > > > > now I would like to generate a ve

[R] test if vector contains elements of another vector (disregarding the position)

2011-08-22 Thread Martin Batholdy
Hi, I have the following problem: I have two vectors: i <- c('a','c','g','h','b','d','f','k','l','e','i') j <- c('a', 'b', 'c') now I would like to generate a vector with the length of i that has zeros where i[x] != any element of j and 1 where i[x] == any element of j. So for the examp

[R] Multiple regression in R - unstandardised coefficients are a different sign to standardised coefficients, is this correct?

2011-08-22 Thread JC Matthews
Hello, I have a statistical problem that I am using R for, but I am not making sense of the results. I am trying to use multiple regression to explore which variables (weather conditions) have the greater effect on a local atmospheric variable. The data is taken from a database that has 20391

[R] Edit 2

2011-08-22 Thread RobinLovelace
Sorry to anyone who tried but failed to download the data - seems not to be there. Here's a new link to it please take a look. http://ubuntuone.com/p/1C6U/ -- View this message in context: http://r.789695.n4.nabble.com/Histogram-from-frequency-data-in-pre-made-bins-tp3758198p3760458.html Sent f

Re: [R] Selecting cases from matrices stored in lists

2011-08-22 Thread Jean V Adams
> Re: [R] Selecting cases from matrices stored in lists > mdvaan > to: > r-help > 08/22/2011 09:46 AM > > Jean V Adams wrote: > > > >> [R] Selecting cases from matrices stored in lists > >> mdvaan > >> to: > >> r-help > >> 08/22/2011 07:24 AM > >> > >> Hi, > >> > >> I have two lists (c and h

Re: [R] pooled hazard model with aftreg and time-dependent variables

2011-08-22 Thread JPF
In STATA, multiple observations correspond to the same individual, the cluster( ) option can be employed to request that the analysis be clustered by individual. Any suggestion with aftreg? Thanks, J -- View this message in context: http://r.789695.n4.nabble.com/pooled-hazard-model-with-af

Re: [R] How to add horizontal lines above bar graph to display p-values?

2011-08-22 Thread Sébastien Vigneau
Thanks! Sebastien 2011/8/20 Uwe Ligges > > > On 19.08.2011 22:27, Sébastien Vigneau wrote: > >> Hi, >> >> I would like to draw horizontal lines above a bar graph, in order to >> display >> the p-values of a Fisher test. Here is an >> example> cit

Re: [R] lattice to ggplot2 conversion help

2011-08-22 Thread Ista Zahn
Hi Ashz, On Mon, Aug 22, 2011 at 8:42 AM, ashz wrote: > Hi, > > I am interested in ggplot2 and I found this lattice code very interesting > (http://addictedtor.free.fr/graphiques/graphcode.php?graph=48). > > Code: > library(lattice) > lattice.options(default.theme = canonical.theme(color = FALSE)

Re: [R] Selecting cases from matrices stored in lists

2011-08-22 Thread Gabor Grothendieck
On Mon, Aug 22, 2011 at 9:07 AM, Jean V Adams wrote: >> [R] Selecting cases from matrices stored in lists >> mdvaan >> to: >> r-help >> 08/22/2011 07:24 AM >> >> Hi, >> >> I have two lists (c and h - see below) containing matrices with similar >> cases but different values. I want to split these m

  1   2   >