[R] Rd file processing suggestion - % sign in examples

2011-04-18 Thread Peter Langfelder
Hi folks, I have come across a simple quirk that took me a long time to figure out. The gist is that if I write, in the example section of an Rd file, the line c = a %*% b what R will see when running the example is c = a since the % signs are apparently considered comment signs even in the \e

[R] How to get the tuning parameter lamda in storey's qvalue package

2011-04-18 Thread Chee Chen
Dear All, In Storey's estimator of the proportion of true nulls, the estimator depends on the tuning parameter lamda. Suppose now that an estimator of this proportion has been obtained by the qvalue package, what is the lamda that corresponds to the estimate? How to get this lamda? Thanks, -Chee

Re: [R] splom, plotmath: how to add three lines of information with alignment?

2011-04-18 Thread baptiste auguie
On 19 April 2011 17:06, Marius Hofert wrote: > Dear Baptiste, > > thanks for your answer. > Unfortunately, I get the error "Error using packet 1 invalid 'times' > argument" when executing your code. Hmm... not sure where the problem is. > Oops, – sorry, my mistake. For this code to work you'll n

Re: [R] Way OT: Anyone know where to get data on relationship between education and salary

2011-04-18 Thread Mark Dalphin
Hi Paul, I don't have a good answer to your request, but you might find something looking around the US Department of Labor's site: "Overview of BLS Wage Data by Area and Occupation" (BLS = Bureau of Labor Statistics). http://www.bls.gov/bls/blswage.htm A quick glance doesn't show me "educat

Re: [R] Working with massive matrices in R

2011-04-18 Thread ancienthart
Are your matricies sparse? This package (or one of it's reverse dependencies/suggests) may help keep the memory down. http://cran.r-project.org/web/packages/SparseM/ Joal Heagney __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

[R] How to Extract Information from SIMEX Output

2011-04-18 Thread Tom La Bone
Below is a SIMEX object that was generated with the "simex" function from the "simex" package applied to a logistic regression fit. From this mountain of information I would like to extract all of the values summarized in this line: .. ..$ variance.jackknife: num [1:5, 1:4] 1.684 1.144 0.85 0.62

[R] Where did my packages go ?

2011-04-18 Thread eric
Running linux 10.04 ubuntu. Looks like Ubuntu automatically updated to version 2.13. I was running version 2.12 until today. But now I'm getting error messages when I use the require or library command and one of the packages I've downloaded in the past. For example: > require(quantmod) Loading

[R] apply lm.beta() to rlm object (robust regression)

2011-04-18 Thread robatok
Hello, I'm trying to do a regression analysis (multiple linear regression) and have to deal with a slight heteroscedascitiy in my data. I've read somewhere that it's possible to use the rlm (robust regression) out of the MASS package in such cases. Is it possible to apply the lm.beta method (f

[R] SQLDF syntax

2011-04-18 Thread new2R
Hi, I am new to R and trying to migrate from SAS. I am trying to use sqldf to create a new table from existed table and change some of the columns. I have table called DataOld with columns commodity, rate and total and I am trying to create new table called DataNew with columns commodity, ratenew

[R] Markov transition matrices , missing transitions for certain years

2011-04-18 Thread Abby_UNR
Hi all, I am working for nest box occupancy data for birds and would like to construct a Markov transition matrix, to derive transition probabilities for ALL years of the study (not separate sets of transition probabilities for each time step). The actual dataset I'm working with is 125 boxes over

[R] print.raw - but convert ASCII?

2011-04-18 Thread Matt Shotwell
Does anyone know if there is a simple way to print raw vectors, such that ASCII characters are printed for bytes in the ASCII range, and their hex representation otherwise? rawToChar doesn't work when we have something like c(0x00, 0x00, 0x44, 0x00). -Matt

[R] Which should I use? system.file() path.package() find.package()

2011-04-18 Thread Kevin Wright
For a package that I am creating, I have some files in the "inst" directory. In the package man pages, I want to have R code that accesses these files. As of R-2.13.0, it looks like I can use any of: system.file() path.package() find.package() There are some differences between these functions,

Re: [R] Define ylim in lattice plot based upon panel function output

2011-04-18 Thread Deepayan Sarkar
On Tue, Apr 19, 2011 at 7:38 AM, Sébastien Bihorel wrote: > Dear R-users, > > By default, the xyplot function automatically defines the axis ranges based > upon the content of y and x variables. However, when one includes some calls > to other panel. functions in the panel argument, the results >

[R] Define ylim in lattice plot based upon panel function output

2011-04-18 Thread Sébastien Bihorel
Dear R-users, By default, the xyplot function automatically defines the axis ranges based upon the content of y and x variables. However, when one includes some calls to other panel. functions in the panel argument, the results might be out of range and not show up in the final graphs (see lower e

Re: [R] Is there a better way to parse strings than this?

2011-04-18 Thread Chris Howden
Thanks for the explanation, I think I understand it now. So to paraphrase all your explanations To match "." in a regular expression then the string "\.\.\." needs to be passed to it. This tells it to escape the special meaning of ".". But in order to get the \ into the string being passed to the

[R] How to generate orthogonal matrix with less computational cost

2011-04-18 Thread Chee Chen
Dear All, I would like to ask a question on how to generate an orthogonal matrix with less computational complexity. Basically I know two ways of getting an orthogonal matrix: 1. via the QR decomposition 2. via the SVD Both are essentially the same. A friend of mine told me to use package Matri

Re: [R] multiple lines on multiple plots

2011-04-18 Thread James Annan
Thanks! I'd seen this sort of trick mentioned in places, but didn't twig what it did. This is exactly what I was looking for. James On 19/4/11 7:04 AM, Greg Snow wrote: tmp1<- par('usr') -- James D Annan jdan...@jamstec.go.jp Tel: +81-45-778-5618 (Fax 5707) Senior Scientist, Research Instit

[R] having trouble with "R CMD INSTALL"

2011-04-18 Thread Gene Leynes
Hello, I was having trouble passing in command line options when doing an package install earlier. >From An Introduction in R > In addition, you can > use25options > --arch=, --no-environ, --no-init-file, --no-site-file and --vanillabetw

Re: [R] Extract indices after comparing two vectors

2011-04-18 Thread Phil Spector
?which A <- c(1,2,3,4) B <- c(0,3,1,5) which(A [1] 4 - Phil Spector Statistical Computing Facility Department of Statistics UC Berk

[R] Extract indices after comparing two vectors

2011-04-18 Thread Chee Chen
Dear All, I would like to ask a question about how to locate the indices after comparing two numeric vectors. Say, I have, A <- c(1,2,3,4) and A <- c(0,3,1,5) and we cmpare: > idx <- A idx [1] FALSE TRUE FALSE TRUE Question 1: I would like to get a vector that stores the indices for entrie

Re: [R] Power Analysis

2011-04-18 Thread Albyn Jones
Yes, Richard Savage used to call this "inter ocular data"; the answer should leap up and strike you right between the eyes... albyn On Mon, Apr 18, 2011 at 05:23:05PM -0500, David Cross wrote: > It seems to me, with deltas this large (relative to the SD), that a > significance test is a moot poi

Re: [R] Power Analysis

2011-04-18 Thread David Cross
It seems to me, with deltas this large (relative to the SD), that a significance test is a moot point! David Cross d.cr...@tcu.edu www.davidcross.us On Apr 18, 2011, at 5:14 PM, Albyn Jones wrote: > First, note that you are doing two separate power calculations, > one with n=2 and sd = 1.19,

Re: [R] Working with massive matrices in R

2011-04-18 Thread jim holtman
It is probably contiguous memory, I always suggest that you have 3-4X memory than your largest object to ensure that you have room for copies that might be made. So make a request for about 50GB of memory. On Mon, Apr 18, 2011 at 4:10 PM, svrieze wrote: > Hello, > > I'm (eventually) attempting

[R] Predicting with a principal component regression model: "non-conformable arguments" error

2011-04-18 Thread Alison Callahan
Hello all, I have generated a principal components regression model using the pcr() function from the PLS package (R version 2.12.0). I am getting a "non-conformable arguments" error when I try to use the predict() function on new data, but only when I try to read in the new data from a separate

Re: [R] Power Analysis

2011-04-18 Thread Albyn Jones
First, note that you are doing two separate power calculations, one with n=2 and sd = 1.19, the other with n=3 and sd = 4.35. I will assume this was on purpose. Now... > power.t.test(n = 2, delta = 13.5, sd = 1.19, sig.level = 0.05) Two-sample t test power calculation n = 2

[R] Way OT: Anyone know where to get data on relationship between education and salary

2011-04-18 Thread Paul
I'm sorry for the way OT post, but here goes. I'm an informatics specialist, and R user. My wife is a secondary school maths teacher. My wife recently tried to explain to her class the link between education and potential salary, and I would love to be able to show this graphically, however,

Re: [R] multiple lines on multiple plots

2011-04-18 Thread Greg Snow
Going back to a previous graph does not automatically restore the coordinate system (as you noticed). But you can store that information (lot less info than your data in most cases) and reset it manually. Try: x<- 1:10 y<- (1:100)*3 par(mfcol=c(2,1)) plot(x) tmp1 <- par('usr') plot(y) tmp2 <-

Re: [R] splom, plotmath: how to add three lines of information with alignment?

2011-04-18 Thread baptiste auguie
Hi, Does this help? library(gridExtra) my.title = function(expressions) { grid.table(expressions, parse=TRUE, theme=theme.list(gpar.corefill = gpar(fill = NA, col = NA), core.just = "left")) } e = expression(alpha,"text", italic(italic), hat(beta), integral(f(x

Re: [R] Function for deleting variables with >=50% missing obs from a data frame

2011-04-18 Thread Rita Carreira
Thanks for the suggestion Daryl! I did have to include the exclamation point before mean, otherwise it selected the columns with the most missing observations. But it was really nice to see this flexibility in R. So my fix was dfQ<- dfQtemp[ , sapply(dfQtemp, function(x) !mean(is.na(x))>.6)] Tha

[R] A question regarding RFreak

2011-04-18 Thread James Shaw
I am using robreg.evol (part of the RFreak package) to fit models via least trimmed squares (LTS) regression and am encountering the following error message when attempting to access the coefficients: Error in fit1$coef : $ operator not defined for this S4 class. It appears to me that robreg.evol

[R] Power Analysis

2011-04-18 Thread Schatzi
I am trying to do a power analysis to get the number of replicas per treatment. If I try to get the power it works just fine: setn=c(2,3) sdx=c(1.19,4.35) power.t.test(n = setn, delta = 13.5, sd = sdx, sig.level = 0.05,power = NULL) If I go the other way to obtain the "n" I have problems. sdx=c(1

Re: [R] time dependent hazard ratios

2011-04-18 Thread array chip
Hi David, Thanks for sharing your thoughts. I agree on that. I only use this example to show how time dependent hazard ratios were generated, i.e. the time dependent hazard ratios can be generated by including an interaction term (with the time interval indicator variable) in the Cox model on r

Re: [R] splom, plotmath: how to add three lines of information with alignment?

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 4:43 PM, Marius Hofert wrote: Dear expeRts, I would like to create a scatter plot matrix with splom(). The lower panel should contain some additional information about the samples shown in the upper panel plot, see the splom() call below. Now two questions came up: (1)

Re: [R] time dependent hazard ratios

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 4:09 PM, array chip wrote: Sorry this is a re-post. I posted it last night, haven't heard from anyone, hope this moves the thread up a little and anyone can comment? My observation is that coefficients of 19 in Cox (or other exponential models) models generally indica

Re: [R] cairo device and locator on windows

2011-04-18 Thread Michael Lawrence
I will look into this. Michael On Sun, Apr 17, 2011 at 8:34 PM, Richard M. Heiberger wrote: > 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 th

[R] splom, plotmath: how to add three lines of information with alignment?

2011-04-18 Thread Marius Hofert
Dear expeRts, I would like to create a scatter plot matrix with splom(). The lower panel should contain some additional information about the samples shown in the upper panel plot, see the splom() call below. Now two questions came up: (1) The lower panels show "tau" and "alpha" on top of each

Re: [R] Alignment of lines within barplot bars

2011-04-18 Thread snowboarder101
Great, that seems to do it. I had found another post about the twoord.plot function, but it seems that one comes with its own set of difficulties. Thanks for the help! -- View this message in context: http://r.789695.n4.nabble.com/Alignment-of-lines-within-barplot-bars-tp2533115p3458555.html Sen

[R] Working with massive matrices in R

2011-04-18 Thread svrieze
Hello, I'm (eventually) attempting a singular value decomposition of a 3200 x 527829 matrix in R version 2.10.1. The script is as follows: ###-Begin Script here---### library(Matrix) snps <- 527829 ## Number of SNPs N <- 3200## Sample size y

Re: [R] Import dbf file

2011-04-18 Thread new2R
Thank you..david That helps me. -- View this message in context: http://r.789695.n4.nabble.com/Import-dbf-file-tp3458468p3458526.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

[R] time dependent hazard ratios

2011-04-18 Thread array chip
Sorry this is a re-post. I posted it last night, haven't heard from anyone, hope this moves the thread up a little and anyone can comment? Thanks! John - Forwarded Message From: array chip To: r-help@r-project.org Sent: Sun, April 17, 2011 11:33:32 PM Subject: time dependent hazard

Re: [R] as.formula doesn't want to take a phrase

2011-04-18 Thread Dimitri Liakhovitski
Makes sense, Marc - thanks a lot! On Mon, Apr 18, 2011 at 3:54 PM, Marc Schwartz wrote: > On Apr 18, 2011, at 2:44 PM, Dimitri Liakhovitski wrote: > >> Hello! >> >> I am trying to create a formula object using as.formula. But it's not >> working: >> >> examplephraze<-"for.my.example" >> myformul

Re: [R] as.formula doesn't want to take a phrase

2011-04-18 Thread Marc Schwartz
On Apr 18, 2011, at 2:44 PM, Dimitri Liakhovitski wrote: > Hello! > > I am trying to create a formula object using as.formula. But it's not working: > > examplephraze<-"for.my.example" > myformula<-as.formula(paste(examplephraze,"~group, sum, data=mydata",sep="")) > > What's the problem? > Than

Re: [R] "object read.dbf" is not found

2011-04-18 Thread Duncan Murdoch
On 11-04-18 3:01 PM, new2R wrote: Hi I am new to R. I am trying to import dbf file using read.dbf but getting error message "object read.dbf" is not found. Please help in this regard. You need to tell us what you did. See the notes at the bottom of R-help messages for the posting guide, tha

Re: [R] as.formula doesn't want to take a phrase

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 3:44 PM, Dimitri Liakhovitski wrote: Hello! I am trying to create a formula object using as.formula. But it's not working: examplephraze<-"for.my.example" myformula<-as.formula(paste(examplephraze,"~group, sum, data=mydata",sep="")) Too much stuff inside as.formul

Re: [R] using "aggregate" when variable names contain spaces

2011-04-18 Thread Dimitri Liakhovitski
That's great thanks a lot, David! On Mon, Apr 18, 2011 at 3:47 PM, David Winsemius wrote: > > On Apr 18, 2011, at 3:40 PM, Dimitri Liakhovitski wrote: > >> That's helpful, thanks! Unfortunately, I cannot refer to all of my >> variables to the left of tilda one by one - I have a lot of them. >> A

Re: [R] Comparing two lines - Ancova: lm or aov?

2011-04-18 Thread Dylan Beaudette
Analysis of covariance comes to mind, and it looks like you have already setup your data for that type of analysis. I can't speak on issues related to the different number of samples (maybe a place for mixed modeling?), but from the results below (from lm) it looks like you can conclude that the tw

Re: [R] using "aggregate" when variable names contain spaces

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 3:40 PM, Dimitri Liakhovitski wrote: That's helpful, thanks! Unfortunately, I cannot refer to all of my variables to the left of tilda one by one - I have a lot of them. Any way to get them in as a a bunch (somehow using mynames)? fmla <- as.formula(paste( paste("`",

[R] as.formula doesn't want to take a phrase

2011-04-18 Thread Dimitri Liakhovitski
Hello! I am trying to create a formula object using as.formula. But it's not working: examplephraze<-"for.my.example" myformula<-as.formula(paste(examplephraze,"~group, sum, data=mydata",sep="")) What's the problem? Thanks a lot! -- Dimitri Liakhovitski Ninah Consulting www.ninah.com

Re: [R] using "aggregate" when variable names contain spaces

2011-04-18 Thread Dimitri Liakhovitski
That's helpful, thanks! Unfortunately, I cannot refer to all of my variables to the left of tilda one by one - I have a lot of them. Any way to get them in as a a bunch (somehow using mynames)? Thanks! On Mon, Apr 18, 2011 at 3:34 PM, David Winsemius wrote: > > On Apr 18, 2011, at 3:19 PM, Dimitr

Re: [R] A question about "txtProgressBar" function

2011-04-18 Thread Greg Snow
If your loop is producing its own output then you probably should not use txtProgressBar, but you can use either winProgressBar (if on windows) or tkProgressBar (on all platforms, but need tcltk package). These open an additional window with the progress bar and any additional information that

Re: [R] Import dbf file

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 2:41 PM, new2R wrote: Hi I am new to R. I am trying to import dbf file using read.dbf but getting error message "object read.dbf is not found. The message suggests that you have not loaded the `foreign` package. Please help in this regard. ?require -- David Winse

Re: [R] using "aggregate" when variable names contain spaces

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 3:19 PM, Dimitri Liakhovitski wrote: Hello! my data set has many variables. Unfortuantely, many of those variables contain spaces in their names. I need advice on: how to refer to variable names in the formula for "aggregate". See example below: ### Generating example data

Re: [R] Alignment of lines within barplot bars

2011-04-18 Thread Greg Snow
Sorry I took so long to get back on this, I have been out of town. For your case you need to provide adjustments for both the x and y to updateusr, try this: library(TeachingDemos) tmp <- barplot(c(1.5,40),yaxt='n',names.arg=1:2,ylim=c(0,1.25*40)) axis(4) tmp2 <- par('usr') updateusr(tmp[1:2], t

[R] Comparing two lines - Ancova: lm or aov?

2011-04-18 Thread Anne Kirsten Bowser
Hello! I have measurements (length and volume) of fish collected in two years. I want to know if the the relationship between length and volume is the same for both years. The number of fish measured is different for each year. I don't know whether lm or aov is more appropriate to use. Here are t

Re: [R] URL Scan

2011-04-18 Thread jmsc
Ok thanks for the suggestion. I will look into that. On Mon, Apr 18, 2011 at 5:27 AM, Barry Rowlingson [via R] < ml-node+3457010-2013527485-230...@n4.nabble.com> wrote: > On Sun, Apr 17, 2011 at 11:56 PM, jmsc <[hidden > email]> > w

[R] "object read.dbf" is not found

2011-04-18 Thread new2R
Hi I am new to R. I am trying to import dbf file using read.dbf but getting error message "object read.dbf" is not found. Please help in this regard. Thank you -- View this message in context: http://r.789695.n4.nabble.com/object-read-dbf-is-not-found-tp3458409p3458409.html Sent from the R

[R] mcmc simulation

2011-04-18 Thread Peter Francis
Dear List, I am reading a method and am unsure how to do something similar, so have come here for advice! I have a observed value and a expected value generated from a null model. I am looking to see if observed - expected is significantly different from zero. So in the method in the paper it

[R] Import dbf file

2011-04-18 Thread new2R
Hi I am new to R. I am trying to import dbf file using read.dbf but getting error message "object read.dbf is not found. Please help in this regard. Thank you -- View this message in context: http://r.789695.n4.nabble.com/Import-dbf-file-tp3458366p3458366.html Sent from the R help mailing li

[R] using "aggregate" when variable names contain spaces

2011-04-18 Thread Dimitri Liakhovitski
Hello! my data set has many variables. Unfortuantely, many of those variables contain spaces in their names. I need advice on: how to refer to variable names in the formula for "aggregate". See example below: ### Generating example data set: mydate = rep(seq(as.Date("2008-12-01"), length = 3, by

Re: [R] no solution yet, please help: extract p-value from mixed model in kinship package

2011-04-18 Thread Juliet Hannah
Maybe the pedigree is not set up correctly. If this is the case, the kinship matrix will not be constructed correctly. I see that in this example, the diagonal terms differ. diag(kmat) lmekin runs fine for me, and I can extract p-values with: lmekinfit <- lmekin(...) pval <- lmekinfit$ctab

Re: [R] Avoiding loop

2011-04-18 Thread Filoche
Hi sire. This is exactly what I was looking for, thank you. With regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Avoiding-loop-tp3457963p3458152.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pr

[R] Fayez_how to make the colored panels in lattice xyplot

2011-04-18 Thread aziz4
Hi all, Consider I am want to lattice.xyplot following car's data for different brands and different gas mileages: car1 Toyota 40 car2 Toyota 38 car3 Honda 39 car4 Honda 32 car5 Honda 35 car6 Honda 32 car7 Mitsubishi 27 car8 Mitsubishi 34 car9 Mitsubishi 33 Now first I want to make three panel

Re: [R] Avoiding loop

2011-04-18 Thread Dennis Murphy
Hi: Try the expm package. Using your example, > R = A%*%B > for(i in 1:100) + { +R = R%*%B + } > R [,1] [,2] [,3] [,4] [,5] [1,] 9.934879e+47 1.098761e+48 8.868476e+47 7.071831e+47 6.071370e+47 [2,] 1.492692e+48 1.650862e+48 1.332468e+48 1.0625

Re: [R] Using jitter function with differing variable lengths

2011-04-18 Thread Don McKenzie
A reproducible example would really help here. On 17-Apr-11, at 7:11 PM, Danica Horrell wrote: 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

[R] package "sensitivity" - sobol2002 indices

2011-04-18 Thread Duarte Viana
Hello all, In the following example, one sobol index for one parameter (the first order index for parameter b) is larger than 1. Shouldn´t the indices have a range of [0,1]? # Code for a decoupled approach example: X1<-data.frame(a=runif(100,20,30),b=runif(100,0.1,0.5)) X2<-data.frame(a=runif(10

Re: [R] How to remove the double or single quote from a string (unquote?)?

2011-04-18 Thread Allan Engelhardt
This should be a FAQ: you are confusing the value with its printed representation. Try print(paste("V", 3:8, sep=""), quote=FALSE) to see that there are no quotes, and you may want to read up on help("as.formula", package="stats") which has the examples you are searching for. Allan On 18/

Re: [R] How to remove the double or single quote from a string(unquote?)?

2011-04-18 Thread Gerrit Eichner
Hi, Jing Jiang, maybe as.formula( paste( "V12 ~ V", i, sep = "")) inside the call to glm() does what you need. Hth -- Gerrit On Tue, 19 Apr 2011, JingJiang Yan wrote: Is there a function to get a string without a pair of quotes around it? I have several expressions like: glm(V12 ~ V3, f

Re: [R] altering identity column

2011-04-18 Thread Peter Ehlers
On 2011-04-18 06:15, Ben Bolker wrote: Bodnar Laszlo EB_HU erstebank.hu> writes: [snip snip ] So I have a transformed dataframe now including 10,000 obeservations (from 60,001 - to 70,000) and if you send "head(transformed_dataframe)" into R it looks like this: [snip]> Now is th

[R] How to remove the double or single quote from a string (unquote?)?

2011-04-18 Thread JingJiang Yan
Is there a function to get a string without a pair of quotes around it? I have several expressions like: glm(V12 ~ V3, family=binomial, data=df1) glm(V12 ~ V4, family=binomial, data=df1) ... glm(V12 ~ V8, family=binomial, data=df1) As you can see, the only differences among them are V3 ... V8. B

Re: [R] From nested loop to mclapply

2011-04-18 Thread Allan Engelhardt
Try help("expand.grid", package="base") for one way to create the combinations of (i,j) outside the loop, or perhaps vignette("nested", package="foreach") which does it "automatically" (rather: naturally). Allan On 18/04/11 16:53, Alaios wrote: Dear all, I am trying to find a decent way to sp

Re: [R] Print out data frames into neat images

2011-04-18 Thread Ista Zahn
Hi Santosh, There are at least three general possibilites: 1) latex (via xtable, Hmisc, r2lh, reporttools ...) 2) html (via xtable, r2lh, R2HTML, hwritter, HTMLUtils ...) 3) graphics (via gridExtra, tableplot ...) Best, Ista On Sun, Apr 17, 2011 at 11:46 PM, Santosh Srinivas wrote: > Hi Group,

Re: [R] altering identity column

2011-04-18 Thread jim holtman
row.names(transformed_dataframe) <- NULL 2011/4/18 Bodnar Laszlo EB_HU : > Hi there, > > I have a huge dataframe containing 70,000 observations. > > I have filtered this dataframe (let it's name be "transformed_dataframe") as > I wanted to select only those observations which are greater than or

Re: [R] qvalue

2011-04-18 Thread Peter Langfelder
On Mon, Apr 18, 2011 at 9:12 AM, Jim Silverton wrote: > I am using storey's qvalue package but I keep on getting errors. Why is > this? > >> qvalue(p, lambda=0.5)$pi0 > [1] "ERROR: p-values not in valid range." > Error in qvalue(p, lambda = 0.5)$pi0 : >  $ operator is invalid for atomic vectors S

Re: [R] heatmap.2 - change column & row locations; angle / rotate

2011-04-18 Thread Karl Brand
Hi Chakravarthy, [dont forget to Cc the list for useRs with the same Q.] If you're trying to reuduce the isze of your row or column labels, i think the following arguments of heatmap.2 {gplots} is what you want to adjust- 'cexCol' and 'cexRow'. Specifically on my question that you ask about,

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

2011-04-18 Thread Uwe Ligges
On 17.04.2011 19:29, Haillie wrote: 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, mc

Re: [R] Reorder a data frame according a column randomly reordered.

2011-04-18 Thread Uwe Ligges
On 18.04.2011 17:04, Mohammad Tanvir Ahamed wrote: Hello all , I have a data frame like this X1X2X3 11815 22916 331017 441118 551219 661320 771421 now i want to randomly reorder the variable X2 but the row element should be same as for example X1X2X3 12916 251219 331017 471421 561320 61815

Re: [R] Multiple Groups CFA in Lavaan

2011-04-18 Thread Uwe Ligges
On 18.04.2011 18:10, JTMajor wrote: Hello, I am trying to do a multiple groups CFA in lavaan and I get the following error message: Error in cov(data.obs, use = "pairwise") : 'x' is empty I'm not sure what this message is referring to, can anyone help me? PLEASE do read the posting guide

Re: [R] Using jitter function with differing variable lengths

2011-04-18 Thread Uwe Ligges
On 18.04.2011 04:11, Danica Horrell wrote: 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 sprea

[R] Multiple Groups CFA in Lavaan

2011-04-18 Thread JTMajor
Hello, I am trying to do a multiple groups CFA in lavaan and I get the following error message: Error in cov(data.obs, use = "pairwise") : 'x' is empty I'm not sure what this message is referring to, can anyone help me? Thanks -- View this message in context: http://r.789695.n4.nabble.com/Mul

[R] Avoiding loop

2011-04-18 Thread Filoche
Hi everyone. I'm using matrix product such as : #Generate some data NCols = 5 NRows = 5 A = matrix(runif(NCols*NRows), ncol=NCols) B = matrix(runif(NCols*NRows), ncol=NCols) #First calculation R = A%*%B for(i in 1:100) { R = R%*%B } I would like to know if it was possible to avoi

Re: [R] qvalue

2011-04-18 Thread Jim Silverton
I am using storey's qvalue package but I keep on getting errors. Why is this? > qvalue(p, lambda=0.5)$pi0 [1] "ERROR: p-values not in valid range." Error in qvalue(p, lambda = 0.5)$pi0 : $ operator is invalid for atomic vectors -- Thanks, Jim. [[alternative HTML version deleted]] __

[R] Reorder a data frame according a column randomly reordered.

2011-04-18 Thread Mohammad Tanvir Ahamed
Hello all ,  I have a data frame like this  X1X2X3 11815 22916 331017 441118 551219 661320 771421 now i want to randomly reorder the variable X2  but the row element should be same  as for example  X1X2X3 12916 251219 331017 471421 561320 61815 741118 how can i do that ?? Hint :  this could b

[R] From nested loop to mclapply

2011-04-18 Thread Alaios
Dear all, I am trying to find a decent way to speed up my code. So far I have used mclapply with really good results (parallel version of lapply). I have a nested loop that I would like to help me convert it to lapply for (i in seq(from=-1,to=1-2/ncol(sr),length=ncol(sr))){ for (j in s

Re: [R] (no subject)

2011-04-18 Thread Hadley Wickham
Yes, it's fixed and a new version of plyr has been pushed up to cran - hopefully will be available for download soon. In the meantime, I think you can fix it by running library(stats) before library(ggplot2). Hadley On Sun, Apr 17, 2011 at 3:51 PM, Bryan Hanson wrote: > Is there any news on thi

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

2011-04-18 Thread Peter Ehlers
On 2011-04-17 16:29, jim holtman wrote: 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.

Re: [R] how to extract options for a function call

2011-04-18 Thread fisken
thanks 2011/4/18 S Ellison : > > fisken 18/04/2011 14:56:56 >>> >>But what I want, >>is to extract the options associated with a parameter for a function. > > Try > ?formals > > S Ellison > > *** > This email and any attachments

Re: [R] Geographic distance between lat-long points in R?

2011-04-18 Thread Scott Chamberlain
Hi Curt, Thanks for the help. According to that blogpost you sent, I am using the function gcd.hf using the Haversine formula. I wrapped it up in a function called CalcDists so that I can get a distance matrix between N sites. I don't know much about calculating distances, so does this seem

Re: [R] how to extract options for a function call

2011-04-18 Thread Henrique Dallazuanna
Try this: For optim: eval(formals(optim)$method) For dist function: eval(body(dist)[[3]][[3]]) On Mon, Apr 18, 2011 at 10:56 AM, fisken wrote: > Hi, I'm having some difficulties formulating this question. > > But what I want, > is to extract the options associated with a parameter for a functi

Re: [R] how to extract options for a function call

2011-04-18 Thread S Ellison
>>> fisken 18/04/2011 14:56:56 >>> >But what I want, >is to extract the options associated with a parameter for a function. Try ?formals S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} ___

[R] Help with cleaning a corpus

2011-04-18 Thread vintersorg123
Hi! I created a corpus and I started to clean through this piece of code: txt <-tm_map(txt,removeWords, stopwords("spanish")) txt <-tm_map(txt,stripWhitespace) txt <-tm_map(txt,tolower) txt <-tm_map(txt,removeNumbers) txt <-tm_map(txt,removePunctuation) But something happpended: some of the docu

[R] how to extract options for a function call

2011-04-18 Thread fisken
Hi, I'm having some difficulties formulating this question. But what I want, is to extract the options associated with a parameter for a function. e.g. method = c("Nelder-Mead", "BFGS", "CG", "L-BFGS-B", "SANN") in the optim function. So I would like to have a vector with c("Nelder-Mead", "BFGS"

Re: [R] altering identity column

2011-04-18 Thread David Winsemius
On Apr 18, 2011, at 9:02 AM, Bodnar Laszlo EB_HU wrote: Hi there, I have a huge dataframe containing 70,000 observations. I have filtered this dataframe (let it's name be "transformed_dataframe") as I wanted to select only those observations which are greater than or equal to 60,001 regar

Re: [R] mapply to lapply

2011-04-18 Thread Andreas Borg
Hi Alex, sorry, I wasn't aware that sum does not work with listst. replace "lapply" with "sapply" or place the call in "unlist". Your second example does not work as you have to provide the additional arguments to the inner function in lapply: lapply(1:nrow(cells), function(rowInd, i, j), [

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Alaios
Thank you very much . That was really helpful. I will keep this email for future reference Regards --- On Mon, 4/18/11, Duncan Murdoch wrote: > From: Duncan Murdoch > Subject: Re: [R] Help me create a hyper-structure > To: "Alaios" > Cc: r-h...@stat.math.ethz.ch, "Ben Bolker" > Date: Monday,

Re: [R] Help me create a hyper-structure

2011-04-18 Thread Duncan Murdoch
On 18/04/2011 4:45 AM, Alaios wrote: It seems you were right. Now I can easily access my struct and substruct like this # all.str[[1]]] Gives access to the first struct of per.sr.struct which containts 101 times the xorder,yorder,estimation.sr # all.str[[1]][[2]] Gives access to the second subs

Re: [R] reporting lme results

2011-04-18 Thread Ben Bolker
Pennell, Tanya exeter.ac.uk> writes: > 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 |

Re: [R] Rsquared for anova

2011-04-18 Thread Dorien Herremans
Omg Dieter, thanks so much... I just had to q() and R... that solved it :-) excellent! finally got the R2 :-) On 18 April 2011 15:12, Ben Bolker wrote: > Dorien Herremans ua.ac.be> writes: > >> >> Thanks Dieter, >> >> Even if I use lm(), I get the following output: >> >> > summary(fit) >>      

Re: [R] altering identity column

2011-04-18 Thread Ben Bolker
Bodnar Laszlo EB_HU erstebank.hu> writes: > [snip snip ] > So I have a transformed dataframe now including 10,000 obeservations > (from 60,001 - to 70,000) and if you send > "head(transformed_dataframe)" into R it looks like this: [snip] > > Now is there a quick way to alter this indexin

Re: [R] (no subject)

2011-04-18 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 18.04.2011 14:32:11: > Hai, > > Where can i get the dataset votes.repub > Ram Use your favourite browser, put R votes.repub in its search facilities and you shall be lucky enough to get it from first several hits. If you have installed R you can star

Re: [R] (no subject)

2011-04-18 Thread Uwe Ligges
This is a bug in the very recent version of the plyr package. Its maintainer has been notified and promised an update. Uwe Ligges On 17.04.2011 22:51, Bryan Hanson wrote: 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.

  1   2   >