Re: [R] Help on loading "xlsx" package

2010-02-11 Thread Sharpie
Steven Kang wrote: > > Dear R users, > > > Im trying to load *"xlsx"* package which depends on *"xlsxjars"* and * > "rJava"* packages. > > All the 3 packages (zipped files) are installed successfully in windows. > > I have added "C:\Program Files\Java\jre1.6.0_03\bin\client" to the PATH > va

Re: [R] Help on loading "xlsx" package

2010-02-11 Thread Dieter Menne
Steven Kang wrote: > > Im trying to load *"xlsx"* package which depends on *"xlsxjars"* and * > "rJava"* packages. > > All the 3 packages (zipped files) are installed successfully in windows. > > I have added "C:\Program Files\Java\jre1.6.0_03\bin\client" to the PATH > variable to get rJava wo

Re: [R] How to get the source code for the assignment of a variable?

2010-02-11 Thread Sharpie
Sharpie wrote: > >> model$call > lm(formula = demand ~ Time, data = BOD) > > This object could be passed to the eval() function to basically re-run the > operation that generated `lm`. > That would be re-run the operation that generated `model`. I think I should go to sleep now... -Charli

Re: [R] How to get the source code for the assignment of a variable?

2010-02-11 Thread Sharpie
djhurio wrote: > > I believe there is not such thing as source code for a variable. I believe > if you define x=y*y, x is keeping only the values of y*y, but not how they > were computed. Am I right? > In general yes. Basic variables do not store a copy of the function call that created them.

Re: [R] Loss of precision when importing data into R

2010-02-11 Thread Sharpie
Hanke, Alex-2 wrote: > > Hi Listers, > I can't seem to figure out why I loose precision when I try to import a > comma delimited file using read.csv or read.table. The fields of interest > are rounded to one decimal place. > If the fields of interest are rounded to one decimal place in the fi

Re: [R] wireframe() help {Lattice}

2010-02-11 Thread Dieter Menne
Kim Jung Hwa wrote: > > I'm trying a 3D-plot using wireframe() from Lattice package. Below is my > code and sample data (read in "dta" object). > > I'm wondering if it is possible to make center grid (curved) line more > prominent (or bold). The curved line I'm talking about is the center > lin

Re: [R] How to get the source code for the assignment of a variable?

2010-02-11 Thread djhurio
I believe there is not such thing as source code for a variable. I believe if you define x=y*y, x is keeping only the values of y*y, but not how they were computed. Am I right? - -- http://djhurio.blogspot.com/ http://twitter.com/djhurio http://www.linkedin.com/in/martinsliberts http://www.

Re: [R] print() / split()

2010-02-11 Thread Dieter Menne
Gary Miller wrote: > > Hi All, > > Can anyone please tell me what is the meaning of four coordinates in below > print statement. Currently its dividing plotting window into 1 X 2 and I > want to change it to 2 X 2 [ equivalent of par(mfrow=c(2,2)) ]. Thanks, > > print(p1, split=c(1,1,2,2), m

[R] R connection with sql server 2005

2010-02-11 Thread vikrant
Dear R experts, I am using RODBC package. library(RODBC) channel<- odbcDriverConnect("driver=SQL Server;server=",servername) data<- sqlQuery(channel,"select * from dbname .. dbtable") Here if i use this it is getting executed successfully. But when i put this in a function as my<-function(serv

Re: [R] Average of a variable against another.

2010-02-11 Thread Keeeeeeee
Take it easy. I wrote that thank you. Actually, the sentences "Get the average tall of the plant against year, for all the years of available data. The year_1 and year_2 are recorded so that a plant is alive if the year of a question is equal to or grater than the year_1 and equal to and less th

Re: [R] for loop function output

2010-02-11 Thread Daniel Malter
Hi, sorry, but I cannot figure out where the five values come from. However, generally you can define an n x 5 matrix (let's call it MATRIX), where n is the number of simulations and 5 is the assumed number of values that each round of the simulation returns. Then assign the five values to the n-t

[R] for loop function output

2010-02-11 Thread seydahmet ercan
Hello all, I am trying to run a simulation. the simulation presented below. > rep=5 > sr=.10 # selection ratio > pmin=.10 # minority ratio > nap=1000 # total number of applicant > nsle=sr*nap # number of ee selected > nb=nap*pmin # number of minority > nw=nap-nb # number of majority > mb=100 # mea

[R] How to get the source code for the assignment of a variable?

2010-02-11 Thread blue sky
'get' can give me the source code for a function. Is there a way to get the source code for a variable? In the following example, the source code for x is 'y*y'. Is there a way to get it using the string 'x'? > f=function(){print('xx')} > get('f') function(){print('xx')} > y=3 > x=y*y > get('x')

Re: [R] ffsave.image() error with large objects

2010-02-11 Thread Yue Sheng
So it seems that I've hit the 4GB zipfile limit. However, even if I set compress = FALSE, it still tries to compress, and hence fails. YS On 2/11/10, Yue Sheng wrote: > Hi, I have been using ffsave.image() to save mixture of ff and normal > objects in my workspace. e.g. > > ffsave.image(file = "

Re: [R] Novel (Maybe?) Visualizations

2010-02-11 Thread stvienna wiener
2010/2/10 Johannes Huesing : > D. Dashcle [Wed, Feb 10, 2010 at 01:13:58AM CET]: > I would look for "graphviz" in www.rseek.org and procede from there. Is graphviz really the only option? I guss so, but the license of graphviz is very restricted and not comparable to the usal open source license

Re: [R] error

2010-02-11 Thread David Winsemius
On Feb 11, 2010, at 9:31 PM, nurnabilana...@hotmail.com wrote: list<-read.csv("c:\\temp\\data.csv") list library(survival) status<-1*(>0) Not sure what that was supposed to do, or even if it will parse. plot (survfit (Surv(status,time)~1,data=list),ylab="Survivorship",xlab="Time") model<-su

Re: [R] Average of a variable against another.

2010-02-11 Thread David Winsemius
On Feb 11, 2010, at 10:01 PM, K wrote: Actually, the way you did is wrong. You ignore an instruction that "the year_1 and year_2 are recorded so that a plant is alive if the year of a question is equal to or grater than the year_1 and equal to and less than the year_2." I did n

Re: [R] print() / split()

2010-02-11 Thread RICHARD M. HEIBERGER
This is defined in the help file ?print.trellis __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,

Re: [R] Switching Axis in Time Series plotting

2010-02-11 Thread JSmaga
Basically it works, but I use the xts format and the axis are messed up. plot(c(time(ser)) ~ c(ser), type = "l") Error in as.POSIXct.default(x) : do not know how to convert 'x' to class "POSIXlt" I don't know why do you have any idea? Besides, why do you use the c(...) function in your code

Re: [R] problems with SPC charts in R

2010-02-11 Thread vikrant
Dear Bart, According to your suggestion I wrote to maintainer of the package and the reply which I got is as follows:- "You shouldn't use R charts for monitoring dispersion using sample sizes larger than 20, and for sample sizes greater than 25 you get an error. From theory, R chart used t

[R] error

2010-02-11 Thread nurnabilanabil
list<-read.csv("c:\\temp\\data.csv") list library(survival) status<-1*(>0) plot(survfit(Surv(status,time)~1,data=list),ylab="Survivorship",xlab="Time") model<-survfit(Surv(time,status)~1, data=list plot(survfit(Surv(status,time)~1,data=list),ylab="Survivorship",xlab="Time") Error in Surv(status, t

Re: [R] Average of a variable against another.

2010-02-11 Thread Keeeeeeee
Actually, the way you did is wrong. You ignore an instruction that "the year_1 and year_2 are recorded so that a plant is alive if the year of a question is equal to or grater than the year_1 and equal to and less than the year_2." That is, you can't ignore the ages between year_1 and year_2. The

Re: [R] How to create probeAnno object?

2010-02-11 Thread AMBUJ
Hi,     Thank you Viviana for the description to create probeAnno object. The below link was very helpful: http://svitsrv25.epfl.ch/R-doc/library/Ringo/html/probeAnnoClass.html I tried creating the object in the following ways where: startProbe & endProbe are the vectors which has th

Re: [R] running means

2010-02-11 Thread RagingJim
ok, solved it. Hoowever (there is always a however), I would like to centre the line plot of the rolling mean onto the centre of each bar in my bar plot. Currently, the lines aligns itself with the RHS of bars. I have tried this http://n4.nabble.com/Barplot-plot-same-scale-td1009254.html#a1009269

[R] print() / split()

2010-02-11 Thread Gary Miller
Hi All, Can anyone please tell me what is the meaning of four coordinates in below print statement. Currently its dividing plotting window into 1 X 2 and I want to change it to 2 X 2 [ equivalent of par(mfrow=c(2,2)) ]. Thanks, require(lattice) p1=barchart(yield ~ variety | site, data = barley,

Re: [R] Switching Axis in Time Series plotting

2010-02-11 Thread Gabor Grothendieck
Try this using the builtin ts series, Nile: year <- c(time(Nile)) Nile. <- c(Nile) plot(year ~ Nile., type = "l") On Thu, Feb 11, 2010 at 10:19 PM, JSmaga wrote: > > Hi guys, > > I would like to know if it is possible to switch the X Y axis when plotting > a time series. > > Precisely, what I w

[R] ffsave.image() error with large objects

2010-02-11 Thread Yue Sheng
Hi, I have been using ffsave.image() to save mixture of ff and normal objects in my workspace. e.g. ffsave.image(file = "C:\output\saveobjects", rootpath = "D:\fftempdir", safe = TRUE) It works fine but once my workspace has large (~4GB) objects, I get the error: Error in ffsave.image(file = "C:

Re: [R] R Group on LinkedIn has new book discounts

2010-02-11 Thread Jim Lemon
On 02/12/2010 07:31 AM, Prof. John C Nash wrote: Has anyone else experienced frustration with the LinkedIn site. It's been spamming me since I tried to join, and I seem to see R postings, but I've never been able to "confirm" my email address i.e., it never sent me THAT email. So I can never get

[R] wireframe() help {Lattice}

2010-02-11 Thread Kim Jung Hwa
Hi All, I'm trying a 3D-plot using wireframe() from Lattice package. Below is my code and sample data (read in "dta" object). I'm wondering if it is possible to make center grid (curved) line more prominent (or bold). The curved line I'm talking about is the center line drawn for a fixed value of

Re: [R] nlme w/no groups and spatially correlated residuals

2010-02-11 Thread Ben Bolker
Seth syr.edu> writes: > I would like to specify a spherical correlation structure for spatially > autocorrelated residuals in a model based upon the logistic function of a > response that is a proportion (0 to 1) (so usual binary logistic regression > is not an option). There is no need for a g-

[R] Switching Axis in Time Series plotting

2010-02-11 Thread JSmaga
Hi guys, I would like to know if it is possible to switch the X Y axis when plotting a time series. Precisely, what I would like to do is having the dates on the Y axis, and the numbers on the X axis. I know it is pretty uncommon but it would help me a lot! Thanks, Jeremie -- View this messa

[R] Help on loading "xlsx" package

2010-02-11 Thread Steven Kang
Dear R users, Im trying to load *"xlsx"* package which depends on *"xlsxjars"* and * "rJava"* packages. All the 3 packages (zipped files) are installed successfully in windows. I have added "C:\Program Files\Java\jre1.6.0_03\bin\client" to the PATH variable to get rJava working. However, the f

[R] Switching

2010-02-11 Thread JSmaga
-- View this message in context: http://n4.nabble.com/Switching-tp1478064p1478064.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posti

Re: [R] Code find exact distribution for runs test?

2010-02-11 Thread Greg Snow
Try this: druns2 <- function(x, n1, n2) { if( x %% 2 ) { # odd x choose( n1 - 1, n1 - (x+1)/2 ) * choose( n2 - 1, n2 - (x-1)/2 ) / choose( n1+n2, n1 ) + choose( n2 - 1, n2 - (x+1)/2 ) * choose( n1 - 1, n1 - (x-1)/2 ) / choose( n1+n2, n2 )

Re: [R] scatterplot in Package CAR

2010-02-11 Thread John Fox
Dear Ricardo, Yes, the least-squares line fit when reg.line=TRUE (the default) includes a constant. Regards, John John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada web: socse

Re: [R] Identifying special characters in a text file

2010-02-11 Thread jim holtman
Setup a regular expression to only keep what you want. This example keep alpha, nums, spaces , commas and periods: > x <- readLines(textConnection('I discovered that the following works: +any(is.na(strsplit(readLines(FILE), ""))) + + I am wondering whether anyone has a better approach to

Re: [R] Average of a variable against another.

2010-02-11 Thread David Winsemius
On Feb 11, 2010, at 7:32 PM, K wrote: Dear helpers, FYI, I am a beginner of R, just have dealt with MATLAB or JAVA. I want to know how to solve one problem given 4 variables: year_1, year_2, tall_1, tall_2. The tall_1 is measured at year_1 and tall_2 at year_2. The tall has grown

[R] scatterplot in Package CAR

2010-02-11 Thread Ricardo Gonçalves Silva
Hi Folks, Please, when I ask the option reg.line at the scatterplot in package car, the OLS models includes a constant? If not how can I do it sing the following code: scatterplot(lfirms ~ lscale, data=dataset, reg.line=lm, smooth=FALSE, labels=FALSE, span=0.5, xlab="Relative

Re: [R] Sweve/cacheSweave

2010-02-11 Thread Cameron Bracken
This is correct, we have stylepath set to true by default. Also I noticed that your original command will not work correctly: > Sweave("pgfSweave-example.Rnw",driver = cacheSweaveDriver) If you use cacheSweaveDriver() with pgfSweave-example.Rnw the tikz option will not be recognized. You shou

Re: [R] Barplot axis titles

2010-02-11 Thread RagingJim
This worked: dimkent<-dim(kent) axis.ticks<-seq(kent[1,1],kent[dimkent[1],1],by=10) barplot(Ann,main=title, xlab="Year",ylab="Rainfall (mm)", ylim=c(0,ymax),col="blue",space=0) axis(1,at=seq(1,rows,10),tcl=-0.5,labels=axis.ticks) Thanks Jim! You just saved my life. -- View this message in co

[R] Identifying special characters in a text file

2010-02-11 Thread Dennis Fisher
Colleagues R 2.10.1 on a Mac I read in textfiles using readLines, then I process those files, then I use R to execute another program. Occasionally those files contain characters other than letter / numbers / routine punctuation marks. For example, a bullet (option-8 on a Mac) triggers the

Re: [R] Sweve/cacheSweave

2010-02-11 Thread Yihui Xie
If I understand pgfSweave correctly, a line like this \usepackage{C:/PROGRA~1/R/some.version/share/texmf/Sweave} will be added to the preamble of your LaTeX document if you didn't explicitly add \usepackage{Sweave} by yourself. That will cause the error like Missing \endcsname inserted The con

Re: [R] Barplot axis titles

2010-02-11 Thread Jim Lemon
On 02/12/2010 12:03 PM, RagingJim wrote: To everyone else, it is going to look like I am talking to myself. Talking to oneself was once a diagnostic of madness. These days, if someone does not possess a mobile telephone of the sort that allows the wearer to stride along talking to an invisibl

[R] Average of a variable against another.

2010-02-11 Thread Keeeeeeee
Dear helpers, FYI, I am a beginner of R, just have dealt with MATLAB or JAVA. I want to know how to solve one problem given 4 variables: year_1, year_2, tall_1, tall_2. The tall_1 is measured at year_1 and tall_2 at year_2. The tall has grown up such as uniformly 1 cm/yr. The data is like yea

Re: [R] Barplot axis titles

2010-02-11 Thread RagingJim
To everyone else, it is going to look like I am talking to myself. Jim, I got your reply (to my post which I changed almost as soon as I posted it), and "as.numeric(as.character(kent$Year))" is a god send. Worked a charm, and fixed all the problems. So thanks :) Last issue now (at least for this

Re: [R] Barplot axis titles

2010-02-11 Thread RagingJim
ok, used the lapply function and now the "Years" column is the numeric type. However, I still get the same error as above. Replacing either "kent[1,1]" or "kent[dimkent[1],1]" with a number, gives me the same error. If both terms are replaced with a number, then it does not produce an error. It th

Re: [R] trouble with read.table and colClasses='raw'

2010-02-11 Thread jim holtman
What you might consider is to use save/load for storing the data in a format that is easily accessible in R, and then using write.table for creating a character based output for other external programs. For the size files you are working with, this is the easiest and fastest way of doing it. On T

[R] nlme w/no groups and spatially correlated residuals

2010-02-11 Thread Seth
Hi, I would like to specify a spherical correlation structure for spatially autocorrelated residuals in a model based upon the logistic function of a response that is a proportion (0 to 1) (so usual binary logistic regression is not an option). There is no need for a g-side random effect with gr

Re: [R] Code find exact distribution for runs test?

2010-02-11 Thread Dale Steele
Thanks for this! My original query was probably unclear. I think you have answered a different, possibly more interesting question. My goal was to find an exact distribution of a total number of runs R in samples of two types of size (n1, n2) under the null hypothesis of randomness. The horribl

Re: [R] Unexpected output in first iteration of for-loop

2010-02-11 Thread Chaehan So
Don, that was great - thanks so much! ...and you are right rbind() being expensive, but my dataframe will always stay that small (max. twice as large). Chaehan On Thu, Feb 11, 2010 at 4:50 PM, Don MacQueen wrote: > You have a mistake in how you're setting up the object named "result" > before t

Re: [R] Using sapply on a two argument function

2010-02-11 Thread Steven Worthington
Thanks Peter, your solution worked perfectly. It also helped me realize the mistake I made in my own script - the 'k' function was returning values for 'y' between 1:10 rather than .1:1 - it should have looked like this: k <- function(s) { n <- seq(.1, s/10, .1) m

Re: [R] Barplot axis titles

2010-02-11 Thread RagingJim
Cheers Jim. However when I input: axis.ticks<-seq(kent[1,2],kent[dimkent[34,2]],by=10) I get the error "Error in dimkent[1,2] : incorrect number of dimensions" What are these dimensions that I am meant to have in there? I have tried total dimensions of the table, dimension of the row that I n

Re: [R] How to use a string to refer a function?

2010-02-11 Thread Don MacQueen
Don't really understand what you have in mind, but maybe this will do it. f <- function(x=3) x^2 Now, if I want to "get" the function f, given that I only know its name "f", I can do this: getf <- get('f') getf(4) Or even: get('f')(5) [1] 25 Also, attributes(getf) $source [1] "func

Re: [R] Code find exact distribution for runs test?

2010-02-11 Thread Greg Snow
OK, I think I have it worked out for both cases: library(vcd) druns <- function(x, n) { # x runs in n data points, not vectorized # based on sample median if( n%%2 ) stop('n must be even') if( x %% 2 ) { # odd x cho

Re: [R] Using sapply on a two argument function

2010-02-11 Thread Peter Ehlers
How about t(outer(seq(.1,1,.1), 1:12, foo)) Convert to dataframe, etc. -Peter Ehlers Steven Worthington wrote: Dear R users, I have a function (simplified here) that accepts two arguments and performs various calculations: foo <- function(y, x) { a <- y*sqrt(x)

Re: [R] Blinder-Oaxaca decompositions

2010-02-11 Thread David Winsemius
On Feb 11, 2010, at 5:50 PM, David Winsemius wrote: On Feb 11, 2010, at 3:46 PM, Christopher wrote: I'm looking for a routine in R to do Blinder-Oaxaca (and related) decompositions. A very nice one has been written (by Jann) for Stata (and I'm evaluating whether I can switch over to R). I'm

Re: [R] Blinder-Oaxaca decompositions

2010-02-11 Thread David Winsemius
On Feb 11, 2010, at 3:46 PM, Christopher wrote: I'm looking for a routine in R to do Blinder-Oaxaca (and related) decompositions. A very nice one has been written (by Jann) for Stata (and I'm evaluating whether I can switch over to R). I'm having a hard time finding any reference in R documenta

Re: [R] How to use a string to refer a function?

2010-02-11 Thread Gabor Grothendieck
See the FAQ for your question. In addition make sure you read about the "keep.source" option on the ?options page to find out the situation in which attr(f, "source") will or will not work. On Thu, Feb 11, 2010 at 5:26 PM, blue sky wrote: >> f=function(){ print('in f')} >> attr(f, 'source') > [1

[R] Using sapply on a two argument function

2010-02-11 Thread Steven Worthington
Dear R users, I have a function (simplified here) that accepts two arguments and performs various calculations: foo <- function(y, x) { a <- y*sqrt(x) b <- a+2 c <- a*b return(c) } If I call the function as follows I get th

Re: [R] How to use a string to refer a function?

2010-02-11 Thread Erik Iverson
Hint: "somebody let me know how to >>>get< the function from the name 'f'?" __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

[R] How to use a string to refer a function?

2010-02-11 Thread blue sky
> f=function(){ print('in f')} > attr(f, 'source') [1] "function(){ print('in f')}" I have the above simple function. I can use the variable f to refer to the function and get the function source. Suppose that I have 'f' as a string (say I get it from ls()), could somebody let me know how to get

Re: [R] histogam plots

2010-02-11 Thread li li
Many thanks for your kind help!! Li 2010/2/11 Dieter Menne > > > Dennis Murphy wrote: > > > > > > ## Histogram + density plots in lattice and ggplot2 > > > > > > There was a typo in your example (should be dd <- data.frame), but anyway. > ggplot2 needs 10 times as long. While Bill Ven

Re: [R] Flattening Graphics

2010-02-11 Thread baptiste auguie
Hi, On 11 February 2010 22:14, Paul Murrell wrote: > Hi > > > baptiste auguie wrote: >> >> Hi, >> >> You could try the grid.grab() function in R devel if your graphics use >> the Grid package. It will read the graphical output as a bitmap which > > > grid.grab() does NOT grab a bitmap version of

Re: [R] Using seq_len() vs 1:n

2010-02-11 Thread Bert Gunter
" I like to use 1:n when I'm teaching debugging, because it looks so safe but isn't." Duncan Murdoch ... operator precedence providing lots of examples, e.g. > 1: 2*3 [1] 3 6 ## vs > seq_len(2*3) [1] 1 2 3 4 5 6 Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics

Re: [R] difftime result for days not an integer?

2010-02-11 Thread Don MacQueen
Which brings up another point. The help page for difftime specifies that it operates on date-time or date objects. But '2004-08-05' is neither of these, it is a character object. At this point, one might ask... I didn't give it what it asked for, what is it going to do? (might give me an er

[R] Formatting question for separate polygons

2010-02-11 Thread Tim Clark
Dear List, I am trying to plot several separate polygons on a graph. I have figured out how to do it by manually, but have too much data to use such a tedious method. I would appreciate your help. I have made a simple example to illustrate the problem. How can I get x into the proper format

Re: [R] Using seq_len() vs 1:n

2010-02-11 Thread Duncan Murdoch
On 11/02/2010 3:39 PM, Peter Ehlers wrote: R-people, Duncan Murdoch's response in https://stat.ethz.ch/pipermail/r-help/2010-February/227869.html reminded me of something I had been meaning to ask. A while ago I started using for(i in seq_len(v)) {} in preference to for(i in 1:n)

Re: [R] Using contour3d: axes, plotting to file, with lattice

2010-02-11 Thread Duncan Murdoch
On 11/02/2010 3:20 PM, Waichler, Scott R wrote: I am looking for examples of how to plot with contour3d() to a PNG or PDF file, add axes and other elements to the isosurface plot, and use contour3d in conjunction with lattice. You can't really combine rgl with lattice: rgl uses a completely

Re: [R] Using seq_len() vs 1:n

2010-02-11 Thread Rolf Turner
On 12/02/2010, at 9:39 AM, Peter Ehlers wrote: > R-people, > > Duncan Murdoch's response in > > https://stat.ethz.ch/pipermail/r-help/2010-February/227869.html > > reminded me of something I had been meaning to ask. > > A while ago I started using > > for(i in seq_len(v)) {} > > in pr

[R] igraph

2010-02-11 Thread gabrielap
Hello... I am a system engeenering student and I am using R for first time for Graph Theory. I would like to know if there is anyway you can plot an ghaph (igraph library) and obtain a graph whose vertices dont appear identified with number, instead I would like the vertices to be identified

[R] Blinder-Oaxaca decompositions

2010-02-11 Thread Christopher
I'm looking for a routine in R to do Blinder-Oaxaca (and related) decompositions. A very nice one has been written (by Jann) for Stata (and I'm evaluating whether I can switch over to R). I'm having a hard time finding any reference in R documentation to this pretty ubiquitous tool (in labour econo

Re: [R] Dual Category X-Axis (Multi-Level)

2010-02-11 Thread Powell, Eric
That's brilliant, Greg. Thanks a bunch! -Original Message- From: Greg Snow [mailto:greg.s...@imail.org] Sent: Thursday, February 11, 2010 2:01 PM To: Powell, Eric; 'r-help@r-project.org' Subject: RE: [R] Dual Category X-Axis (Multi-Level) Using mtext is probably one of the most straigh

[R] Loss of precision when importing data into R

2010-02-11 Thread Hanke, Alex
Hi Listers, I can't seem to figure out why I loose precision when I try to import a comma delimited file using read.csv or read.table. The fields of interest are rounded to one decimal place. DataTimeStamp TerminalID Hours Minutes Latitude Longitude Status Temperature Battery BootTimes

Re: [R] Flattening Graphics

2010-02-11 Thread Paul Murrell
Hi baptiste auguie wrote: Hi, You could try the grid.grab() function in R devel if your graphics use the Grid package. It will read the graphical output as a bitmap which grid.grab() does NOT grab a bitmap version of the current picture. It grabs all of the (grid-rendered) grobs in the cu

Re: [R] trouble with read.table and colClasses='raw'

2010-02-11 Thread Johan Jackson
Apologies for my sarcastic/defensive reply email Peter. The issue is that I need this matrix to be read into other programs - not just R, so save() won't work. I like 'raw' mode because it saves so much space, but it's difficult to work with. This read/write issue is but one example; another is th

Re: [R] Suprising behavior of paste or cat?

2010-02-11 Thread Russell Pierce
Great thought Duncan, I've been examining the resulting files using the default installed notepad.exe. I just opened a "nonsense" file in wordpad and the text is viewable. The text must be getting converted somewhere. However, whatever conversion is occurring must be inconsistent otherwise all

Re: [R] difftime result for days not an integer?

2010-02-11 Thread Thomas Lumley
On Thu, 11 Feb 2010, Jonathan wrote: Anybody have an idea why I would get a non-integer value for the number of days here? difftime('2004-08-05','2001-01-03',units='days') Time difference of 1309.958 days Because it's not a whole number of 24-hour periods, due to daylight saving time: 0.95

Re: [R] R ANOVA gives diferent results than SPSS

2010-02-11 Thread Peter Ehlers
Comment inserted below. Greg Snow wrote: A couple of possibilities: The data is not the same, e.g. something in the file was interpreted differently by the 2 programs, one of the programs may have stopped reading at an unrecognized value, while the other skipped it and went on. Or it used to b

Re: [R] difftime result for days not an integer?

2010-02-11 Thread Barry Rowlingson
On Thu, Feb 11, 2010 at 8:40 PM, Jonathan wrote: > Anybody have an idea why I would get a non-integer value for the > number of days here? > >> difftime('2004-08-05','2001-01-03',units='days') > Time difference of 1309.958 days > > > Would you just round off? It's one hour short of an integer num

[R] difftime result for days not an integer?

2010-02-11 Thread Jonathan
Anybody have an idea why I would get a non-integer value for the number of days here? > difftime('2004-08-05','2001-01-03',units='days') Time difference of 1309.958 days Would you just round off? Best, Jon __ R-help@r-project.org mailing list https:/

[R] Using seq_len() vs 1:n

2010-02-11 Thread Peter Ehlers
R-people, Duncan Murdoch's response in https://stat.ethz.ch/pipermail/r-help/2010-February/227869.html reminded me of something I had been meaning to ask. A while ago I started using for(i in seq_len(v)) {} in preference to for(i in 1:n) {} Duncan's post shows that if n can be z

Re: [R] Integral of function of dnorm

2010-02-11 Thread davidr
and it can be done analytically: = -(1 + log(2 pi)) / 2 -- David L. Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Greg Snow Sent: Thursday, February 11, 2010 11:58 AM To: Trafim Vanishek; Peter Dalgaard Cc: r-help@r-project

[R] R Group on LinkedIn has new book discounts

2010-02-11 Thread Prof. John C Nash
Has anyone else experienced frustration with the LinkedIn site. It's been spamming me since I tried to join, and I seem to see R postings, but I've never been able to "confirm" my email address i.e., it never sent me THAT email. So I can never get past the login screen to see more than the subje

Re: [R] read numeric values with thousands seperator from csv file

2010-02-11 Thread Gabor Grothendieck
Check this post: https://stat.ethz.ch/pipermail/r-help/2010-February/227520.html On Thu, Feb 11, 2010 at 2:39 PM, Mark Breman wrote: > Hello, > > Is there an easy way to read a csv file with numeric values that contain > thousands seperators. The file looks like this: > > Date;opening;High;Low;cl

Re: [R] trouble with read.table and colClasses='raw'

2010-02-11 Thread Peter Ehlers
Johan, My apologies if you took my comments to be sarcastic; they were certainly not meant to be. I have no desire to put you or anyone down. I see now that you want to somehow store data more 'efficiently', presumably in order to be able to handle larger objects in RAM. I doubt that storage.mo

[R] Using contour3d: axes, plotting to file, with lattice

2010-02-11 Thread Waichler, Scott R
I am looking for examples of how to plot with contour3d() to a PNG or PDF file, add axes and other elements to the isosurface plot, and use contour3d in conjunction with lattice. Regarding lattice, I'm not necessarily looking for conditioning on the data shown in the isosurface plots, just a wa

Re: [R] trouble with read.table and colClasses='raw'

2010-02-11 Thread jim holtman
Why aren't you using 'save'/'load' to save a copy of the data? Why go through all the conversions? On Thu, Feb 11, 2010 at 2:50 PM, Rolf Turner wrote: > > On 12/02/2010, at 8:27 AM, Johan Jackson wrote: > >> "I suspect that you really don't know what 'raw' type means and haven't >> bothered to c

Re: [R] read numeric values with thousands seperator from csv file

2010-02-11 Thread Ista Zahn
It's not particularly nice, but you could do Dat <- read.table(textConnection('Date;opening;High;Low;closing;Volume 12/02/08;4,764.95;4,897.62;4,729.13;4,895.31;- 13/02/08;4,868.02;4,927.81;4,833.85;4,898.60;- 14/02/08;4,942.18;4,962.43;4,877.88;4,895.99;-'), sep=";", header=TRUE, colClasses="char

Re: [R] read numeric values with thousands seperator from csv file

2010-02-11 Thread jim holtman
Read them in as character and then convert them: > x <- c('4,123.45', '1,234,567.89') > x [1] "4,123.45" "1,234,567.89" > as.numeric(gsub(',', '', x)) [1]4123.45 1234567.89 > On Thu, Feb 11, 2010 at 2:39 PM, Mark Breman wrote: > Hello, > > Is there an easy way to read a csv file with nu

Re: [R] trouble with read.table and colClasses='raw'

2010-02-11 Thread Rolf Turner
On 12/02/2010, at 8:27 AM, Johan Jackson wrote: > "I suspect that you really don't know what 'raw' type means and haven't > bothered to check ?raw. It's also pretty clear that you haven't read the > colClasses description in ?read.table very carefully." > > Gee, thanks Peter (this is what I love

[R] read numeric values with thousands seperator from csv file

2010-02-11 Thread Mark Breman
Hello, Is there an easy way to read a csv file with numeric values that contain thousands seperators. The file looks like this: Date;opening;High;Low;closing;Volume 12/02/08;4,764.95;4,897.62;4,729.13;4,895.31;- 13/02/08;4,868.02;4,927.81;4,833.85;4,898.60;- 14/02/08;4,942.18;4,962.43;4,877.88;4,

[R] formatting do.call output

2010-02-11 Thread emorway
Hello, With a dataset that is about 1.4e6 rows long my.dat[seq(1:20),] date Cell_ID Classification WT_Depth Frac_ET_Satsfd 1999-04-08 974 3 3.5850830.244561400 1999-04-081188 3 3.5260010.123484700 1999-04-081189 3 3.187012

Re: [R] trouble with read.table and colClasses='raw'

2010-02-11 Thread Johan Jackson
"I suspect that you really don't know what 'raw' type means and haven't bothered to check ?raw. It's also pretty clear that you haven't read the colClasses description in ?read.table very carefully." Gee, thanks Peter (this is what I love about the R help boards: people whose sole goal is to put o

Re: [R] Reading raw intensity data from getGEO's gse object

2010-02-11 Thread Martin Morgan
On 02/11/2010 10:35 AM, Dipen wrote: > > Hello, I am trying to download a SOFT matrix file for GSE series to extract > raw intensity data. > > gse<- getGEO('GSE', AnnotGPL=T) > > However, I am not able to use the function Table(gse), which returns the > following error > Error in funct

Re: [R] Code find exact distribution for runs test?

2010-02-11 Thread Greg Snow
I am not an expert in this area, but here are some thoughts that may get you started towards an answer. First, there are 2 ways (possibly more) that can lead to the data for a runs test that lead to different theoretical distributions: 1. We have a true or hypothesized value of the median that

Re: [R] R ANOVA gives diferent results than SPSS

2010-02-11 Thread Joe King
I have found a similar problem with the ANOVA function in R, I found the problem is when you specify a variable in SPSS as a random variable instead of fixed, and R treats all of the factors as fixed. Joe King 206-913-2912 j...@joepking.com "Never throughout history has a man who lived a life of e

Re: [R] Find each time a value changes

2010-02-11 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Tim Clark > Sent: Thursday, February 11, 2010 10:53 AM > To: r-help@r-project.org > Subject: Re: [R] Find each time a value changes > > It was brought to my attention that the r

Re: [R] Dual Category X-Axis (Multi-Level)

2010-02-11 Thread Greg Snow
Using mtext is probably one of the most straight forward ways. You can also use something like: par(mfrow=c(1,3), mar=c(5.1,0,4.1,0), oma=c(0,4.1,0,1.1)) one <- 1:3 two <- 2:5 three <- 6:4 names(one) <- LETTERS[1:3] names(two) <- letters[2:5] names(three) <- state.abb[6:4] tmp.ylim <- range(0

Re: [R] Creating a new Access database with R

2010-02-11 Thread Barry Rowlingson
On Thu, Feb 11, 2010 at 6:23 PM, Dieter Menne wrote: > > > Paul- wrote: >> >> As a workaround, you can keep an empty mdb file on your filesystem. When >> you need a new database, you can copy and rename the empty file. >> >> > > Creating a new database is not part of (R)ODBC because there are too

Re: [R] Suprising behavior of paste or cat?

2010-02-11 Thread Duncan Murdoch
I don't think you have said how you are examining the output files. Is it possible that your text editor is assuming that the files are UCS-2 (Unicode), even though R is writing ASCII? Duncan Murdoch On 11/02/2010 1:44 PM, Russell Pierce wrote: Thank you for your input so far r-help denizens

  1   2   >