[R] Please help me in Converting this from C# to R

2008-09-14 Thread rajivv
Random r = new Random(); DirectedGraphSimpleNode graph = GetGraph(); decimal B = 0.1m; decimal D = 0.05m; int nodes = graph.NodesCount; decimal[] E = new decimal[nodes]; decimal[] P = new

[R] Problem with misclass function on tree classification

2008-09-14 Thread Meir Preiszler
I am working through Tom Minka's lectures on Data Mining and am now on Day 32. The following is the link: http://alumni.media.mit.edu/~tpminka/courses/36-350.2001/lectures/day32/ In order to use the functions cited I followed the instructions as follows: Installed tree package from CRAN mirror

Re: [R] Where is the error

2008-09-14 Thread Berend Hasselman
rajivv wrote: P - vector(mode=numeric,length =10) SS-function(){for(id in 0:9){ if(0P[id]) print(ss) else print(ss) }} SS() --- Error in if (0 P[id]) print(ss) else print(ss) : argument is of length zero

Re: [R] Where is the error

2008-09-14 Thread Nicky Chorley
2008/9/14 rajivv [EMAIL PROTECTED]: P - vector(mode=numeric,length =10) SS-function(){for(id in 0:9){ if(0P[id]) print(ss) else print(ss) }} SS() --- Error in if (0 P[id]) print(ss) else print(ss) : argument is of

Re: [R] Please help me in Converting this from C# to R

2008-09-14 Thread Simon Knapp
# bit hard to provide a simple conversion without definitions of the class 'Node', the template 'DirectedGraph' and the function 'Writed'! # I've used the package 'igraph' as a drop in - hope it is still clear. # # by the way: # - your curly braces don't match, # - not all elements of P are

Re: [R] Problem with misclass function on tree classification

2008-09-14 Thread Simon Knapp
Did you say: library(tree) at the top of your script? On Sun, Sep 14, 2008 at 5:47 PM, Meir Preiszler [EMAIL PROTECTED] wrote: I am working through Tom Minka's lectures on Data Mining and am now on Day 32. The following is the link:

[R] Data format for BiodiversityR

2008-09-14 Thread Ndoh Innocent (Holy)
Greetings dear friends. Please, I really find problems having the program read my datasets (here attached). Have converted datasets to csv, imported but always not reaching the target. Would be very happy if some one out can help me on time. Thanks Ndoh Mbue Innocent International corporation

[R] Problem plotting axes on graphs

2008-09-14 Thread Les Stather
2008/9/14 [EMAIL PROTECTED] I ran your example Speed - cars$speed Distance - cars$dist Speed [1] 4 4 7 7 8 9 10 10 10 11 11 12 12 12 12 13 13 13 13 14 14 14 14 15 15 [26] 15 16 16 17 17 17 18 18 18 18 19 19 19 20 20 20 20 20 22 23 24 24 24 24 25 Distance [1] 2 10 4 22 16 10

Re: [R] Greyed text in the background of a plot

2008-09-14 Thread Agustin Lobo
Yes, it's easy but you get a significant jump between a time step and the next one, which makes the animation unpleasant and difficult to follow. I think that this problem is because of the use of plot(), which redraws everything, and that there is no way around within R (is it?). I also

[R] Help please! How to code a mixed-model with 2 within-subject factors using lme or lmer?

2008-09-14 Thread roberto toro
Hello, I'm using aov() to analyse changes in brain volume between males and females. For every subject (there are 331 in total) I have 8 volume measurements (4 different brain lobes and 2 different tissues (grey/white matter)). The data looks like this: Subject Sex LobeTissue Volume

Re: [R] Join data by minimum distance

2008-09-14 Thread Simon Knapp
I am wondering if there is a function which will do a join between 2 data.frames by minimum distance, as it is done in ArcGIS for example. For people who are not familiar with ArcGIS here it is an explanation: Suppose you have a data.frame with x, y, coordinates called track, and a second

Re: [R] Help please! How to code a mixed-model with 2 within-subject factors using lme or lmer?

2008-09-14 Thread Mark Difford
Hi Roberto, but I can't figure out the /(Lobe*Tissue) part... This type of nesting is easier to do using lmer(). To do it using lme() you have to generate the crossed factor yourself. Do something like this: ## tfac - with(vslt, interaction(Lobe, Tissue, drop=T)) str(tfac); head(tfac)

Re: [R] Greyed text in the background of a plot

2008-09-14 Thread Yihui Xie
Hi Agus, Yes you are absolutely right about the awkward jumps in the animations and this has also been my big problem for a long time. To solve this problem, I think I need a third-party software, as I don't know any solutions merely using R. Maybe the swfc utility in the SWF Tools or the

[R] Scaling X axis from -1 to 1

2008-09-14 Thread Gundala Viswanath
Hi, I have a density plot in which the x axis ranged from 0 to 2000. How can I scale the data so that the x-axis is scaled in -1 to 1 form? - Gundala Viswanath Jakarta - Indonesia __ R-help@r-project.org mailing list

Re: [R] Scaling X axis from -1 to 1

2008-09-14 Thread Yihui Xie
2 * (x - min(x))/(max(x) - min(x)) - 1 On Sun, Sep 14, 2008 at 10:13 PM, Gundala Viswanath [EMAIL PROTECTED] wrote: Hi, I have a density plot in which the x axis ranged from 0 to 2000. How can I scale the data so that the x-axis is scaled in -1 to 1 form? - Gundala Viswanath Jakarta -

[R] Help please! How to code a mixed-model with 2 within-subject factors using lme or lmer?

2008-09-14 Thread roberto toro
Thanks for answering Mark! I tried with the coding of the interaction you suggested: tfac-with(vlt,interaction(Lobe,Tissue,drop=T)) mod-lme(Volume~Sex*Lobe*Tissue,random=~1|Subject/tfac,data=vlt) But is it normal that the DF are 2303? DF is 2303 even for the estimate of LobeO that has only

Re: [R] Help please! How to code a mixed-model with 2 within-subject factors using lme or lmer?

2008-09-14 Thread Mark Difford
Hi Roberto, It's difficult to comment further on specifics without access to your data set. A general point is that the output from summary(aov.object) is not directly comparable with summary(lme.object). The latter gives you a summary of a fitted linear regression model, not an analysis of

[R] Question on glm.nb vs zeroinfl vs hurdle models

2008-09-14 Thread eugen pircalabelu
Good afternoon, I’m in need of an advice regarding a proper use of glm.nb, zeroinfl or hurdle with my dataframe. I can not provide a self-contained example, since I need an advice on this current dataset and its “contradictory” results. So i have a dataset which contains 1309 cases

[R] Fetching a range of columns

2008-09-14 Thread Jason Thibodeau
Hello, I realize that using: x[x 3 x 5] I can fetch all elements between 3 and 5. However I read in from a CSV file, and I would like to fetch all columns from within a range ( 842-2411). In teh past, I have done this to fetch just select few columns: data - read.csv(filein, header=TRUE,

Re: [R] library instal

2008-09-14 Thread John Kane
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --- On Fri, 9/12/08, gaurav1983 [EMAIL PROTECTED] wrote: From: gaurav1983 [EMAIL PROTECTED] Subject: [R] library instal To: r-help@r-project.org

[R] difference of two data frames

2008-09-14 Thread joseph
Hello I have 2 data frames DF1 and DF2 where DF2 is a subset of DF1: DF1= data.frame(V1=1:6, V2= letters[1:6]) DF2= data.frame(V1=1:3, V2= letters[1:3]) How do I create a new data frame of the difference between DF1 and DF2 newDF=data.frame(V1=4:6, V2= letters[4:6]) In my real data, the rows are

Re: [R] difference of two data frames

2008-09-14 Thread Jorge Ivan Velez
Hi Joseph, Try this: DF1[!DF1$V1%in%DF2$V1,] subset(DF1,!V1%in%DF2$V1) HTH, Jorge On Sun, Sep 14, 2008 at 12:49 PM, joseph [EMAIL PROTECTED] wrote: Hello I have 2 data frames DF1 and DF2 where DF2 is a subset of DF1: DF1= data.frame(V1=1:6, V2= letters[1:6]) DF2= data.frame(V1=1:3, V2=

Re: [R] difference of two data frames

2008-09-14 Thread joseph
Hi Mark as you guessed it, I meant a dataframe of the rows in DF1 that are not in DF2 . Here is what I got: complement-setdiff(DF1$V2,DF2$V2) DF1[,complement] Error in `[.data.frame`(DF1, , complement) : undefined columns selected - Original Message From: Mark Leeds [EMAIL

[R] string functions

2008-09-14 Thread zubin
Hello, trying to locate all the string commands in the base version of R, can't seem to find an area that describes them. I am in need to do some serious parsing of text data to create my dataset. Is there a summary link to all the character operators? string manipulations that would help in

Re: [R] difference of two data frames

2008-09-14 Thread joseph
Hi Jorge both commands work; can you extend it to several coulmns? the reason I am asking is that in my real data the uniqueness of the rows is made of all the columns; in other words V1 might have duplicates. Thanks - Original Message From: Jorge Ivan Velez [EMAIL PROTECTED] To:

Re: [R] Fetching a range of columns

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 12:22 PM, Jason Thibodeau wrote: Hello, I realize that using: x[x 3 x 5] I can fetch all elements between 3 and 5. However I read in from a CSV file, and I would like to fetch all columns from within a range ( 842-2411). In teh past, I have done this to fetch

Re: [R] Fetching a range of columns

2008-09-14 Thread jim holtman
Have you tried: data_filter - data[842:2411] Also if you have a lot of data to read, I would suggest that you use a connection, and it all the data is numeric, possibly 'scan'. If you do use a connection, this would eliminate having to 'skip' each time which could be time consuming on a large

Re: [R] string functions

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 1:53 PM, zubin wrote: Hello, trying to locate all the string commands in the base version of R, can't seem to find an area that describes them. I am in need to do some serious parsing of text data to create my dataset. Is there a summary link to all the character

Re: [R] string functions

2008-09-14 Thread jim holtman
Start with ?grep and then follow the See Also. Exactly what type of serious parsing are you trying to do? R can do some, but if it is very complex, you might want to consider awk/perl. On Sun, Sep 14, 2008 at 1:53 PM, zubin [EMAIL PROTECTED] wrote: Hello, trying to locate all the string

Re: [R] Fetching a range of columns

2008-09-14 Thread Jason Thibodeau
Jim, this is a GREAT help. I was trying something similar before, but I was unable to detect EOF. Thanks for the help! Also, David, your suggestion worked perfectly. Thanks for all the help, everyone! On Sun, Sep 14, 2008 at 2:08 PM, jim holtman [EMAIL PROTECTED] wrote: Have you tried:

Re: [R] string functions

2008-09-14 Thread Gabor Grothendieck
Try this: help.search(keyword = character, package = base) Then read each of the pages listed to get info on the indicated command plus related commands also described on those pages (but not necessarily listed in the help.search list). You might also want to look at the gsubfn package and its

Re: [R] difference of two data frames

2008-09-14 Thread Adaikalavan Ramasamy
It would be useful to have indexed both dataframes with a unique identifier, such as in rownames etc. Without that information, you could possibly try to use the same approach as duplicated() does by pasting together a character representation of rows using | (or any other separator).

Re: [R] difference of two data frames

2008-09-14 Thread joseph
Actually you got it, the data sets you created are a perfect example (row#1 and row#2 in DF1 have the same V1 and differ only in V2) , but here is the problem: row#2 in DF1 exists in DF1 and not in DF2, however it does not show in the Difference. It seems to me that both V1 and V2 should be

Re: [R] string functions

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 1:53 PM, zubin wrote: Hello, trying to locate all the string commands in the base version of R, can't seem to find an area that describes them. I am in need to do some serious parsing of text data to create my dataset. Is there a summary link to all the character

Re: [R] Fetching a range of columns

2008-09-14 Thread Jason Thibodeau
TEST_filter(line50grab.csv,line50grab_filterout.csv) Error in `[.data.frame`(data_tmp, seq(842, 2411)) : undefined columns selected I know my file has about 3000 columns. This happened when I used: data_tmp - read.csv(filein, header=TRUE, nrows=10, skip=nskip)

Re: [R] Fetching a range of columns

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 4:01 PM, Jason Thibodeau wrote: TEST_filter(line50grab.csv,line50grab_filterout.csv) Error in `[.data.frame`(data_tmp, seq(842, 2411)) : undefined columns selected I am guessing that you wrapped some code into a function but you did not provide the function. You are

Re: [R] moving from aov() to lmer()

2008-09-14 Thread Adam D. I. Kramer
On Sat, 13 Sep 2008, roberto toro wrote: Hello, I've used this command to analyse changes in brain volume: mod1-aov(Volume~Sex*Lobe*Tissue+Error(Subject/(Lobe*Tissue)),data.vslt) I'm comparing males/females. For every subject I have 8 volume measurements (4 different brain lobes and 2

[R] histogram

2008-09-14 Thread Felipe
i calculated the density and wanna do something like this separate in 0-19-29-39-49-59-69-79-99 and put in these spaces 8 densities .. 0.something i have the frequency in % and divided already in 20 or 10 to get the density i tried and tried..made breaks vector to separate but couldn't put the

Re: [R] Fetching a range of columns

2008-09-14 Thread Adam D. I. Kramer
Hi Jason, data[] is a data frame, remember--you need to specify rows AND columns. So, data[,c(2,12,17)] is what you should be doing in the first place, and data[,842:2411] in the second place. Not sure if the help you needed was using the comma, or the : syntax, or if you're trying to read only

[R] k-sample Kolmogorov-Smirnov test?

2008-09-14 Thread Mark Na
Hello, I would like to conduct a k-sample K-S test, but cannot find reference to its implementation in R. Does anyone have experience with this? Thanks, Mark [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Fetching a range of columns

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 4:40 PM, Jason Thibodeau wrote: I cannot provide (all) the sample data (NDA) but here is the entire function: TEST_filter - function(filein,fileout) { file.remove(fileout) nskip-0 while(1) { data_tmp

[R] using R for accessing web site data -

2008-09-14 Thread zubin
Hello, what's the most efficient way of using R to automate a data collection task i have: -Login into a web site using my ID and PWD -submit a query within the site using the search form after login -extract the result of the search data into R so i can cleanse and use for analysis kind of

Re: [R] Fw: Complex sampling survey _ Use of survey package

2008-09-14 Thread Thomas Lumley
On Fri, 12 Sep 2008, Ahoussou Sylvie wrote: -- From: Ahoussou Sylvie [EMAIL PROTECTED] Sent: Friday, September 12, 2008 9:48 AM To: Thomas Lumley [EMAIL PROTECTED] Subject: Re: [R] Complex sampling survey _ Use of survey package Thanks for

Re: [R] k-sample Kolmogorov-Smirnov test?

2008-09-14 Thread Adam D. I. Kramer
Maybe you should look a little harder. help.search(Kolmogorov) PLEASE do read the posting guide http://www.R-project.org/posting-guide.html --Adam __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Ward's Clustering Doubts

2008-09-14 Thread Rodrigo Aluizio
Hi Everybody, Now I have a doubt that is more statistical than R's technical. I’m working with ecology of recent Foraminifera. At the lab we used to perform cluster analysis using 1-Pearson’s R and Wards method (we already saw it in bibliography of the area) which renders good results with

Re: [R] Combining tables

2008-09-14 Thread Andre Nathan
Thanks Jim, it worked great! On Sun, 2008-09-14 at 21:27 -0400, jim holtman wrote: try this: c(tx,ty) 1 2 3 3 4 3 2 1 4 1 z - c(tx,ty) tapply(z, names(z), sum) 1 2 3 4 3 2 5 1 __ R-help@r-project.org mailing list

[R] any package to do generalized linear mixed model?

2008-09-14 Thread Wensui Liu
I checked GlmmML package. However, it can only do binomial and poisson distribution. How about others such as gamma or neg binomial? Thank you so much! wensui __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Nonlinear regression question[EMAIL PROTECTED]

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 6:53 PM, Esther Meenken wrote: I was unable to open this file Bill Venables' excellent Exegeses on Linear Models posted at http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.ps.gz I'd be very interested in reading it? It's a gzipped file that expands into a ps file. On my Mac

[R] NAs and stl

2008-09-14 Thread rkevinburton
I would like to decompose the log of a time series. There will be time slots that are zero. In order to handle this I insert 'NA' for all of the zeros in the time series. Having a zero value is a very legitamate value. With those NAs in the time series stil requires an na.action argument

[R] need help please (HoltWinters function)

2008-09-14 Thread jeff_lc
every time i try to run HoltWinters i get this error message: HoltWinters(z, seasonal=additive) Error in decompose(ts(x[1:wind], start = start(x), frequency = f), seasonal) : time series has no or less than 3 periods what's going on? somebody please help me. -- View this message in

[R] How to draw a plot like this?

2008-09-14 Thread Jinsong Zhao
Hi there, I hope to draw a plot like this: http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif is it possible to draw it using R? thanks for any suggestions. regards, Jinsong __ R-help@r-project.org mailing list

Re: [R] Fetching a range of columns

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 5:39 PM, Adam D. I. Kramer wrote: Hi Jason, data[] is a data frame, remember--you need to specify rows AND columns. So, data[,c(2,12,17)] is what you should be doing in the first place, and data[,842:2411] in the second place. Actually, the construction df[c(2,12,17)]

Re: [R] making spearman correlation cor() call fail with log(0) as input

2008-09-14 Thread Timur Shtatland
Hi Martin, I got my initial question fully answered. I do not have enough experience to to judge whether the behavior of R with regard to Inf is excellent or better than Perl. In my opinion, both Perl and R are great languages, designed for very different applications. So instead of me trying to

Re: [R] k-sample Kolmogorov-Smirnov test?

2008-09-14 Thread Rolf Turner
On 15/09/2008, at 10:02 AM, Adam D. I. Kramer wrote: Maybe you should look a little harder. help.search(Kolmogorov) PLEASE do read the posting guide http://www.R-project.org/posting- guide.html Please do read the guy's question!!! Hello, I would like to conduct a k-sample K-S

Re: [R] Nonlinear regression question[EMAIL PROTECTED]

2008-09-14 Thread Gabor Grothendieck
Try this version: http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf On Sun, Sep 14, 2008 at 6:53 PM, Esther Meenken [EMAIL PROTECTED] wrote: I was unable to open this file Bill Venables' excellent Exegeses on Linear Models posted at http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.ps.gz I'd be

[R] Ward's Clustering Doubts

2008-09-14 Thread Rodrigo Aluizio
Hi Everybody, Now I have a doubt that is more statistical than R's technical. I’m working with ecology of recent Foraminifera. At the lab we used to perform cluster analysis using 1-Pearson’s R and Wards method (we already saw it in bibliography of the area) which renders good results with our

[R] Combining tables

2008-09-14 Thread Andre Nathan
Hello Say I have the following data, and it's distribution given by table(): x - c(1, 1, 1, 2, 2, 3) tx - table(x) tx x 1 2 3 3 2 1 Now say I have new data, y - c(3, 3, 3, 3, 4) ty - table(y) ty y 3 4 4 1 Is there a way to combine tx and ty in such a way to give

Re: [R] k-sample Kolmogorov-Smirnov test?

2008-09-14 Thread David Winsemius
On Sep 14, 2008, at 5:46 PM, Mark Na wrote: Hello, I would like to conduct a k-sample K-S test, but cannot find reference to its implementation in R. Does anyone have experience with this? Thanks, Mark I didn't have any luck with the method Kramer suggested, perhaps because I do not