Re: [R] Problem Creating Partial Dependence Plot

2014-05-30 Thread Stephen Milborrow
Jane Shevtsov wrote: I am trying to use the plotmo package to generate a partial dependence plot for a CART model created with rpart. When running plotmo, I get Error: get.plotmo.y returned the wrong length (got 204938 expected 205000). The rpart predict function does indeed return 204938

[R] Scatter plot selection points

2014-05-30 Thread Beatriz
Hi all, I'd like to do a scatterplot where some of the values, out of a subset, are plotted differently in color and shape. I've worked around the following code but I don't manage to make it right. Any help greatly appreciated! # My data dd - iris iris$Code - 1:150 # A selection of my data

Re: [R] Dataframe: Average cells of two rows and replace them with one row

2014-05-30 Thread PIKAL Petr
Hi Please do not use html formating in your post. It does not bring any advantage. See inline. From: Verena Weinbir [mailto:vwein...@gmail.com] Sent: Thursday, May 29, 2014 3:33 PM To: PIKAL Petr Subject: Re: [R] Dataframe: Average cells of two rows and replace them with one row Hey, Thank you

Re: [R] partykit ctree: minbucket and case weights

2014-05-30 Thread Henric Winell
Amber Dawn Nolder wrote 2014-05-28 23:16: Hello, I am an R novice, and I am using the partykit package to create regression trees. I used the following to generate the trees: ctree(y~x1+x2+x3+x4,data=my_data,control=ctree_control(testtype = Bonferroni, mincriterion = 0.90,

Re: [R] Scatter plot selection points

2014-05-30 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Beatriz Sent: Friday, May 30, 2014 9:37 AM To: R Help Subject: [R] Scatter plot selection points Hi all, I'd like to do a scatterplot where some of the values, out of a

Re: [R] Scatter plot selection points

2014-05-30 Thread Beatriz
Hi Ptr, Thanks for your email however, I cannot make the code work. Also, I quite like the ifelse approach. I find it very clean. Cheers On 30/05/2014 15:57, PIKAL Petr wrote: Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On

Re: [R] Scatter plot selection points

2014-05-30 Thread PIKAL Petr
Hi -Original Message- From: Beatriz [mailto:aguitatie...@hotmail.com] Sent: Friday, May 30, 2014 10:08 AM To: PIKAL Petr; R Help Subject: Re: [R] Scatter plot selection points Hi Ptr, Thanks for your email however, I cannot make the code work. Errors? What code you tried?

Re: [R] Multiple regression in R

2014-05-30 Thread Rui Barradas
Hello, lm() is designed to work with data.frames, not with matrices. You can change your code to something like dat - data.frame(price, pred1 = c(5,6,3,4,5), pred2 = c(2,1,8,5,6)) fit - lm(price ~ pred1 + pred2, data = dat) and then use the fitted model to do predictions. You don't have to

Re: [R] Scatter plot selection points

2014-05-30 Thread Beatriz
Hi Petr, Initially your code didn´t work because 'Code' wasn't in uppercase. It works now! :) The only thing is that I wanted in red the codes 3.5. Optional code: sel - iris[iris$Sepal.Width3.5,Code] plot(iris$Sepal.Length ~ iris$Sepal.Width, col=ifelse(iris$Code %in% sel, red, black),

Re: [R] Scatter plot selection points

2014-05-30 Thread PIKAL Petr
Hi My code worked. Your code did not work because you was not aware that R distinguish case of letters :) -Original Message- From: Beatriz [mailto:aguitatie...@hotmail.com] Sent: Friday, May 30, 2014 12:21 PM To: PIKAL Petr; R Help Subject: Re: [R] Scatter plot selection points

Re: [R] Smoothed HR for interaction term in coxph model

2014-05-30 Thread Andrews, Chris
. I selected a smoother spline (df=2). (3) the two plots at the end show (1) the risk (exp(linear predictor)) for combinations of CONTINUOUS and DICHOTOMOUS and (2) a ratio (risk for A vs risk for B), which I think is what you wanted. Chris library(survival) set.seed(20140530) nn - 1000

[R] uGARCHspec function

2014-05-30 Thread Drew M
Hello, I am trying to re-estimate parameters and standard errors in a mean regression equation by simultaneously running a GARCH (1,1) variance equation. This should be relatively straightforward, but I cannot for the life of me get it to work. This has taken up several weeks of my life

[R] Difference in coefficients in Cox proportional hazard estimates between R and Stata, why?

2014-05-30 Thread Hiyoshi, Ayako
Dear R users, Hi, thank you so much for your help in advance. I have been using Stata but new to R. For my paper revision using Aalen's survival analysis, I need to use R, as the command including Aalen's survival seems to be available in R (32-bit, version 3.1.0 (2014-04-10)) but less ready

Re: [R] Problem with sample session

2014-05-30 Thread Ista Zahn
On May 29, 2014 9:45 PM, Stephen Meskin actu...@umbc.edu wrote: Thanks Greg for your response. Is there a work around? A work around for what? Of course this begs the question as to Why is attach part of the sample session in App. A of the introductory manual? Because people find it

[R] using model coefficients on a new data set

2014-05-30 Thread Erin Hodgess
Hello again R People: I fit an ARIMA model on a particular data set with x_1, ,x_n. Point x_(n+1) becomes available. I now want to produce a forecast without updating the model. Is there a way to do that within R, or do I need to write my own function, please? Thanks! Sincerely, erin

[R] rJava fail

2014-05-30 Thread Bond, Stephen
R version 3.1.0 (2014-04-10) -- Spring Dance Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) library(rJava) Error : .onLoad failed in loadNamespace() for 'rJava', details: call: dirname(this$RuntimeLib) error: a character vector

[R] Computer requirements to run R on huge datasets

2014-05-30 Thread Magdalena Kapelko
Dear R users, I am writing to ask your advice with regard to the computer requirements (RAM, architecture, processor, hard drive) in order to run R smoothly on large datasets. I will be running commands with many bootstrap replications (2000) on the datasets of 10 firms. Thank you in

Re: [R] Computer requirements to run R on huge datasets

2014-05-30 Thread Jeff Newmiller
You have given information related to the number of rows that will be involved, but have offered nothing about the number of columns. That is okay though... you should attempt your algorithms on progressively larger datasets to gauge how your problem scales and use your operating system to

Re: [R] Difference in coefficients in Cox proportional hazard estimates between R and Stata, why?

2014-05-30 Thread Göran Broström
In the Cox regression case, the probable explanation is that you have ties in your data; Stata and coxph may have different defaults for handling ties. Read the manuals! The difference in sign in the other cases is simply due to different definitions of the models. I am sure it is well

[R] accessing C code from a base package within a function

2014-05-30 Thread Erin Hodgess
Hello yet again. I have written a small function which calls a couple of the C programs from the stats base package. It's actually a modification of the arima function. However, when I try to run it, it says that the C program is not found. Any suggestions would be much appreciated. Windows

Re: [R] rJava fail

2014-05-30 Thread Simon Urbanek
On May 30, 2014, at 9:55 AM, Bond, Stephen stephen.b...@cibc.com wrote: R version 3.1.0 (2014-04-10) -- Spring Dance Copyright (C) 2014 The R Foundation for Statistical Computing Platform: i386-w64-mingw32/i386 (32-bit) library(rJava) Error : .onLoad failed in loadNamespace() for

Re: [R] Problem with sample session

2014-05-30 Thread Greg Snow
If you pay attention and are careful not to use any variables names that conflict then you do not need a work around (and the conflicts function can help you see if there are any conflicts that you may need to worry about). Probably the best work around is to use the with or within function

[R] Gui for R-Script

2014-05-30 Thread Shane Carey
Hi, I'm just looking into creating a GUI for my R-Script. Is it possible to create a gui for the script and send it to somebody? Maybe as a .exe for example Thanks -- Shane [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Gui for R-Script

2014-05-30 Thread Greg Snow
There are several options for creating GUIs depending on how much control you want and how much work you are willing to put in. One simple option is the tkexamp function in the TeachingDemos package. This approach would require whoever receives your script to have R running, but then they could

Re: [R] Gui for R-Script

2014-05-30 Thread Jeff Newmiller
Possible, yes, anything is possible, but it your goal is to easily hide R from the users then you will probably not find the project worth the effort required. --- Jeff NewmillerThe .

[R] missing return

2014-05-30 Thread hieu
hi R user, i have a problem about missing data while i calculate return in times series. It means my time series have a lot of code of stocks, i arrange them as type of panel data. I don't look for any solution. For example: CODE DATE RETURN A 2008 NA A 2009 0.25 A 2010

[R] EpiX Analytics - Quantitative Risk Analysis with R Course

2014-05-30 Thread Barbara ONeill
There are still a few places available to attend the following course: Quantitative Risk Analysis with R Fort Collins, Colorado, USA June 16-19, 2014 This 4-day course will cover the core principles of quantitative risk analysis and the most important risk modeling principles and techniques. The

[R] RODBC and PosgreSQL problems

2014-05-30 Thread Fraser D. Neiman
Dear All, I am trying for the first time to run SQL queries against a remote PostgreSQL database via RODBC. I am able to establish a connection just fine, as shown by getting results back from the sqlTables(), sqlColumns() and sqlPrimary Key() functions in RODBC. However, when I try to run a

Re: [R] missing return

2014-05-30 Thread hieu
-- View this message in context: http://r.789695.n4.nabble.com/missing-return-tp4691489p4691490.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

Re: [R] missing return

2014-05-30 Thread hieu
-- View this message in context: http://r.789695.n4.nabble.com/missing-return-tp4691489p4691493.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

Re: [R] Problem with sample session

2014-05-30 Thread Stephen Meskin
Greg, Ista, (or anyone else), Let me take one last run at this problem. Consider the following extract from the Appendix A text: x - 1:20 w - 1+sqrt(x)/2 dummy - data.frame(x=x, y=x+rnorm(x)*w) fm - lm(y~x, data=dummy) fm1 - lm(y~x, data=dummy, weight=1/w^2) attach(dummy) /Make the

Re: [R] Problem with sample session

2014-05-30 Thread Ista Zahn
Hi Stephen, See in line. On Fri, May 30, 2014 at 4:18 PM, Stephen Meskin actu...@umbc.edu wrote: Greg, Ista, (or anyone else), Let me take one last run at this problem. Consider the following extract from the Appendix A text: x - 1:20 w - 1+sqrt(x)/2 dummy - data.frame(x=x,

[R] Calculating the focal mean of a raster using an annulus

2014-05-30 Thread Parks, Sean -FS
Hello esteemed R experts, I am attempting the use the 'focal' function in the raster package to calculate the mean of an annulus (as opposed to a focal mean of a circle or square). From what I can tell, this requires me to generate a weights matrix and use this matrix in the focal function.

Re: [R] Problem with sample session

2014-05-30 Thread Jeff Newmiller
1. If you create a variable x or w or dummy, it is stored in the current environment. You can refer to it by the name x or w or dummy. If you create a column x in the data frame dummy, you can refer to it as dummy$x or dummy[[x]]. That is a different x than the variable x in your current

[R] converting a data.frame into a different table

2014-05-30 Thread Assa Yeroslaviz
Hi, I have a matrix of 4.5Kx4.5K elements with column- and row names I need to convert this matrix into a table, where one column is the name of the row for the element, the second column is the name of the column for the same element and the third column is the element itself. The way I do it

Re: [R] converting a data.frame into a different table

2014-05-30 Thread Jeff Newmiller
library(reshape2) # you probably need to install reshape2 before this works ?melt --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#.

Re: [R] converting a data.frame into a different table

2014-05-30 Thread David Winsemius
On May 30, 2014, at 3:07 PM, Assa Yeroslaviz wrote: Hi, I have a matrix of 4.5Kx4.5K elements with column- and row names I need to convert this matrix into a table, where one column is the name of the row for the element, the second column is the name of the column for the same element

Re: [R] converting a data.frame into a different table

2014-05-30 Thread arun
Hi, You may try: ##Assuming the dataset is a matrix mat - structure(c(FBgn0037249, FBgn0036389, FBgn0014002, FBgn0034201, FBgn0029860, FBgn0028526, FBgn0003486, FBpp0312226, FBpp0312225, FBpp0312224, FBpp0312223, FBpp031, FBpp0312221, FBpp0312220, FBtr0346646, FBtr0346645, FBtr0346644,