Re: [R] best way to apply a list of functions to a dataset ?

2010-07-20 Thread Dennis Murphy
Hi: On Tue, Jul 20, 2010 at 5:37 PM, Glen Barnett wrote: > Hi Dennis, > > Thanks for the reply. > > Yes, that's easier, but the conversion to a matrix with rbind has > converted the output of that final function to a numeric. > If you look at the output of lapply(attitude, f), you'll see that t

Re: [R] date from weeknumber

2010-07-20 Thread Gabor Grothendieck
On Tue, Jul 20, 2010 at 6:37 PM, H Rao wrote: > Hi, > > Is there a function to get the last(or first) day of the week, given the > week number of the year? > > For eg, week number for 7/20 is 29 as obtained by format(Sys.Date(),"%U"), > is there a function which returns 7/25 - the last day of week

Re: [R] function of an integral

2010-07-20 Thread Wu Gong
Hi, I'm trying to replicate your program. It may be not the same as yours, hope it helps. ## Create a vector of numbers cip <- seq(1.0,2.5,by=0.1) ## Create ecdf function Fn <- ecdf(cip) ## Create f function f <- function(x){(1-Fn(x))^4} ## Create integrate function ## Because the integrate

[R] OT: Impressions from UseR 2010 conference?

2010-07-20 Thread schuster
Hello UseR cpnference participants, could you give us some impressions of the conference so far (for those of us who stayed at home ..)? And will there be photos be made available ? Thanks, Friedrich Schuster Dompfaffenweg 6 69123 Heidelberg _

Re: [R] date from weeknumber

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 6:37 PM, H Rao wrote: Hi, Is there a function to get the last(or first) day of the week, given the week number of the year? For eg, week number for 7/20 is 29 as obtained by format(Sys.Date(),"%U"), is there a function which returns 7/25 - the last day of week # 29

Re: [R] data from SpatialGridDataFrame

2010-07-20 Thread Kingsford Jones
see ?sp::overlay and section 5.2 of Applied Spatial Data Analysis with R I see there is now also raster::overlay, but I can't claim experience with that funciton (however my impression is that the raster package is a powerful tool for working with potentially very large rasters in R). hth, Kingsf

Re: [R] data from SpatialGridDataFrame

2010-07-20 Thread chris howden
I'm not that familiar with this type of data. I just had a similar issue, but had a GIS person do it in Arc view. But maybe try some of the following functions? Match %in% Plus I'll forward U the replies I got to my post Good luck :-) -Original Message- From: r-help-boun...@r-project.o

Re: [R] blank pdf output when called in a loop

2010-07-20 Thread Nicolas STRANSKY
On 7/20/10 8:14 PM, David Winsemius wrote: > > On Jul 20, 2010, at 7:21 PM, Joshua Wiley wrote: > >> Hi Nicolas, >> >> You nee to explicitly wrap it in print() when it is inside a loop (if >> I'm not mistaken also when inside a function). With lattice loaded, >> you can find the specific print m

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 8:37 PM, Glen Barnett wrote: Hi Dennis, Thanks for the reply. Yes, that's easier, but the conversion to a matrix with rbind has converted the output of that final function to a numeric. I included that last function in the example secifically to preclude people assuming t

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-20 Thread Glen Barnett
Hi Dennis, Thanks for the reply. Yes, that's easier, but the conversion to a matrix with rbind has converted the output of that final function to a numeric. I included that last function in the example secifically to preclude people assuming that functions would always return the same type. I g

[R] function of an integral

2010-07-20 Thread Nathalie Gimenes
Hi All, I have a problem to create a variable that is a function of an integral of another function. The problem is the following: I have a variable called cip. I have to create another variable called bip that is a function of the former variable cip and also the cumulative distribution funct

Re: [R] blank pdf output when called in a loop

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 7:21 PM, Joshua Wiley wrote: Hi Nicolas, You nee to explicitly wrap it in print() when it is inside a loop (if I'm not mistaken also when inside a function). With lattice loaded, you can find the specific print methods by methods(print) . The interpreter handles finding

[R] One problem with RMySQL and a query that returns an empty recordset

2010-07-20 Thread Ted Byers
My last query related to this referred to a problem with not being able to store data. A suggestion was made to try to convert the data returned by fitdist into a data.frame before using rbind. That failed, but provided the key to solving the problem (which was to create a data.frame using the va

Re: [R] Y axis break

2010-07-20 Thread Filoche
Ty sir! -- View this message in context: http://r.789695.n4.nabble.com/Y-axis-break-tp2295499p2296347.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 PLEAS

Re: [R] blank pdf output when called in a loop

2010-07-20 Thread Joshua Wiley
Hi Nicolas, You nee to explicitly wrap it in print() when it is inside a loop (if I'm not mistaken also when inside a function). With lattice loaded, you can find the specific print methods by methods(print) . From your example: pdf("temp1.pdf", width=8, height=8) for(k in 1) { print(wireframe(

[R] blank pdf output when called in a loop

2010-07-20 Thread Nicolas STRANSKY
Hi, I'm hitting a strange problem where pdf plots that I'm trying to make are blank, only when produced from within a loop. The pdf contains 0 page. I've narrowed the problem to this minimal script that invariably produces an empty pdf with my setup: pdf("/local/scratch/1.pdf", width=8, height=8)

[R] date from weeknumber

2010-07-20 Thread H Rao
Hi, Is there a function to get the last(or first) day of the week, given the week number of the year? For eg, week number for 7/20 is 29 as obtained by format(Sys.Date(),"%U"), is there a function which returns 7/25 - the last day of week # 29 TIA, Rao. [[alternative HTML version delete

Re: [R] logistic regression with repeated measures for spec ies-habitat associations

2010-07-20 Thread Ben Bolker
Maureen Ryan ucdavis.edu> writes: > > Hi, > I have three years of species presence/absence data for a set of ~100 > ponds, with a list of associated habitat characteristics (park, vegetation, > hydroperiod, etc.). The datasets differ slightly by year because some ponds > were dry in some y

Re: [R] how to collapse categories or re-categorize variables?

2010-07-20 Thread CC
Thank you very much to all of you for the responses! Phil, the following two examples worked well in re-categorizing. Is there any way I can retain my original data.frame format? Once I re-categorize the data, the format becomes numeric and the original column names are not retained. I probably

Re: [R] Using" fig=" in one screen created with "split.screen()"

2010-07-20 Thread Paul Murrell
Hi split.screen() works by maintaining a set of par(fig) settings, so that a call to screen() is essentially a call to par(fig=). Hence, an explicit par(fig=) call mucks up the plot arrangement made by screen(). Are you trying to use par(fig) to split up a split.screen() screen into even sm

Re: [R] Error using sqldf

2010-07-20 Thread Gabor Grothendieck
On Tue, Jul 20, 2010 at 2:34 PM, harsh yadav wrote: > Hi, > > I am running a query using sqldf() [package : sqldf]. The query is:- > > userid <- 5 > taskid <- 5 > > tab1 <- fn$sqldf("SELECT tobiiEvents.data1, tobiiEvents.data2, > events.`timestamp` as tobiiTime >  FROM tobiiEvents > INNER JOIN eve

Re: [R] Can RMySQL run on Windows using a remote MySQL server?

2010-07-20 Thread Steven McKinney
So the answer is yes. Install the MySQL Workbench application on your XP box and work out the URL, account name and password, and port connection issues to the reomte MySQL database. You should then have a MySQL driver available. Set up a User DSN or System DSN to the remote database using O

Re: [R] Access to R help database

2010-07-20 Thread Uwe Ligges
Sigbert, for a first idea see Duncan Murdoch's article about the new help system in one of the last issues. Best, Uwe On 19.07.2010 20:16, Sigbert Klinke wrote: Hi, from the documentation of help.search I think that fields like "concept" and "keywords" in the R help database exists. How ca

Re: [R] Y axis break

2010-07-20 Thread Wu Gong
Sorry, it was a typo:) http://r.789695.n4.nabble.com/break-axis-using-plotrix-td803987.html#a803987 - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Y-axis-break-tp2295499p2296254.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Y axis break

2010-07-20 Thread Filoche
Hi. Thank for your reply. However, the link you provided don't works (for me at least). Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Y-axis-break-tp2295499p2296202.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] trouble getting table of coeffs with quantreg with fixed effects

2010-07-20 Thread Steve McDonald
I see. Thank you, David. One more question: How can one obtain bootstrapped standard errors for these regression coefficients. I tried the boot.rq procedure, but the results do not look right. Steve -- Steve McDonald Assistant Professor of Sociology North Carolina State University Phone: 919-5

Re: [R] problem with using tm

2010-07-20 Thread Uwe Ligges
On 20.07.2010 06:24, cob wrote: Thanks for the response. I used this command: .libPaths(c("C:\\Program Files\\R\\R-2.11.1\\library\\slam",.libPaths())) No, the .libPaths() should contain "C:\\Program Files\\R\\R-2.11.1\\library" or the same with single forward slashes. If that is already

Re: [R] Help with Reshaping from Wide to Long

2010-07-20 Thread Kingsford Jones
On Sun, Jul 18, 2010 at 6:44 PM, jlwoodard wrote: > > Hi Phil and Jeff, >    Thanks so much for taking the time to help me solve this issue!  Both > approaches work perfectly.  Each of your approaches helped me learn more > about what R can do.   I really appreciate your help! Hi John, Now that

[R] Consultant for Mathematica -> R translation

2010-07-20 Thread Michael Haenlein
Dear all, I have a very short code written in Mathematica which I would need to get translated for use in R. I'm not an expert in Mathematica (which is why I would not feel comfortable with doing the translation myself), but the code is very short (probably 30-40 lines) and looks quite simple fro

Re: [R] Historical Libor Rates

2010-07-20 Thread Marshall Feldman
Hi AAditya, I really wasn't trying to be rude. Sarcastic, yes. Rude, no. The list is frequented by people ranging from leading statistics professors to students looking for someone to do their homework for them. I only receive the digest form of the r-help list and saw that someone had alread

Re: [R] Constrain density to 0 at 0?

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 2:45 PM, Farley, Robert wrote: "Read the help page for density more carefully. Especially the bw and from arguments." Yes, it was my inability to make sense of the help page that motivated my email. My distances range from 0.4 to 7.6 but the density plot ranges from

[R] logistic regression with repeated measures for species-habitat associations

2010-07-20 Thread Maureen Ryan
Hi, I have three years of species presence/absence data for a set of ~100 ponds, with a list of associated habitat characteristics (park, vegetation, hydroperiod, etc.). The datasets differ slightly by year because some ponds were dry in some years and not in others. My goal is to look at ha

Re: [R] Limited output

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 1:05 PM, confusedcius wrote: Hi there, I entered over 2000 lines of data into R from SQLite How? and saved it in R as a data.frame, How? but the data.frame only gives the first 500 lines. Is there any way to either increase the default limit or to determine which o

Re: [R] simplify if statement in R ?

2010-07-20 Thread John Kane
Will something like the %in% statements below help? x1 <- 1 x2 <- 5 y1 <- c(2,3) y2 <- c(4,5) y3 <- c(7,8) x1 %in% y1 ||x2 %in% y2 x1 %in% y1 ||x2 %in% y3 --- On Tue, 7/20/10, Jim Maas wrote: > From: Jim Maas > Subject: [R] simplify if statement in R ? > To: r-help@r-project.org > Receiv

Re: [R] any one knowing how to install library (equate)?

2010-07-20 Thread Uwe Ligges
But perhaps not on outdated versions of R < 2.10.0 . Uwe Ligges On 19.07.2010 00:55, Joshua Wiley wrote: Hi Grace, I'm using the UCLA mirror and this code installs equate fine for me. #install the package (note that the quoted name) install.packages("equate") #load the package library(eq

Re: [R] Problem with command apply

2010-07-20 Thread Berend Hasselman
On 20-07-2010, at 20:30, litao.ext [via R] wrote: > yes, the matrix is symmetric. > > But when I apply normalize upon rows, I expect to get the following result: > > apply( a, 1, normalize ) > [,1] [,2] [,3] [,4] [,5] > [1,] 0.00 0.25 0.50 0.75 1.00 > [2,] 0.00 0.25 0.50 0.75 1.00 >

Re: [R] Constrain density to 0 at 0?

2010-07-20 Thread Farley, Robert
"Read the help page for density more carefully. Especially the bw and from arguments." Yes, it was my inability to make sense of the help page that motivated my email. My distances range from 0.4 to 7.6 but the density plot ranges from -2 to 10. "from=0" seems to hide the negative portion

Re: [R] ifelse() and missing values in test conditions

2010-07-20 Thread Hosack, Michael
Josh, Thank you for your help. The latter method does exactly what I want in one line of code per variable. Also, fyi, I just came across another method that uses %in% in place of == when NA's are present in the test condition variable data and it too works. So my new code is now: PBTCHE$ANY

Re: [R] library ts

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 12:18 PM, Tra, Yolande wrote: Hi, I could not locate library ts in the CRAN website. Please help. The ts package was a base package, but it was merged into the stats package 5 or 6 years ago. You probably want a more current reference. Duncan Murdoch ___

[R] Error using sqldf

2010-07-20 Thread harsh yadav
Hi, I am running a query using sqldf() [package : sqldf]. The query is:- userid <- 5 taskid <- 5 tab1 <- fn$sqldf("SELECT tobiiEvents.data1, tobiiEvents.data2, events.`timestamp` as tobiiTime FROM tobiiEvents INNER JOIN events ON events.eventid = tobiiEvents.eventid WHERE tobiiEvents.subtype =

Re: [R] simplify if statement in R ?

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 2:11 PM, Jim Maas wrote: I found a form of the if statement that works but it is very long. I'm attempting to check the value of of two different variables to see if they evaluate to either of two different values, which will result in a division by 0 in the final equation. This

Re: [R] simplify if statement in R ?

2010-07-20 Thread Joshua Wiley
Hi Jim, Without a reproducible example I can't test my solution against yours, but does this do what you are looking for? #Some Sample data x0.trial01 <- 1 x1.trial01 <- 2 npt01 <- 2 if(any(c(x0.trial01, x1.trial01) %in% c(0, npt01))) { x0.trial01.in <- x0.trial01 + 0.5 x1.trial01.in <- x1.t

Re: [R] Problem with command apply

2010-07-20 Thread litao.ext
yes, the matrix is symmetric. But when I apply normalize upon rows, I expect to get the following result: > apply( a, 1, normalize ) [,1] [,2] [,3] [,4] [,5] [1,] 0.00 0.25 0.50 0.75 1.00 [2,] 0.00 0.25 0.50 0.75 1.00 [3,] 0.00 0.25 0.50 0.75 1.00 [4,] 0.00 0.25 0.50 0.75 1.00 [5,] 0.00 0.25

[R] Limited output

2010-07-20 Thread confusedcius
Hi there, I entered over 2000 lines of data into R from SQLite and saved it in R as a data.frame, but the data.frame only gives the first 500 lines. Is there any way to either increase the default limit or to determine which of the original lines should be in the output (e.g. maybe the last 500 i

[R] How can I get the principal components after a varimax rotation using Varimax function?

2010-07-20 Thread Francisco Javier Santos Alamillos
Dear R users, I have some question about Varimax rotation of the loadings obtained from a PCA. Imagine X is a field where the rows are the observations and the columns are the variables. I obtain the loadings (L), the principal components (PC) and the percentage of the variance for each mode (PVa

[R] library ts

2010-07-20 Thread Tra, Yolande
Hi, I could not locate library ts in the CRAN website. Please help. Yolande [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pr

[R] Problem with command apply

2010-07-20 Thread litao.ext
I try to utilize some operations on rows in a matrix using command 'apply' but find a problem. First I write a simple function to normalize a vector (ignore error handling) as follows: normalize = function( v ) { return( ( v-min(v) ) / ( max(v) - min(v) ) ) } The function works fine for

Re: [R] Indexing by logical vectors

2010-07-20 Thread Kingsford Jones
On Mon, Jul 19, 2010 at 11:12 PM, Christian Raschke wrote: > but in the end I have other cases, where the logical vector is > obtained from other operations or where the value that is assigned is > different case by case; for example, > > levels(something.long)[levels(something.long) %in% LETTERS

Re: [R] Y axis break

2010-07-20 Thread Wu Gong
plotrix can do it. There is a post about axis break. http://r.789695.n4.nabble.com/template/NodeServlet.jtp?tpl=reply&node=2295499 - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Y-axis-break-tp2295499p2295998.html Sent from the R help mailing list archive at

[R] simplify if statement in R ?

2010-07-20 Thread Jim Maas
I found a form of the if statement that works but it is very long. I'm attempting to check the value of of two different variables to see if they evaluate to either of two different values, which will result in a division by 0 in the final equation. This first if statement works for me __

Re: [R] square brackets in expression in plots

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 12:42 PM, Jannis wrote: Dears, do you know whether it is possible to include any square parantheses (brackets) in an expression to use it as an axis label? e.g. I would like to have a label like (with the sub and superscripts correct): "speed [m s^-1]" I know how to combine an

Re: [R] square brackets in expression in plots

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 12:42 PM, Jannis wrote: Dears, do you know whether it is possible to include any square parantheses (brackets) in an expression to use it as an axis label? e.g. I would like to have a label like (with the sub and superscripts correct): "speed [m s^-1]" Not exactl

[R] square brackets in expression in plots

2010-07-20 Thread Jannis
Dears, do you know whether it is possible to include any square parantheses (brackets) in an expression to use it as an axis label? e.g. I would like to have a label like (with the sub and superscripts correct): "speed [m s^-1]" I know how to combine an expression with text via paste, but as

Re: [R] Registered / trademark signs

2010-07-20 Thread David Winsemius
Works on OSX 10.5.8 + R2.11.1 -- David. On Jul 20, 2010, at 1:36 PM, Henrique Dallazuanna wrote: I don't know if this works in OSX, but in XP: plot(0) title('\u00ae - \u2122') On Tue, Jul 20, 2010 at 2:22 PM, Dennis Fisher wrote: Colleagues, What is the easiest means to embed a:

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread StatWM
Thank you very much for your effort! But is there a measure, which can compare the goodness of fit of regression models with and without the intercept? Can I only compare them in terms of sum of squares residual? -- View this message in context: http://r.789695.n4.nabble.com/Correct-statistical

Re: [R] ifelse() and missing values in test conditions

2010-07-20 Thread Joshua Wiley
Hi Mike, Probably the simplest way from what you have done would be to just set any NA values in the column to 0: DF$ANYEF[is.na(DF$ANYEF)] <- 0 Alternately, you can try this. It should work, but it is far from elegant. DF$ANYEF <- with(DF, ifelse( rowSums(cbind(PSOUGHT1, PSOUGHT2, PSOUGHT3)

Re: [R] If help

2010-07-20 Thread jim holtman
Try this, assuming your data is consistent: > x <- read.table(textConnection('"NoReduction" "NoReduction" + "Reduction""Reduction" + "NoReduction" "NoReduction" + "NoReduction" "NoReduction" + "Reduction""Reduction" + "Red

Re: [R] Registered / trademark signs

2010-07-20 Thread Henrique Dallazuanna
I don't know if this works in OSX, but in XP: plot(0) title('\u00ae - \u2122') On Tue, Jul 20, 2010 at 2:22 PM, Dennis Fisher wrote: > Colleagues, > > What is the easiest means to embed a: >® (registered) > or >™ (trademark) > sign in text in a graphic. I would like to u

Re: [R] Problem with command apply

2010-07-20 Thread Berend Hasselman
litao.ext wrote: > > I try to utilize some operations on rows in a matrix using command 'apply' > but find a problem. > > First I write a simple function to normalize a vector (ignore error > handling) as follows: > normalize = function( v ) { > return( ( v-min(v) ) / ( max(v) - min(v) )

Re: [R] If help

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 1:14 PM, Heiman, Thomas J. wrote: Hi Y'all, I have some data in a table with 2 columns. There are two values: "Reduction" and "No Reduction. " I am trying to make a new variable change which recode the combinations from column 1 and 2 into a single number. Here is a

Re: [R] sem by variable x

2010-07-20 Thread Jarrett Byrnes
You may want to take a look at the lavaan package and use the multigroup analysis there (and see if you even need to group by country as well). Otherwise, you could do something like library(sem) library(plyr) cfa_func<-function(a.df){ cfa<-sem(ses.model, cov(a.df[,2:7], nrow(a.df)))

[R] Registered / trademark signs

2010-07-20 Thread Dennis Fisher
Colleagues, What is the easiest means to embed a: ® (registered) or ™ (trademark) sign in text in a graphic. I would like to use mtext and avoid plotmath, if possible. Ideally, the sign should be superscripted but I can easily sacrifice that. Optimally, I need a solution that

Re: [R] par("uin") ? / brace function

2010-07-20 Thread Michael Friendly
Thanks, Peter This more or less corresponds to the solution I came to, modulo xyinch() and atan2(x,y) = atan(x/y). It is mostly intended as a replacement for arrows() in statistical diagrams/plots where you want to show a given range in a plot precisely without additional boundary lines. It wo

[R] If help

2010-07-20 Thread Heiman, Thomas J.
Hi Y'all, I have some data in a table with 2 columns. There are two values: "Reduction" and "No Reduction. " I am trying to make a new variable change which recode the combinations from column 1 and 2 into a single number. Here is a snippet from the table: [1,] "NoReduction" "No

Re: [R] Option pricing models

2010-07-20 Thread Arun.stat
Did you explore the "fOptions" package? Apart from lot of in-build functionalities you would see there lot of good references on options pricing. Thanks, -- View this message in context: http://r.789695.n4.nabble.com/Option-pricing-models-tp2295760p2295842.html Sent from the R help mailing list

Re: [R] Servreg $loglik

2010-07-20 Thread Charles Annis, P.E.
David: Thank you for your comments. I do understand that absolute values of likelihoods by themselves aren't meaningful, and only gain meaning when compared with others computed using the same model but with differing parameter values (for example). That is why I compute likelihoods myself for

Re: [R] nls with some coefficients fixed

2010-07-20 Thread Gabor Grothendieck
On Tue, Jul 20, 2010 at 9:58 AM, wrote: > For nls, the fixing (or masking) of parameters is not, to my knowledge, > possible. > > This is something I've been trying to get in such routines for over 2 > decades. Masks are > available, but not yet well documented, in Rcgmin and Rvmmin packages. > H

[R] ifelse() and missing values in test conditions

2010-07-20 Thread Hosack, Michael
R experts, I have been unable to get the following ifelse statement to work as desired when applied to my data frame. Example: DF$ANYEF <- with(DF,ifelse(PSOUGHT1=='ANY'|PSOUGHT2=='ANY'|PSOUGHT3=='ANY',PEFF,0)) # this statement will be replicated 16 times for 16 unique _EF variables ##

Re: [R] nls with some coefficients fixed

2010-07-20 Thread Keith Jewell
wrote in message news:33466.129.6.253.2.1279634282.squir...@webmail02.uottawa.ca... > For nls, the fixing (or masking) of parameters is not, to my knowledge, > possible. > > This is something I've been trying to get in such routines for over 2 > decades. Masks are > available, but not yet well do

Re: [R] Servreg $loglik

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 11:20 AM, Charles Annis, P.E. wrote: Dear R-experts: I am using survreg() to estimate the parameters of a Weibull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones. When

Re: [R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread jim holtman
Here is a function I use to convert a numeric value of the UNIX time to POSIXct unix2POSIXct <- function (time) structure(time, class = c("POSIXt", "POSIXct")) On Tue, Jul 20, 2010 at 9:26 AM, Jim Hargreaves wrote: > Dear List, > > After much searching with no success, I would like to ask

Re: [R] loop through files and create object

2010-07-20 Thread jim holtman
Consider using a 'list' to hold the matrices: dataList <- lapply(1:47, function(num){ read.csv(paste('country', num, '.raw', sep=''), header=TRUE) } You can then access your data like: dataList[[23]] for the 23rd file read in. On Tue, Jul 20, 2010 at 7:52 AM, Daniel Caro wrote: > Hi R us

Re: [R] Exporting NMDS distance matris to csv

2010-07-20 Thread Federico Andreis
On Tue, Jul 20, 2010 at 5:54 PM, Gavin Simpson wrote: > On Tue, 2010-07-20 at 08:24 -0400, Graves, Gregory wrote: > > If you submit these lines, you end up with variable "vare.dis". I want > > to export vare.dis to csv. Stuck I am. > > Hi Yoda ;-) > > I want THIS on fortune() ! ahhahah so

[R] Random Forest - Strata

2010-07-20 Thread Coll
Hi all, Had struggled in getting "Strata" in randomForest to work on this. Can I get randomForest for each of its TREE, to get ALL sample from some strata to build tree, while leaving some strata TOTALLY untouched as oob? e.g. in below, how I can tell RF to, - for tree 1 in the forest, to use

[R] Y axis break

2010-07-20 Thread Filoche
Hi there. I bet this question have been answered many times, but I cant find a good solution for my problem. I would like to put a axis break (on y axis) on that flowing plot (let's say between 20 and 80 in y). y = c(runif(10, 1, 10), 100); x = y + runif(11, 10, 50); plot(x,y) Is there any so

Re: [R] loop through files and create object

2010-07-20 Thread Joshua Wiley
Hi Daniel, Try this: for(i in 1:47) { assign(x = paste("data", i, sep = ""), value = read.csv(file.path("country", i, ".raw", fsep = ""), header = TRUE), envir = .GlobalEnv) } See ?assign for documentation. Cheers, Josh On Tue, Jul 20, 2010 at 4:52 AM, Daniel Caro wrote: > Hi R users,

[R] data from SpatialGridDataFrame

2010-07-20 Thread kfleis
Dear All, I have a raster map of the class 'SpatialPointsDataFrame' and coordinates of the class 'SpatialPoints'. I would like to retrieve the values that are contained in the raster map at the specific locations given by the coordinates. Can anyone help me out? Kind regards, Katrin Fleischer _

[R] help me with holt-winter model

2010-07-20 Thread vijaysheegi
Hi R-experts, I have been wasted aroun 2 days to understand Holt-Winter method for double exponential smoothing.But concept was not clear to me.Please suggest me how to determeine values of alpha ,beta,gamma.It is bit urgent .please help me in understanding holtwinter parameter determination . I

[R] Option pricing models

2010-07-20 Thread Suman Narayan
Hi, I am currently doing a project in which I wish to calculate the calculate the theoretical price of options using the following models: 1. Constant Elasticity of Variance (CEV) model 2. Merton's jump diffusion model 3. Variance Gamma model I am not sure as to how to implement this in R. I requ

[R] sem by variable x

2010-07-20 Thread Daniel Caro
Hi R users, I am new in R. I would like to perform confirmatory factor analysis for a data set of countries. My data are: data <- read.csv("ses.raw", header = TRUE) attach(data) names(data) [1] "idcntry" "momed" "daded" "dadocu" "momocu" "hompos" "finan" The country id is "idcntry", my

[R] plot() via java

2010-07-20 Thread nero
Hello, I need a possibility to print a function from R in Java with "plot ()". I have taken rJava package and have built up a connection (with the JRI). But if I call plot () in Java, a R_Graphics window (with R_Graphics:Device 2 (ACTIVE)) opens without contents. If I click this window, whole

[R] loop through files and create object

2010-07-20 Thread Daniel Caro
Hi R users, I am a newbie and therefore the naive question. Sorry but I was unable to find an answer online. I would like to read 47 data sets (country1.raw, country2.raw, ... country47.raw) and save into a matrix each time (data1, data2, data47). for (i in 1:47){ data(?) <- read.csv(file.pat

[R] Using" fig=" in one screen created with "split.screen()"

2010-07-20 Thread Birte Reichstein
Hi, I successfully created 3 screens with the following: fig.mat<-c(0,.5,.5,.5,1,1,0,0,.5,1,.5,1) fig.mat<-matrix(fig.mat,nrow=3) fig.mat split.screen(fig.mat) I can plot three different plots on those 3 screens, but when I try the following: (Trying to create three graphs with a common x-axis

Re: [R] Exporting NMDS distance matris to csv

2010-07-20 Thread Gavin Simpson
On Tue, 2010-07-20 at 08:24 -0400, Graves, Gregory wrote: > If you submit these lines, you end up with variable "vare.dis". I want > to export vare.dis to csv. Stuck I am. Hi Yoda ;-) > library(vegan,logical.return = TRUE) #return=true verifies package is > available > > library(MASS,logical.

Re: [R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread Patrick McKann
Thank you so much! And in package 'base' no less...exactly what I needed! On Tue, Jul 20, 2010 at 8:55 AM, David Winsemius wrote: > > On Jul 20, 2010, at 9:44 AM, Patrick McKann wrote: > > Hello all, >> >> I am trying to write a program in R in which I call a function multiple >> times within a

[R] Servreg $loglik

2010-07-20 Thread Charles Annis, P.E.
Dear R-experts: I am using survreg() to estimate the parameters of a Weibull density having right-censored observations. Some observations are weighted. To do that I regress the weighed observations against a column of ones. When I enter the data as 37 weighted observations, the parameter estim

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Mark Heckmann
This was just what I wanted, thanks!! Am 20.07.2010 um 16:43 schrieb Duncan Murdoch: > On 20/07/2010 10:09 AM, Mark Heckmann wrote: >> will reformulate the question: >> >> I use strsplit() to split a string at the blanks. e.g. >> >> > strsplit("Split at blanks", " ") >> [[1]] >> [1] "Split" "a

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Duncan Murdoch
On 20/07/2010 10:09 AM, Mark Heckmann wrote: will reformulate the question: I use strsplit() to split a string at the blanks. e.g. > strsplit("Split at blanks", " ") [[1]] [1] "Split" "at" "blanks" Now I would like to write something like a protected blank (like e.g. in LaTex) into t

[R] p-values pvclust maximum distance measure

2010-07-20 Thread syrvn
Hi, I am new to clustering and was wondering why pvclust using "maximum" as distance measure nearly always results in p-values above 95%. I wrote an example programme which demonstrates this effect. I uploaded a PDF showing the results Here is the code which produces the PDF file: ---

[R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-20 Thread Harlan Harris
Hi, I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything worked OK until this morning, when my ability to write into spreadsheet cells went away. I get the following weird error: Error in els[[type + 1]] : subscript out of bounds Looking at the Google Docs API changelog, I see

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Wu Gong
Hi, you can define delimiters strsplit("Split%at blanks", " |%") - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/specify-blank-in-a-string-with-special-characters-tp2295453p2295639.html Sent from the R help mailing list archive at Nabble.com.

[R] p-values pvclust maximum distance measure

2010-07-20 Thread syrvn
Hi, I am new to clustering and was wondering why pvclust using "maximum" as distance measure nearly always results in p-values above 95%. I wrote an example programme which demonstrates this effect. I uploaded a PDF showing the results Here is the code which produces the PDF file: ---

Re: [R] Historical Libor Rates

2010-07-20 Thread Aaditya Nanduri
Mr. Feldman, I would love nothing more than to reply to your wonderful email with just as much sarcasm. However, the fault lies with my question; I should have been more explicit. It should have been phrased : Where can I find historical OVERNIGHT LIBOR rates? And surprisingly, we both use the

Re: [R] specify blank in a string with special characters

2010-07-20 Thread Mark Heckmann
will reformulate the question: I use strsplit() to split a string at the blanks. e.g. > strsplit("Split at blanks", " ") [[1]] [1] "Split" "at" "blanks" Now I would like to write something like a protected blank (like e.g. in LaTex) into the string that does not get split by strsplit(

[R] nls with some coefficients fixed

2010-07-20 Thread nashjc
For nls, the fixing (or masking) of parameters is not, to my knowledge, possible. This is something I've been trying to get in such routines for over 2 decades. Masks are available, but not yet well documented, in Rcgmin and Rvmmin packages. However, these use an optim() style approach, which is q

Re: [R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:44 AM, Patrick McKann wrote: Hello all, I am trying to write a program in R in which I call a function multiple times within a loop. The problem is that sometimes the function breaks down while calling another function, and produces an error message that breaks my

[R] Nesting functions in loops that result in error messages breaking the loop

2010-07-20 Thread Patrick McKann
Hello all, I am trying to write a program in R in which I call a function multiple times within a loop. The problem is that sometimes the function breaks down while calling another function, and produces an error message that breaks my loop and the program stops. I would like to keep the loop ru

Re: [R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:26 AM, Jim Hargreaves wrote: Dear List, After much searching with no success, I would like to ask how I can convert a unix/POSIX time (seconds since Jan 01, 1970) into a string like "01/01/1970 00:00" This is probably easily done with a system(date...) but it would

Re: [R] Means from selected columns in a data frame

2010-07-20 Thread David Winsemius
On Jul 20, 2010, at 9:25 AM, David Winsemius wrote: On Jul 20, 2010, at 9:13 AM, Marcus Drescher wrote: Hi all, I have a dataframe with survey data. Now I want to calculate means from several but not all columns (e.g. a1, a2, a3) and save them in a new separate column (e.g. a). Well t

[R] Convert Unix (Epoch) timestamp to DD/MM/YY and HH:MM:SS

2010-07-20 Thread Jim Hargreaves
Dear List, After much searching with no success, I would like to ask how I can convert a unix/POSIX time (seconds since Jan 01, 1970) into a string like "01/01/1970 00:00" This is probably easily done with a system(date...) but it would be great if I could do it in R. Kind Regards, Jim Har

  1   2   >