Re: [R] book about "support vector machines"

2010-12-03 Thread km
a bit of caution. the latest version of libsvm is not yet available in the e1071 R-package. regards, KM On Fri, Dec 3, 2010 at 9:52 PM, Georg Ruß wrote: > On 03/12/10 16:23:33, manuel.martin wrote: > > I am currently looking for a book about support vector machines for > > regression and class

[R] Fwd: Maximum Number of Rows in a Dataframe

2010-12-03 Thread Rushabh Mehta
Thank you for help...I could find a solution..it was a simple syntax error -- Forwarded message -- From: Michael Bedward Date: Fri, Dec 3, 2010 at 7:07 PM Subject: Re: [R] Maximum Number of Rows in a Dataframe To: rushabhbm Cc: r-help@r-project.org Hello, Please post a sample

Re: [R] knowing the code-number of factors in a vector

2010-12-03 Thread Ben Bolker
Eduardo Klein usb.ve> writes: > I would like to know how R assigns the numeric code to a set of factors > in a vector. [snip] > It is indeed alphabetical by default. To get it in order of appearance you could do something like set.seed(1001) x <- sample(letters[1:5],50,replace=TRUE)

Re: [R] How to specify a fixed intercept for linear model

2010-12-03 Thread Michael Bedward
The offset arg is your friend... x <- 1:10 y <- 42 + 2*x + rnorm(length(x), 0, 0.5) # we suspect the intercept might be 42 ! lm( y ~ 0 + x, offset=rep(42, length(x))) Michael On 4 December 2010 13:42, cborley87 wrote: > > Hi, > > Im fitting some simple linear models to data from the olympic r

Re: [R] Non-visible functions: merge.data.table

2010-12-03 Thread jim holtman
It would help if you gave some specifics of what you are trying to do. What is the structure of the data.tables you are merging, how long did it take, have you compared the times between the base merge and the data.table merge? How fast is "fast"? What are your expectations? Can you provide a s

Re: [R] Non-visible functions: merge.data.table

2010-12-03 Thread jim holtman
getAnywhere("merge.data.table") On Fri, Dec 3, 2010 at 5:38 PM, Ryan Garner wrote: > > I've downloaded the "data.table" package from CRAN and R-Forge and still > can't utilize merge.data.table for faster merges. How do I make this > function visible? > >> install.packages("data.table",repos="http

[R] Non-visible functions: merge.data.table

2010-12-03 Thread Ryan Garner
I've downloaded the "data.table" package from CRAN and R-Forge and still can't utilize merge.data.table for faster merges. How do I make this function visible? > install.packages("data.table",repos="http://R-Forge.R-project.org";) trying URL 'http://R-Forge.R-project.org/src/contrib/data.table_1.

[R] How to specify a fixed intercept for linear model

2010-12-03 Thread cborley87
Hi, Im fitting some simple linear models to data from the olympic running events with lm(Logtime~Logdistance), the models contain an intercept and one slope parameter. I have fitted a separate model for each years data and as the intercept changes very little between years i am trying to simpli

Re: [R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Paul Miller
Hi Peter,   Got it! My equivalent SAS code is as follows:   proc logistic data=mydata descending; model resp = price--dehydration3 /link=probit noint; run;   Thanks for the hint about the noint option. That'ts what I was missing.   PAul --- On Fri, 12/3/10, peter dalgaard wrote: From: peter dal

Re: [R] testing and ploting t-distribution!!!!! Thank you so much:)

2010-12-03 Thread Kjetil Halvorsen
see inline. On Fri, Dec 3, 2010 at 11:03 PM, <5...@queensu.ca> wrote: > Hi everyone, > > i don't get the qqplot which is used to test if the sample followed a > t-distribution? > > qqplot(qt(ppoints(z), df = 7.6), z, xlab = "Q-Q plot for t dsn") > qqline(z) > > what qt() means? what ppoints() me

Re: [R] testing and ploting t-distribution!!!!! Thank you so much:)

2010-12-03 Thread 5qy
Hi everyone, i don't get the qqplot which is used to test if the sample followed a t-distribution?  qqplot(qt(ppoints(z), df = 7.6), z, xlab = "Q-Q plot for t dsn") qqline(z) what qt() means? what ppoints() means?  I know qqnorm() will plots the data in the way of normal distribution. how to

[R] Does stats::cor use the underlying BLAS? 32- vs. 64-bit issue

2010-12-03 Thread Peter Langfelder
Hi all, I'm curious whether the standard correlation calculation implemented in stats::cor uses the underlying BLAS (at least in the default case use = "all.obs"). On a 32-bit linux system using R-2.11.1 compiled with GotoBLAS, stats::cor is as fast as matrix multiplication, so it would appear st

Re: [R] knowing the code-number of factors in a vector

2010-12-03 Thread Rainer Schuermann
It seems to be dependent upon the the character ("assigned alphabetically") which I found out by manually changing the order of appearance of the characters in rfactor; the colour would stick to the character "a", whether this appears first in rfactor or not. I as able to control the colours be

Re: [R] testing and ploting t-distribution

2010-12-03 Thread Michael Bedward
Hello Bill, Have a look at the example at the bottom of the help page for ?qqplot Michael On 4 December 2010 11:19, <5...@queensu.ca> wrote: > Hi there, > > > I am doing a test to see the the residual is distributed in the form of > t-distribution and trying to plot the residuals and the t-di

Re: [R] data.table query

2010-12-03 Thread Gabor Grothendieck
On Fri, Dec 3, 2010 at 6:38 PM, Santosh Srinivas wrote: > Hello Group, > > I need a modification in the data.table example to get my intended > result shown below ... is there a more simple way! > > dt <- data.table(A = rep(1:3, each=4), B = rep(1:4, each=3), C = rep(1:2, 6)) > dt[, transform(.SD,

[R] knowing the code-number of factors in a vector

2010-12-03 Thread Eduardo Klein
Hi, I would like to know how R assigns the numeric code to a set of factors in a vector. For example, I have a vector of 5 different factors in a random order, and I want a color-coded plot by factors: rfactor=as.factor(sample(letters[1:5], 50, replace=T)) rfactor [1] c c c d b a b d d a a e

[R] testing and ploting t-distribution

2010-12-03 Thread 5qy
Hi there, I am doing a test to see the the residual is distributed in the form of t-distribution and trying to plot the residuals and the t-distribution to compare in the graph.  Cheers, Bill  - Original Message - From: r-help-requ...@r-project.org Date: Wednesday, December 1, 2010

Re: [R] Maximum Number of Rows in a Dataframe

2010-12-03 Thread Rushabh Mehta
for(i in 1:lengthBD) { bdid1 = basicdata[i,] bdid = as.character(bdid1) dq = paste("'",bdid,"'",sep = "") dataquery = paste("select *","From Main_Data AS m JOIN Basic_Data AS b ON m.BD_ID = b.BD_ID JOIN Point_System_Name AS p ON b.psn_id = p.psn_id JOIN Trend_Location as tl ON b.tl_id = tl.tl_i

Re: [R] Maximum Number of Rows in a Dataframe

2010-12-03 Thread Michael Bedward
Hello, Please post a sample of your code so people here can understand what you are trying to do. Michael On 4 December 2010 11:00, rushabhbm wrote: > > Guys, > I am new to R so please excuse if I am not very clear. > > My problem is: I have a 'for' loop in which I am defining a Dataframe df >

Re: [R] "Nash Equilibrium"

2010-12-03 Thread Ravi Varadhan
No, Spencer. Nash-Sutcliff efficiency is due to John E. Nash. It is unrelated to game theory. The well-known Nash equilibrium in game theory is due to John Forbes Nash, Jr. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriat

[R] Maximum Number of Rows in a Dataframe

2010-12-03 Thread rushabhbm
Guys, I am new to R so please excuse if I am not very clear. My problem is: I have a 'for' loop in which I am defining a Dataframe df with a SQL query. First iteration gives a df with 31 rows(that's correct), however next iterations also gives me max rows as 31. It's kinda stuck at that value. I

Re: [R] "Nash Equilibrium"

2010-12-03 Thread Spencer Graves
Might something like "Nash-Sutcliffe Efficiency" be relevant? I found this as follows: library(sos) (n <- ???nash) # found 22 links in 11 packages Hope this helps. Spencer On 12/3/2010 3:25 PM, Ravi Varadhan wrote: I think Christophe Dutang is writing a package for generalized

[R] data.table query

2010-12-03 Thread Santosh Srinivas
Hello Group, I need a modification in the data.table example to get my intended result shown below ... is there a more simple way! dt <- data.table(A = rep(1:3, each=4), B = rep(1:4, each=3), C = rep(1:2, 6)) dt[, transform(.SD,D=mean(A)), by="B"] The result I want is below ... which is probabl

Re: [R] "Nash Equilibrium"

2010-12-03 Thread Ravi Varadhan
I think Christophe Dutang is writing a package for generalized Nash Equilibria models called "GNE". I am cc'ing him here. I don't know if there are other packages out there. Christophe would know. Ravi. --- Ravi Varadhan, Ph.D. Assistant Pr

[R] "Nash Equilibrium"

2010-12-03 Thread ivo welch
Dear R experts: I searched cran (and r-help) for "nash equilibrium" and "game" but nothing stuck out. has someone written a numerical nash optimizer for two players? player a has choices x1,x2,x3,... and cares about (maximizes) pa(x1,x2,x3,...,y1,y2,y3) player b has choices y1,y2,y3,..., and car

Re: [R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Paul Miller
Hi Bert and others,   I've also tried posting my question to a SAS list. I'm doing the analyses for my study in SAS and so would like to be able to keep everything in that program. Still not familiar enough with R to use it to complete the statistical analysis and reporting for a study. Working

Re: [R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread peter dalgaard
On Dec 3, 2010, at 22:42 , Paul Miller wrote: > > > Hello Everyone, > > I'm trying to use SAS to replicate some results obtained in R. I was > wondering if anyone call tell me the SAS equivalent of the code that appears > below. > > fm.glm.x <- glm(resp ~ . - 1, data = as.data.frame(mm

Re: [R] How to get 'R' to talk BACK to other languages / scripts??

2010-12-03 Thread Kjetil Halvorsen
see below. On Fri, Dec 3, 2010 at 3:23 PM, Mike Williamson wrote: > Hey everyone, > >    I know that I can call 'R' from other scripts, and that I can make > command calls from 'R' (e.g., using system() ).  But how can I get 'R' to > RETURN values to the script that called it.  E.g., I would like

Re: [R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Bert Gunter
ummm... This is an R list. Shouldn't you be posting this query on a SAS list? -- Bert (and why would you want to do this anyway?! ... but we won't go there.) On Fri, Dec 3, 2010 at 1:42 PM, Paul Miller wrote: > > > Hello Everyone, > > I'm trying to use SAS to replicate some results obtained in

[R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Paul Miller
    Hello Everyone,   I'm trying to use SAS to replicate some results obtained in R. I was wondering if anyone call tell me the SAS equivalent of the code that appears below.   fm.glm.x <- glm(resp ~ . - 1, data = as.data.frame(mm.x),  na.action = na.exclude, family = binomial(link = "probit"))

Re: [R] Tukey Test, lme, error: less than two groups

2010-12-03 Thread Steven McKinney
Just to close this thread, Lilith provided the data which was in a .csv text file and had multiple lines of blank data at the end species;code;treatment;pretreatment;provenance;greenhouse;individual;leaf;Date;DataPAM Ae;c-ae-1-1-3;C;C;1;1;3;1;25.05.10 14:00; 0.665 . . . Ae;w-ae-6-3-4;C;W;6;3;4;3;

Re: [R] Passing par()-parameters to many plot()s in a function

2010-12-03 Thread Duncan Murdoch
On 03/12/2010 3:00 PM, Alexx Hardt wrote: Am 03.12.2010 20:31, schrieb Duncan Murdoch: > On 03/12/2010 12:22 PM, Alexx Hardt wrote: >> Hi, >> I am implementing a function which generates about 10 .pdf plots in the >> current directory. >> I need the graphic to fit into a LaTeX-Presentation-s

Re: [R] recode letters to numbers

2010-12-03 Thread Jim Lemon
On 12/04/2010 01:25 AM, Katharina Noussi wrote: Hello, I have a dataframe assigning various scores on around 20 variables to a list of countries. The scores are rated on a scale of (D, C, B, A) and there are also some not rated ones (NR) and others are left blank (NA). I now wanted to transfer t

Re: [R] Add columns of dataset

2010-12-03 Thread Phil Spector
Lisa - I think something like this will do what you want: mydf = data.frame(id=1:3,var1=c(0,.4,0),var2=c(.1,.6,0),var4=c(.3,0,0),var7=c(.9,0,.8),var8=c(0,.2,.7)) allvars = c('id',paste('var',1:8,sep='')) mydf[,allvars[!allvars %in% names(mydf)]] = 0 mydf = mydf[,sort(names(mydf))] mydf id

[R] Add columns of dataset

2010-12-03 Thread Lisa
Dear all, I have a dataset that looks like id var1 var2 var4 var7 var8 10.0 0.10.30.90.0 20.4 0.60.00.00.2 30.0 0.00.00.80.7 Some columns are missed, for example, here the fourth (var3), sixth(var5) and seventh (var6) colu

[R] creating a list of dataframes

2010-12-03 Thread lord12
I am iterating through multiple files and storing dataframes in a list. I want to perform calculations on these dataframes. How would I go about doing this? I do: num_files<- list.files() list = c() for(x in num_files) { frame = read.table(x) list = c(list, assign(paste("frame",x),frame)) } For e

Re: [R] creating a list of dataframes

2010-12-03 Thread David Katz
1) You have redefined the command list which creates lists - not a great idea. 2) See lapply; for example. Try something like: list.of.df <- lapply(list.of.filenames,read.csv) list.of.results <- lapply(list.of.df,your.application.function) Regards, David -- View this message in context: http:

Re: [R] How to get 'R' to talk BACK to other languages / scripts??

2010-12-03 Thread Ista Zahn
Hi Mike, Is this what you want? #!/bin/bash myTest=$(Rscript testing.R.r) echo "myTest contains" echo $myTest Note that testing.R.r will have to cat() or print() myResult (e.g, my testing.R.r contains myResult <- paste("Hello World") cat(myResult) Best, Ista On Fri, Dec 3, 2010 at 1:23 PM, Mik

Re: [R] How to change a numeric vector to a character value

2010-12-03 Thread Phil Spector
t <- c(4, 5, 3, 2) paste(test,collapse=' ') [1] "4 5 3 2" - Phil Spector Statistical Computing Facility Department of Statistics UC

[R] How to change a numeric vector to a character value

2010-12-03 Thread Soyeon Kim
Dear All, When I have a numeric vector, I want to change it to one character value. For example, When I have test <- c(4, 5, 3, 2) I want to change it to "4 5 3 2"(one character value) How can I get it? Thanks in advance, Soyeon __ R-help@r-project.or

Re: [R] Tukey Test, lme, error: less than two groups

2010-12-03 Thread Mark Difford
Lilith, >> No the big mystery is the Tukey test. I just can't find the mistake, it >> keeps telling me, that >> there are " less than two groups" >> ... >> ### Tukey test ## >> summary(glht(PAM.lme, linfct = mcp(Provenancef = "Tukey"))) >> >> Error message: >> Fehler in glht.matrix(model = li

Re: [R] Passing par()-parameters to many plot()s in a function

2010-12-03 Thread Alexx Hardt
Am 03.12.2010 20:31, schrieb Duncan Murdoch: On 03/12/2010 12:22 PM, Alexx Hardt wrote: Hi, I am implementing a function which generates about 10 .pdf plots in the current directory. I need the graphic to fit into a LaTeX-Presentation-slide, so the outer margin should be removed (this is the way

Re: [R] Tukey Test, lme, error: less than two groups

2010-12-03 Thread Lilith Epperlein
Data: __ 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.

Re: [R] Tukey Test, lme, error: less than two groups

2010-12-03 Thread Lilith Epperlein
Dear Steven, I am so happy, that you answered me! I tried what you said to put all the variable in one dataframe. The Pretreatment is not really necessary, because it didn't show any significance. I didn't copy it into the help, because I tried to concentrate on the essential things. Here is t

Re: [R] Passing par()-parameters to many plot()s in a function

2010-12-03 Thread Duncan Murdoch
On 03/12/2010 12:22 PM, Alexx Hardt wrote: Hi, I am implementing a function which generates about 10 .pdf plots in the current directory. I need the graphic to fit into a LaTeX-Presentation-slide, so the outer margin should be removed (this is the way to do it, right?): I am having trouble findi

Re: [R] difference between linear model & scatterplot matrix

2010-12-03 Thread Jonathan Christensen
Francesco, My guess would be collinearity of the predictors. The linear model gives you the best fit to all of the predictors at once; unless the predictors are orthogonal (which in a case like this is certainly not the case), there is no guarantee that the parameter estimates which give the best

[R] Calculating weekly/bi-monthly average for time series data

2010-12-03 Thread Ron Michael
Dear all, given a daily time series data, I am able to calculate monthly average, quarterly average like:   library(zoo) dat <- zooreg(rnorm(500), start=as.Date("2000-01-01"), frequency=1) mo.ave <- aggregate(dat, as.yearmon(index(dat)), "mean") head(dat) head(mo.ave) However is there any direct

Re: [R] Integral of PDF

2010-12-03 Thread Ravi Varadhan
Yes, Albyn. I do not think that this is a dangerous behavior of the tool (`integrate'). It is certainly a "dangerous use" of the tool. One will be hard-pressed to find a numerical algorithm/software that is fool-proof in the sense that it always gives you either the correct results or warns you

[R] How to get 'R' to talk BACK to other languages / scripts??

2010-12-03 Thread Mike Williamson
Hey everyone, I know that I can call 'R' from other scripts, and that I can make command calls from 'R' (e.g., using system() ). But how can I get 'R' to RETURN values to the script that called it. E.g., I would like to be able to do something like the following (as a simpler example) from a

[R] [R-pkgs] formatR update (0.1-5)

2010-12-03 Thread Yihui Xie
In formatR 0.1-5, the dependency on the gWidgets and animation packages are removed. The GUI by gWidgets is optional now. Meanwhile, the function tidy.source() has been moved from the animation package to this package. > library(formatR) > tidy.source(textConnection(' # rotation of the word "An

[R] summary() of a linear model

2010-12-03 Thread Francesco Nutini
Dear R-users, Why variables that appear correlated with dependent variable in a scatterplot, results not correlated in the summary of linear model, and vice versa? I mean, variable "Longitude" (see the example below) is correlated (***) with dependent variable in the linear model. Bu

[R] Passing par()-parameters to many plot()s in a function

2010-12-03 Thread Alexx Hardt
Hi, I am implementing a function which generates about 10 .pdf plots in the current directory. I need the graphic to fit into a LaTeX-Presentation-slide, so the outer margin should be removed (this is the way to do it, right?): I am having trouble finding out where to put the par command(s). I

Re: [R] Rcode

2010-12-03 Thread David Winsemius
On Dec 3, 2010, at 11:30 AM, Jim Silverton wrote: Hello everyone, I am not too sure if any of you are familiar with simulating RNA-seq data. I am interested in simulating data to perform Fisher's Exact Test. Can you help? You are likely to get an audience with a greater density of person

Re: [R] Date-time Conversion from Numeric Representations

2010-12-03 Thread Uwe Ligges
On 03.12.2010 16:31, Alexander Salim wrote: Hi all, I have a dataset called ,dataSet1'. The time column is given in a numeric code beginning with the year and ending with the minutes. Frist I tried the strptime() function to solve the problem. It gave me just the date back (and not the date an

Re: [R] kmeans() compared to PROC FASTCLUS

2010-12-03 Thread Andrew Agrimson
Since I posted last night I've been exploring the possibilities of how the two implementations could be different. The underlying algorithm appears to be slightly but I think the main difference between the two is how the initial seeds are chosen. In FASTCLUS I believe it's some sort of random sele

[R] Date-time Conversion from Numeric Representations

2010-12-03 Thread Alexander Salim
Hi all, I have a dataset called ,dataSet1'. The time column is given in a numeric code beginning with the year and ending with the minutes. Frist I tried the strptime() function to solve the problem. It gave me just the date back (and not the date and time). There is also the ISOdatetime function

Re: [R] subset of a dataframe

2010-12-03 Thread David Winsemius
On Dec 3, 2010, at 11:26 AM, alcesgabbo wrote: HI, I have a dataframe like this: nametype A t1 B t2 C t1 D t1 E t3 Ft2 how can I have a "sub dataframe" based with the column "type" like this: ?subset (for type = t1) nam

Re: [R] subset of a dataframe

2010-12-03 Thread Steve Lianoglou
Hi, On Fri, Dec 3, 2010 at 11:26 AM, alcesgabbo wrote: > > HI, > I have a dataframe like this: > > name    type > A          t1 > B           t2 > C          t1 > D           t1 > E           t3 > F            t2 > > how can I have a "sub dataframe" based with the column "type" like this: > > (fo

Re: [R] Rcode

2010-12-03 Thread Jim Silverton
Hello everyone, I am not too sure if any of you are familiar with simulating RNA-seq data. I am interested in simulating data to perform Fisher's Exact Test. Can you help? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-projec

[R] subset of a dataframe

2010-12-03 Thread alcesgabbo
HI, I have a dataframe like this: nametype A t1 B t2 C t1 D t1 E t3 Ft2 how can I have a "sub dataframe" based with the column "type" like this: (for type = t1) nametype A t1 C t1 D t1 (for type =

Re: [R] [r] ANCOVA method

2010-12-03 Thread Bert Gunter
Francesco: 1. You need to seek local statistical help. 2. The answer to your question is: it depends in how you define "influence significantly." If you define it as "the interaction term is significant" then, by definition the answer is yes. If you want to understand what is going on and make me

Re: [R] book about "support vector machines"

2010-12-03 Thread Georg Ruß
On 03/12/10 16:23:33, manuel.martin wrote: > I am currently looking for a book about support vector machines for > regression and classification and am a bit lost since they are plenty of > books dealing with this subject. I am not totally new to the field and > would like to get more information o

[R] Changing variables after multiple imputation

2010-12-03 Thread Joanna Geller
I am using the MICE package to do multiple imputation. Once I generated my imputed datasets, I wanted to make certain variables binary and certain variables factors. I figured out how to convert my mids file to a dataframe and edit it using the "complete" function, but evidently, the "pool" functio

Re: [R] Checking for orthogonal contrasts

2010-12-03 Thread S Ellison
David, Thanks for the comments. I think, though, that I have found the answer to my own post. >Question: How would one check, in R, that [contrasts .. are >'orthogonal in the row-basis of the model matrix'] for a particular >fitted linear model object? ?lm illustrates the use of crossprod() fo

Re: [R] kmeans() compared to PROC FASTCLUS

2010-12-03 Thread Georg Ruß
On 02/12/10 17:49:37, Andrew Agrimson wrote: > I've been comparing results from kmeans() in R to PROC FASTCLUS in SAS > and I'm getting drastically different results with a real life data set. > [...] Has anybody looked into the differences in the implementations or > have any thoughts on the matte

[R] [r] ANCOVA method

2010-12-03 Thread Francesco Nutini
Dear [R] Users, I have implemented a linear model with this syntax: model<- lm (var_dependent ~ var_indipendent + factor + var_indipendent : factor, dataframe) anova (model) Response: var_dependent Df Sum Sq Mean Sq F valuePr(>F) var_indip

Re: [R] recode letters to numbers

2010-12-03 Thread Phil Spector
Katharina - I think something like this may be helpful: z = data.frame(matrix(sample(c(LETTERS[1:4],'NR',NA),100,replace=TRUE),20,5)) codes = c(A=100,B=27,C=50,D=25,NR=0) newz = sapply(z,function(x)codes[x]) - Phil Spector

Re: [R] plot more plots from one matrix

2010-12-03 Thread alcesgabbo
I solved the 1° problem with this command: matrix2plot2[,"sensor_data"]<-as.numeric(as.character((matrix2plot2[,"sensor_data"]))) In fact before the previous command I if write: str(matrix2plot2[,"sensor_data"]) I get: Factor w/ 10 levels "131.22","148.532",..: 4 6 4 6 9 8 9 8 3 1 ... And a

[R] Odp: recode letters to numbers

2010-12-03 Thread Petr PIKAL
Hi If you had your variables as factors you can change levels of each factor. levels(some.factor) <- c(0,25,50,27,100) fac<-factor(sample(LETTERS[1:5],20, replace=TRUE) ) fac [1] A A D A D A D A C B A A D D D B D E C B Levels: A B C D E levels(fac)<-1:5 fac [1] 1 1 4 1 4 1 4 1 3 2 1 1 4 4 4

Re: [R] book about

2010-12-03 Thread Neeti
think this might help you for start. http://www.kernel-machines.org/frequently-asked-questions :) -- View this message in context: http://r.789695.n4.nabble.com/book-about-support-vector-machines-tp3071210p3071218.html Sent from the R help mailing list archive at Nabble.com. _

[R] book about "support vector machines"

2010-12-03 Thread manuel.martin
Dear all, I am currently looking for a book about support vector machines for regression and classification and am a bit lost since they are plenty of books dealing with this subject. I am not totally new to the field and would like to get more information on that subject for later use with the

[R] difference between linear model & scatterplot matrix

2010-12-03 Thread Francesco Nutini
Dear R-users, I'm studing a DB, structured like this (just a little part of my dataset): _ Site Latitude Longitude Year Tot-Prod Total_Density dmp Dendoudi-1

[R] recode letters to numbers

2010-12-03 Thread Katharina Noussi
Hello, I have a dataframe assigning various scores on around 20 variables to a list of countries. The scores are rated on a scale of (D, C, B, A) and there are also some not rated ones (NR) and others are left blank (NA). I now wanted to transfer the scores into numeric values (such as NR=0, D=

Re: [R] Checking for orthogonal contrasts

2010-12-03 Thread Mike Rennie
There's a pretty good section in the R book by Crawley on contrast statements in R, including some discussion of the contrasts being orthogonal. I would say you should just make your own table and sort it out there- if you have equal sample sizes, then the contrast coefficients along the row shoul

Re: [R] Checking for orthogonal contrasts

2010-12-03 Thread Ista Zahn
Hi Steve, The short answer is that there is typically no reason to check (beyond looking to see what contrasts have been defined for the factors in the model; see ?contrasts) because the rules are pretty simple. 1) the design matrix is orthogonal on the row-basis (i.e., the columns sum to zero) whe

Re: [R] latex tables for 3+ dimensional tables/arrays

2010-12-03 Thread Michael Friendly
On 12/3/2010 4:19 AM, Dieter Menne wrote: Some time ago, I did a quick hack. Don't know if it helps, it was good enough for my purpose. ## RNW file [snip] Yes, thanks -- that's a good start. Ideally, I'd like to have something that could also take a file= argument and write to a file li

[R] mgcv package plot superimposing smoothers

2010-12-03 Thread Jef Vlegels
Dear R help list, I'm fitting a 'variable coefficient model' in the MGCV package and I want to plot the different smoothers I get for each factor level in one graph. So, I do something like this to fit the gam: Mtest <- gam(outcome ~ s(age, by=as.numeric(gender==0)) + s(age,by=as.numeric(gender=

Re: [R] Integral of PDF

2010-12-03 Thread Ravi Varadhan
Your function does NOT have a mode at zero. It is bimodal with 2 modes: -500 and 500. So, my approach still works. Zero is a stationary point where the gradient is zero, but it is not a mode (the second derivative at zero is not negative but it is zero). Ravi. -

Re: [R] intraday zoo

2010-12-03 Thread Gabor Grothendieck
On Fri, Dec 3, 2010 at 7:37 AM, Santosh Srinivas wrote: > I'm trying to read intraday zoo but running into issues (again) ... > what am I missing here? (the date doesn't seem to read in correctly) > >> head(dat) >   TrdDate  TrdTime impliedVol > 1 20090102 09:55:03  0.3610715 > 2 20090102 09:55:04

Re: [R] colname refered by a variable

2010-12-03 Thread David Winsemius
On Dec 3, 2010, at 4:14 AM, Keith Jewell wrote: or even shorter df[,paste("A","C",sep="")] Other grepping methods that generalize better to partial matches: df[ , grep("^AC$", colnames(df))] df[ grep("^AC$", colnames(df)) ] -- David. "Santosh Srinivas" wrote in message news:aanlktikc

[R] model values for alpha and beta in a glm gamma inverse distribution

2010-12-03 Thread Rosario Garcia Gil
Hello How could I include in the model a value for lambda in a glm family=poisson model? Or alpha and beta in a glm family=gamma(link="inverse") model? Thanks Rosario __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] Strange problems with compiling dll

2010-12-03 Thread Mike Marchywka
> Date: Fri, 3 Dec 2010 08:07:15 +0100 > From: rom...@r-enthusiasts.com > To: r-help@r-project.org > CC: diklev...@gmail.com > Subject: Re: [R] Strange problems with compiling dll > > Hello, > > Your question is more appropriate on the R-devel mailing

Re: [R] Querying a data frame or data.table

2010-12-03 Thread David Winsemius
On Dec 3, 2010, at 3:44 AM, Michael Bedward wrote: Sounds just like the subset function (?) x <- as.data.frame(matrix(sample(5, 100, rep=TRUE), ncol=10)) subset(x, ) With data,table: require(data.table) > xd <- as.data.table(x) > xd[ V1 > 3 & V2 < 5 , ] V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 [1

[R] Checking for orthogonal contrasts

2010-12-03 Thread S Ellison
A common point made in discussion of contrasts, type I, II, III SS etc is that for sensible comparisons one should use contrasts that are 'orthogonal in the row-basis of the model matrix' (to quote from http://finzi.psych.upenn.edu/R/Rhelp02/archive/111550.html) Question: How would one check, in

[R] intraday zoo

2010-12-03 Thread Santosh Srinivas
I'm trying to read intraday zoo but running into issues (again) ... what am I missing here? (the date doesn't seem to read in correctly) > head(dat) TrdDate TrdTime impliedVol 1 20090102 09:55:03 0.3610715 2 20090102 09:55:04 0.3637943 3 20090102 09:55:05 0.3752375 4 20090102 09:55:05 0.41

Re: [R] The behaviour of read.csv().

2010-12-03 Thread Duncan Murdoch
On 02/12/2010 9:59 PM, Rolf Turner wrote: On 3/12/2010, at 3:48 PM, David Scott wrote: On 03/12/10 14:33, Duncan Murdoch wrote: I think the fill=TRUE option arrived about 10 years ago, in R 1.2.0. The comment in the NEWS file suggests it was in response to some strange csv file

Re: [R] procrustes results affected by order of sites in input file

2010-12-03 Thread Gavin Simpson
On Fri, 2010-12-03 at 09:58 +, Gavin Simpson wrote: > On Thu, 2010-12-02 at 11:19 -0600, Christine Dolph wrote: > > Hi, Thanks very much for your response. > > Thanks Christy, > > Apologies if I sounded off-hand or dismissive yesterday. It was a busy > day, and as your mail lacked a reproduci

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Claudia Beleites
On 12/03/2010 06:54 AM, Berwin A Turlach wrote: On Thu, 2 Dec 2010 23:34:02 -0500 David Winsemius wrote: [...] Erik is telling you that your use of ncol<-4 got evaluated to 4 and that the name of the resulting object was ignored, howevert the value of the operation was passed on to matrix whic

Re: [R] Querying a data frame or data.table

2010-12-03 Thread Dieter Menne
mbedward wrote: > > Sounds just like the subset function (?) > .. > > Or try sqldf if you feel at home in the SQL empire. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Querying-a-data-frame-or-data-table-tp3070750p3070926.html Sent from the R help mailing list archi

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Ivan Calandra
Le 12/3/2010 11:35, Berwin A Turlach a écrit : G'day Ivan, On Fri, 03 Dec 2010 10:54:58 +0100 Ivan Calandra wrote: Arf, yes it makes sense now! Well, my original post said: "R has lazy evaluation" and "the assignment takes place when the function evaluates the argument" :) Well you did say

Re: [R] Tinn-R 2.3.7.0 released

2010-12-03 Thread Jose Claudio Faria
Hello, All you need are explained at Help/Main/User guide/HTML from Tinn-R menu. Basically: 1. Close R; 2. Menu R/Configure/ Pemanent (Rprofile.site): Tinn-R will generate a small script inside of the file Rprofile.site (located on the folder 'etc' where R is installed); 3. If there are some prio

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Berwin A Turlach
G'day Ivan, On Fri, 03 Dec 2010 10:54:58 +0100 Ivan Calandra wrote: > Arf, yes it makes sense now! Well, my original post said: "R has lazy evaluation" and "the assignment takes place when the function evaluates the argument" :) > So the idea here is: never use "<-" in function argument... Ne

Re: [R] Filter data

2010-12-03 Thread Petr PIKAL
Hi Hm. Does str(poli) revealed said explicitly that poli is data frame? I presume that it told you that it is list. In that case you need to use appropriate indexing, which suits structure of your list. Regards r-help-boun...@r-project.org napsal dne 02.12.2010 22:06:15: > > Simplified versi

Re: [R] procrustes results affected by order of sites in input file

2010-12-03 Thread Gavin Simpson
On Thu, 2010-12-02 at 11:19 -0600, Christine Dolph wrote: > Hi, Thanks very much for your response. Thanks Christy, Apologies if I sounded off-hand or dismissive yesterday. It was a busy day, and as your mail lacked a reproducible example nor the code you ran, I wanted to deal with the low-hangin

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Ivan Calandra
Arf, yes it makes sense now! So the idea here is: never use "<-" in function argument... Thanks for the explanation! Regards, Ivan Le 12/3/2010 10:48, Michael Bedward a écrit : It's only obvious when someone points it out :) fubar is not created because, in the test x> 3 returned FALSE, which

Re: [R] Please help......barplot2

2010-12-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.12.2010 17:26:20: > > On Dec 2, 2010, at 11:10 AM, David Lyon wrote: > > > Thanks David > > > > Do you have the url link that details the worked solution to my > > problem: > > > > "that we have an extensive collection of documentation suitable for

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Michael Bedward
It's only obvious when someone points it out :) fubar is not created because, in the test x > 3 returned FALSE, which means the cat function doesn't get used, which means the y arg (fubar <- 6) is never required and therefore not evaluated. Evil isn't it ? Michael On 3 December 2010 20:18, Ivan

Re: [R] StructTS with 2 seasons

2010-12-03 Thread Birgit Erni
Thanks! Following Prof. Ripley's reply I inserted the following lines into StructTS (makeBSM) if (nf < 3) { ind <- 2L } else { ind <- 3:nf T[cbind(ind + 1L, ind)] <- 1 } This worked and gave me the same variance estimates as the dlm packag

Re: [R] latex tables for 3+ dimensional tables/arrays

2010-12-03 Thread Dieter Menne
David Winsemius wrote: > > > On Dec 2, 2010, at 3:47 PM, Michael Friendly wrote: > >> I'm looking for an R method to produce latex versions of tables for >> table/array objects of 3 or more dimensions, > Some time ago, I did a quick hack. Don't know if it helps, it was good enough for my p

Re: [R] using ``<-'' in function argument

2010-12-03 Thread Ivan Calandra
See below Le 12/3/2010 06:54, Berwin A Turlach a écrit : On Thu, 2 Dec 2010 23:34:02 -0500 David Winsemius wrote: [...] Erik is telling you that your use of ncol<-4 got evaluated to 4 and that the name of the resulting object was ignored, howevert the value of the operation was passed on to m

  1   2   >