[R] local minima/ maxima

2011-12-04 Thread Tonja Krueger
__ 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, reproducible code.

[R] about error while using anova function

2011-12-04 Thread narendarreddy kalam
fit1<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc) fit2<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.5,data=wbc) fit3<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp6+inp7+inp8+inp9,tau=0.15,data=wbc) fit4<-rq(formula=op~inp1+inp2+inp3+inp4+inp5+inp

[R] about interpretation of anova results...

2011-12-04 Thread narendarreddy kalam
quantreg package is used. *fit1 results are* Call: rq(formula = op ~ inp1 + inp2 + inp3 + inp4 + inp5 + inp6 + inp7 + inp8 + inp9, tau = 0.15, data = wbc) Coefficients: (Intercept) inp1 inp2 inp3 inp4 inp5 -0.191528450 0.005276347 0.021414032 0.016

Re: [R] similarity matrix

2011-12-04 Thread set
I'm sorry, I made a mistake in my example. you're right. I don't really know how a similarity alogrithm worksbut I'm willing to try that...are there any good examples available? Thank you -- View this message in context: http://r.789695.n4.nabble.com/similarity-matrix-tp4157576p4159547.html S

[R] Toggle cASE

2011-12-04 Thread Tonio
Hello R-help list,   I am looking for way to toggle the case of the characters like a flip-flop; that is from ''Hello'' to "hELLO" or vice versa.   I know that there are a number of functions like casefold, tolower, toupper, etc. but these functions change the case in an uniform way.   Thanks in

Re: [R] Extract last 3 characters from numeric vector

2011-12-04 Thread Kang Min
Thanks Sarah, but I discovered that numbers like 3.0 only have 1 character, so I had a range of character lengths from 1 to 4 (e.g. 17.0 has 2 characters, 3.4 has 3 and 12.4 has 4). Uwe's method worked well. Thanks again. Kang Min On Dec 4, 11:42 pm, Uwe Ligges wrote: > On 04.12.2011 14:38, Kan

Re: [R] a weird question about gdata:::

2011-12-04 Thread Gabor Grothendieck
On Sun, Dec 4, 2011 at 8:07 PM, Jeff Newmiller wrote: > I prefer to think of namespaces as preventing clashes with similarly-named > functions in the main workspace or in other packages that might serve a > different need. > > Given that purpose, I don't think I would have confined that particul

[R] Persp3d freezes when run from within Python

2011-12-04 Thread wchips
G'day everyone, I've been trying to get an interactive OpenGL plot to work from within Python 2.6 using Rpy2 and the persp3d function. The problem is that the plot seems to freeze upon activation. All interactivity is lost even though it works fine when run from within the R console (version 2.11.

Re: [R] Prediction from censReg?

2011-12-04 Thread z2.0
Just posting again here... -- View this message in context: http://r.789695.n4.nabble.com/Prediction-from-censReg-tp4155855p4158844.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/

[R] [rggobi] ggplot like pdf output

2011-12-04 Thread =)
Good day everyone. I have a question concerning *ggobi* and *rggobi*package. I am using R version 2.13.2 and Ubuntu 11.04. I am new to ggobi and I'm reading the book *Interactive and Dynamic Graphics for Data Analysis *. The book was published 2007. My question is: how can I export a graph for *rg

[R] Rggobi pdf output

2011-12-04 Thread =)
Good day everyone. I have a question concerning *ggobi* and *rggobi*package. I am using R version 2.13.2 and Ubuntu 11.04. I am new to ggobi and I'm reading the book *Interactive and Dynamic Graphics for Data Analysis *. The book was published 2007. My question is: how can I export a graph for *rg

Re: [R] equating approximate values

2011-12-04 Thread vamshi999
this is exactly what i wanted. How to i select only the minimum value from this?. thank you My apologies: you need an abs() call as well: which(abs(outer(x, y, "-")) < threshold, arr.ind = TRUE) Michael -- View this message in context: http://r.789695.n4.nabble.com/equating-approxim

[R] Save debugging session info and resume from the middle?

2011-12-04 Thread Michael
Hi all, In debugging, I've met the following problem: myfunction = function (x, y) { for (i in 1:length(x)} { Part_A; #save the debugging session here? Part_B; } } All these parts are of very heavy computations and often can take hours to finish. How do I debug them efficientl

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread Ben Bolker
Jorge I Velez gmail.com> writes: > And remember: > > #install.packages('fortunes') > require(fortunes) > fortune('Yoda') > > Evelyn Hall: I would like to know how (if) I can extract some of the > information > from the summary of my nlme. > Simon Blomberg: This is R. There is no if. Only how. >

[R] convert table to a string in matrix

2011-12-04 Thread Philipp Chapkovski
Hello everybody! I need help in collecting the information about Russian elections. There is a table at the web-site http://www.moscow_city.vybory.izbirkom.ru/region/region/moscow_city?action=show&root=774003008&tvd=477400389537&vrn=100100028713299®ion=77&global=true&sub_region=77&prver=0&pronetvd

Re: [R] a weird question about gdata:::

2011-12-04 Thread Jeff Newmiller
I prefer to think of namespaces as preventing clashes with similarly-named functions in the main workspace or in other packages that might serve a different need. Given that purpose, I don't think I would have confined that particular function behind the namespace, because any other use of that

Re: [R] a weird question about gdata:::

2011-12-04 Thread Gabor Grothendieck
On Sun, Dec 4, 2011 at 6:57 PM, Rolf Turner wrote: > > See end of message. > > > On 05/12/11 10:19, Erin Hodgess wrote: >> >> Dear R People: >> >> If I put in: >> >>> findPerl >> >> Error: object 'findPerl' not found >> >> >> But if I use: >> >>> gdata:::findPerl >> >> function (perl, verbose = "F

Re: [R] a weird question about gdata:::

2011-12-04 Thread Rolf Turner
See end of message. On 05/12/11 10:19, Erin Hodgess wrote: Dear R People: If I put in: findPerl Error: object 'findPerl' not found But if I use: gdata:::findPerl function (perl, verbose = "FALSE") { errorMsg<- "perl executable not found. Use perl= argument to specify the correct p

Re: [R] equating approximate values

2011-12-04 Thread R. Michael Weylandt
My apologies: you need an abs() call as well: which(abs(outer(x, y, "-")) < threshold, arr.ind = TRUE) Michael On Sun, Dec 4, 2011 at 6:25 PM, R. Michael Weylandt wrote: > Not sure what to make of the fact that your x, y are of different > lengths: if you mean to check all possible pairings, th

Re: [R] equating approximate values

2011-12-04 Thread R. Michael Weylandt
Not sure what to make of the fact that your x, y are of different lengths: if you mean to check all possible pairings, this is probably what you need: which(outer(x, y, "-") < threshold, arr.ind = TRUE) Michael On Sun, Dec 4, 2011 at 2:24 PM, andrija djurovic wrote: > Hi. Maybe this can help yo

[R] RODBC sqlSave / append problem (windows XP, R 2.13.2)

2011-12-04 Thread mattjo
Dear All, Using RODBC I have read in a (429 x 11) dataframe from Access, and would like to append two columns of transformed data (429 x 2) to the original table (thereby making it a 429 x 13 table). I would ideally like this to be the same name etc as the original table in Access. I have used

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Bert Gunter
... with() is useful here: e.g. in base R, simply tapply() or ave() with with() with(df,ave(x, comn,mi, FUN = sd)) -- Bert On Sun, Dec 4, 2011 at 1:07 PM, John Kane wrote: > ?aggregate should do it > > aggregate(df$x,list(df$comn, df$mi), sd) > > There are other ways of course > > Using the

Re: [R] a weird question about gdata:::

2011-12-04 Thread Bert Gunter
??namespace ?getAnywhere ?"::" See also: http://www.stat.uiowa.edu/~luke/R/namespaces/morenames.pdf Bottom line: namespaces provide a mechanism to "hide" certain variables within a package. Special measures as documented above are required to view them -- Bert On Sun, Dec 4, 2011 at 1:19 PM,

Re: [R] Estimation of AR(1) Model with Markov Switching

2011-12-04 Thread Ingmar Visser
I did not quite get what the problem was from your description ... However, I did search on CRAN and found at least two packages that can fit markov switching ar models so that may be an easier way to go. Hth, Ingmar On Thu, Dec 1, 2011 at 5:58 PM, napps22 wrote: > Dear R users, > > I have been

[R] a weird question about gdata:::

2011-12-04 Thread Erin Hodgess
Dear R People: If I put in: > findPerl Error: object 'findPerl' not found But if I use: > gdata:::findPerl function (perl, verbose = "FALSE") { errorMsg <- "perl executable not found. Use perl= argument to specify the correct path." if (missing(perl)) { perl = "perl" }

[R] trouble with installXLSXsupport()

2011-12-04 Thread Erin Hodgess
Dear R People: I'm using gdata and read.xls for a couple of projects. When I load gdata, it says to run installXLSXsupport() When I do that, I get a "not responding" error. I tried it with verbose=TRUE, but nothing appears. Has anyone else run into this, please? This is on Windows 7, 64 bit,

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread John Kane
?aggregate should do it aggregate(df$x,list(df$comn, df$mi), sd) There are other ways of course Using the reshape2 package library(reshape2) x1 <- melt(df, id=c("comn", "mi")) dcast(x1, comn + mi ~ variable, sd) --- On Sun, 12/4/11, Aurélien PHILIPPOT wrote: > From: Aurélien PHILIPPOT >

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Pete Brecknock
Aurélien PHILIPPOT wrote > > Dear R-experts, > I am struggling with the following problem, and I am looking for advice > from more experienced R-users: I have a data frame with 2 identifying > variables (comn and mi), and an output variable (x). comn is a variable > for > a company and mi is a va

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Aurélien PHILIPPOT
exactly like that! thanks a lot. Aurelien 2011/12/4 Felipe Carrillo > Like this? > library(plyr) > ddply(df,.(comn,mi),summarise,stDEV=sd(x)) > > Felipe D. Carrillo > Supervisory Fishery Biologist > Department of the Interior > US Fish & Wildlife Service > California, USA > http://www.fws.gov/

Re: [R] Group several variables and apply a function to the group

2011-12-04 Thread Felipe Carrillo
 Like this? library(plyr) ddply(df,.(comn,mi),summarise,stDEV=sd(x)) Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA http://www.fws.gov/redbluff/rbdd_jsmp.aspx From: Aurélien PHILIPPOT >To: R-help@r-project.org >Sent: Sunda

[R] Group several variables and apply a function to the group

2011-12-04 Thread Aurélien PHILIPPOT
Dear R-experts, I am struggling with the following problem, and I am looking for advice from more experienced R-users: I have a data frame with 2 identifying variables (comn and mi), and an output variable (x). comn is a variable for a company and mi is a variable for a month. comn<-c("abc", "abc"

Re: [R] Vectorization instead of loops problem

2011-12-04 Thread Bert Gunter
Inline below On Sun, Dec 4, 2011 at 10:29 AM, Costas Vorlow wrote: > Dear Bert, > > You are right (obviously). > > Apologies for any inconvenience caused.  I thought my problem was simplistic > with a very obvious answer which eluded me. > > As per your justified questions : > > 2: Answer is "all

Re: [R] similarity matrix

2011-12-04 Thread B77S
I apologize to the list and you if I am mis-understanding something, but... As an example: ind2 occurs with ind1 only in cluster#3, so why does it get a value of 4 in your "similarity" matrix? Also, if this isn't a recognized similarity algorithm, perhaps you should at the very least put quotes a

Re: [R] equating approximate values

2011-12-04 Thread andrija djurovic
Hi. Maybe this can help you (you can try additionally to incorporate threshold): > set.seed(1) > x<-rnorm(10,10,1) > values <- sample(1:10,10) #values that we are looking for > mat <- matrix(c(x,values),ncol=2) > > closest<-function(x,values)#function is an example from The R book (Crawley) +

Re: [R] RODBC connect to Excel (64-bit Windows 7)

2011-12-04 Thread andrija djurovic
Hi. Not specifically, but I used it before with 32-bit R under Windows XP and it worked just fine so i though to keep using it.Anyway I will lookt at XLConnect. Thank you for suggestion. Andrija On Sun, Dec 4, 2011 at 7:41 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > Do you nee

Re: [R] RODBC connect to Excel (64-bit Windows 7)

2011-12-04 Thread R. Michael Weylandt
Do you need to use RODBC specifically? I've been using XLConnect quite a lot recently and have been quite pleased with it. Michael On Dec 4, 2011, at 9:40 AM, andrija djurovic wrote: > Hi to all. > I have a problem to connect to an Excel database using RODBC. > Namely, I am using 64-bit R 2.1

[R] similarity matrix

2011-12-04 Thread set
Hello R-users, I've got a file with individuals as colums and the clusters where they occur in as rows. And I wanted a similarity matrix which tells me how many times each individual occurs with another. My eventual goal is to make Venn-diagrams from the occurence of my individuals. So I've this:

[R] equating approximate values

2011-12-04 Thread vamshi999
Hello List, I am having trouble finding the command for my problem. I have two arrays x and y. now i would like to compare the values of x and y and then get the index of x which is exactly or approximately equal(+/- some value ) to the values in y. x <- runif(100,min=0,max=5) y <- runif(10,m

Re: [R] Vectorization instead of loops problem

2011-12-04 Thread Costas Vorlow
Dear Bert, You are right (obviously). Apologies for any inconvenience caused. I thought my problem was simplistic with a very obvious answer which eluded me. As per your justified questions : 2: Answer is "all", hence: 3. would be include overlapping set (I guess) but this does not matter fo

Re: [R] Export cols to single csv files

2011-12-04 Thread B77S
just use indexing. without doing it all for you... df <- structure(list(AA = c(0.3, 0.1, 0.6), BB = c(0.9, 0.4, 0.2), CC = c(1, 0.8, 0.6), DD = c(0.7, 0.5, 0.5)), .Names = c("AA", "BB", "CC", "DD"), class = "data.frame", row.names = c(NA, -3L )) write.csv(df[,1], paste(colnames(df[1]), "csv

Re: [R] Polishing my geom_bar for publication

2011-12-04 Thread Aurelie Cosandey Godin
Sorry Dennis, Didn't realized I went off the list! I found a solution for one of my problem: removing x-axis label! with this code: ggplot(Final2, aes(x=spp, y=WPUE, fill=season)) + geom_bar(position=position_dodge()) + geom_errorbar(aes(ymin=WPUE-wpue.se, ymax=WPUE+wpue.se), size=.3,width=.2,p

Re: [R] problem merging data with different shapes

2011-12-04 Thread B77S
Please use dput() to post your example data sets. dput(Adata) dput(Bdata) **then copy and paste the results of each so that we can "play" around with it easily. Miriam -2 wrote > > I have been trying to merge datasets, one of which has a long format > (Adata) and one has a (different) long f

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread Jorge I Velez
Hi e eeyore, Here is one way: fx <- function(x, m) x*2/(3*m)*(1-x/(3*m)) foo <- function(m) integrate(fx, m = m, lower = 0, upper = 3*m)$value foo(3) # 3 foo(2) # 2 And remember: #install.packages('fortunes') require(fortunes) fortune('Yoda') Evelyn Hall: I would like to know how (if) I can ex

[R] How to write (complex) coercion methods or "what's the reason to limit 'setAs()' the way it is limited"?

2011-12-04 Thread Janko Thyson
Dear list, I'd like to write coercion methods for some of my Reference Classes. However, using 'setAs()' is not a real option as its argument 'def' only allows for functions depending on one single argument. In some cases, that is simply too much of a limitation for me. And I don't really see

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread e eeyore
I know that is not Mhatematica, my question is only is it possible, it seams its not.. Sorry if I did not get it, I can interprete different your answer, not intentionally.. Thanks for your answer and patience. On Sun, Dec 4, 2011 at 5:15 PM, David Winsemius wrote: > > On Dec 4, 2011, at 11:04

[R] prediction in "conmode" class of Nonparametric binary models

2011-12-04 Thread shyam basnet
Dear R users, Is it possible to apply 'predict' to an object of class "conmode"?  Could you please suggest me any applicable method for 'predict' for the "conmode" class? Thanking you, Sincerely Yours, Shyam Kumar Basnet SLU, Uppsala Sweden [[alternative HTML version deleted]] __

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread David Winsemius
On Dec 4, 2011, at 11:04 AM, e eeyore wrote: > > > On Sun, Dec 4, 2011 at 4:47 PM, David Winsemius > wrote: > > You almost did write it in R. You just left the "m" unspecified. If > you replace "m" by 5 the code works. > > Check how wolfram work with same integral, I dont need to replace > a

Re: [R] Programming Statistical Functions

2011-12-04 Thread David Winsemius
On Dec 4, 2011, at 9:27 AM, gvjones wrote: Hello, Did you find anything helpful for calculating the statistical functions in your list. I would like to also calculate these and have been looking for some code to do so. A search at the site linked by the R function RSiteSearch() produce

Re: [R] Complex multiple t tests in a data frame with several id factors

2011-12-04 Thread Kaiyin Zhong
Okay, thank you. On Mon, Dec 5, 2011 at 12:01 AM, Bert Gunter wrote: > The concentrations of the different metals within an animal are > correlated, so that doing as you suggest will almost certainly result > in nonsense P values. So I suggest you seek local statistical help or, > failing that, p

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread e eeyore
On Sun, Dec 4, 2011 at 4:47 PM, David Winsemius wrote: > > You almost did write it in R. You just left the "m" unspecified. If you > replace "m" by 5 the code works. > Check how wolfram work with same integral, I dont need to replace anything.. http://www.wolframalpha.com/input/?i=integrate+x*2%2

Re: [R] Complex multiple t tests in a data frame with several id factors

2011-12-04 Thread Bert Gunter
The concentrations of the different metals within an animal are correlated, so that doing as you suggest will almost certainly result in nonsense P values. So I suggest you seek local statistical help or, failing that, post on a statistical forum like stats.stackexchange.com . There are various

Re: [R] Logistic Regression with genetic component

2011-12-04 Thread Ben Bolker
Danielle Duncan alaska.edu> writes: > Greetings, I have a question that I'd like to get input on. I have a > classic toxicology study where I artificially fertilized and exposed > embryos to a chemical and counted defects. In addition, I kept track of > male-female pairs that I used to artificial

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread David Winsemius
On Dec 4, 2011, at 9:52 AM, e eeyore wrote: > This is not homework, I calculate some expectations and to finish > that I must solve integral like this one.. > Upper bound have some unknown parameter, but I dont know how to > write it in R. You almost did write it in R. You just left the "m"

Re: [R] Vectorization instead of loops problem

2011-12-04 Thread Bert Gunter
Costas: (and thanks for giving us your name) which(x == 1) gives you the indices where x is 1 (up to floating point equality -- you did not specify whether your x values are integers or calculated as floating point, and that certainly makes a difference). You can then use simple indexing to get t

Re: [R] Extract last 3 characters from numeric vector

2011-12-04 Thread Uwe Ligges
On 04.12.2011 14:38, Kang Min wrote: Hi all, I have a numeric vector with 1 decimal place, and I'd like to extract the last 3 characters, including the decimal point. The vector ranges from 0 to 20. x<- round(runif(100)*20, digits=1) formatC(round(x%%10, 1), format="f", digits=1) Uwe Ligg

Re: [R] Vectorization instead of loops problem

2011-12-04 Thread Gabor Grothendieck
On Sun, Dec 4, 2011 at 10:18 AM, Costas Vorlow wrote: > Hello, > > I am having problems vectorizing the following (i/o using a for/next/while > loop): > > I have 2 sequences such as: > > x, y > 1, 30 > 2, -40 > 0, 50 > 0, 25 > 1, -5 > 2, -10 > 1, 5 > 0, 40 > > etc etc > > The first sequence (x) ta

[R] Complex multiple t tests in a data frame with several id factors

2011-12-04 Thread Kaiyin Zhong
I have assayed the concentrations of various metal elements in different anatomic regions of two strains of mice. Now, for each element, in each region, I want to do a t test to find whether there is any difference between the two strains. Here is what I did (using simulated data as an example):

Re: [R] Vectorization instead of loops problem

2011-12-04 Thread Costas Vorlow
Thanks Uwe. What happens if these are zoo (or time series) sequences/dataframes? \ I think your solution would apply as well, no? Thanks again & best wishes, Costas 2011/12/4 Uwe Ligges > > > On 04.12.2011 16:18, Costas Vorlow wrote: > >> Hello, >> >> I am having problems vectorizing the follo

Re: [R] upper bound in the integrate function depends on a parameter

2011-12-04 Thread e eeyore
This is not homework, I calculate some expectations and to finish that I must solve integral like this one.. Upper bound have some unknown parameter, but I dont know how to write it in R. Do I must define m like symbol, or something else, just need help with that. I know how this work in MatLab, b

Re: [R] Extract last 3 characters from numeric vector

2011-12-04 Thread Sarah Goslee
You can use nchar() to get the length of the string, and use that in substring: mynum <- as.character(15.6) > substring(mynum, nchar(mynum)-2, nchar(mynum)) [1] "5.6" On Sun, Dec 4, 2011 at 8:38 AM, Kang Min wrote: > Hi all, > > I have a numeric vector with 1 decimal place, and I'd like to extr

Re: [R] Programming Statistical Functions

2011-12-04 Thread gvjones
Hello, Did you find anything helpful for calculating the statistical functions in your list. I would like to also calculate these and have been looking for some code to do so. Thanks -- View this message in context: http://r.789695.n4.nabble.com/Programming-Statistical-Functions-tp2307880p41570

[R] problem merging data with different shapes

2011-12-04 Thread Miriam
I have been trying to merge datasets, one of which has a long format (Adata) and one has a (different) long format (Bdata): Adata Bdata subject order bpm subject order trial agegroup gender 1 1 70.21 1 3 2

[R] Extract last 3 characters from numeric vector

2011-12-04 Thread Kang Min
Hi all, I have a numeric vector with 1 decimal place, and I'd like to extract the last 3 characters, including the decimal point. The vector ranges from 0 to 20. x <- round(runif(100)*20, digits=1) Some of numbers have 3 characters, and some have 4. I've read up on the substr() function but that

[R] Linear quadratic Gaussian control with Kalman filter

2011-12-04 Thread nserdar
I need to generate Linear quadratic Gaussian control with Kalman filter in R programming. I only get matlab code. I think that R portfolio optimisation code ( quad..) is not adequate for this topic. Linear quadratic Gaussian control with Kalman filter http://en.wikipedia.org/wiki/Linear_quad

Re: [R] Vectorization instead of loops problem

2011-12-04 Thread Uwe Ligges
On 04.12.2011 16:18, Costas Vorlow wrote: Hello, I am having problems vectorizing the following (i/o using a for/next/while loop): I have 2 sequences such as: x, y 1, 30 2, -40 0, 50 0, 25 1, -5 2, -10 1, 5 0, 40 etc etc The first sequence (x) takes integer numbers only: 0, 1, 2 The sequen

[R] Polishing my geom_bar for publication

2011-12-04 Thread Aurelie Cosandey Godin
Dear list, I am new with ggplot2 and I have spend quiet some time putting together the following code to create the attached plot. However there's still a few things that I'm having trouble with! I would be grateful if someone can tell me how to fix (1) the colour of my bars into grey scales (2

[R] Vectorization instead of loops problem

2011-12-04 Thread Costas Vorlow
Hello, I am having problems vectorizing the following (i/o using a for/next/while loop): I have 2 sequences such as: x, y 1, 30 2, -40 0, 50 0, 25 1, -5 2, -10 1, 5 0, 40 etc etc The first sequence (x) takes integer numbers only: 0, 1, 2 The sequence y can be anything... I want to be able to

Re: [R] Programming Statistical Functions

2011-12-04 Thread B77S
As Stephen pointed out, this is easy to do. The word file the OP posted has all the necessary formulae. Now you just need to learn how to convert those formulae into R functions Stephen gave you an example of how to create a function for CV. Now run with it. perhaps something like this is w

[R] LaTeX output for summary.lm object - while displaying the information outside the table

2011-12-04 Thread Tal Galili
This seemed to me to be basic, but I can't seem to find a solution online, so I wondered what I might be missing. I wish to include the output of an lm summary object inside an Sweave (.Rnw) document. I can either output the summary.lm as is, or use the xtable/Hmisc packages (through xtable or lat

[R] RODBC connect to Excel (64-bit Windows 7)

2011-12-04 Thread andrija djurovic
Hi to all. I have a problem to connect to an Excel database using RODBC. Namely, I am using 64-bit R 2.14.0, under Windows 7 and I tried following: library(RODBC) > channel <- odbcConnectExcel("results.xlsx") Error in odbcConnectExcel("results.xlsx") : odbcConnectExcel is only usable with 32-bit

Re: [R] xyplot squeezed together

2011-12-04 Thread Sarah Goslee
You specified the aspect ratio, so your plots must have that ratio of width to height. It looks like you are trying to control layout by specifying aspect ratio? That, as you've discovered, is an ineffective way to do it. Instead, you should specify layout directly, using for your example layout=

Re: [R] density function always evaluating to zero

2011-12-04 Thread Sarah Goslee
I didn't try out your extensive code, but here's one potentially serious problem: You only pass two arguments to f(), alpha and h, but within f you nonetheless use x1 and y and several other things. This is bad practice, and dangerous: you should pass all the necessary arguments to f(), not rely o

Re: [R] problems using the thin plate spline method

2011-12-04 Thread Sarah Goslee
Hello, On Sun, Dec 4, 2011 at 8:08 AM, Mintewab Bezabih wrote: > Dear R users and Jeff, > > Sorry for not being quite explicit in my earlier message. And you are still not explicit. We have no idea what you've done. > My main problem is while my data seem to be read into R well (I manage to >

Re: [R] problems using the thin plate spline method

2011-12-04 Thread Mintewab Bezabih
Dear R users and Jeff, Sorry for not being quite explicit in my earlier message. My main problem is while my data seem to be read into R well (I manage to graph them and all), I cannot get the following line to work. tpsfit <- Tps(cbind(x1, x2), y, scale.type="unscaled") and I get the follow

Re: [R] density function always evaluating to zero

2011-12-04 Thread napps22
Sorry that was my poor copying and pasting. Here's the correct R code. The problem does seem to be with the function I define as f. # Model selection example in a bayesian framework # two competiting non-nested models # M0: y_t = alpha * x1^2 + e_t # M1: y_t = beta * x1^4 + e_t # where e_t ~ iidN(

Re: [R] pivot table help

2011-12-04 Thread set
Thank you very much! works perfectly! -- View this message in context: http://r.789695.n4.nabble.com/pivot-table-help-tp4155144p4156393.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.eth

[R] frequency table?

2011-12-04 Thread set
Hello R-users, I've got a file with individuals as colums and the clusters where they occur in as rows. And I wanted a table which tells me how many times each individual occurs with another. I don't really know how such a table is called...it is not a frequency tableMy eventual goal is to mak

Re: [R] Data Analysis for Gas Prices

2011-12-04 Thread John
On Sat, 3 Dec 2011 14:11:39 -0800 (PST) inferno846 wrote: ... > > Also, could anyone help me figure out how to import a data table to > R? When I try to create a .txt file from a word document and read it > in R, the format of the first column always messes up. Any/all help > is appreciated. >

[R] xyplot squeezed together

2011-12-04 Thread syrvn
Hi, I created the following example of a xyplot. The plot actually looks ok apart from that the x-axis is pretty squeezed/clinched. I tried aspect="fill" already but I want to have all 3 sub plots next to each other. I tried loads of different scaling varieties but with no significant result...