[R] [R-pkgs] mvbutils and debug: new versions

2009-11-16 Thread Mark.Bravington
New versions of the 'mvbutils' and 'debug' packages are now available on CRAN. These should work with R 2.10 as well as R 2.9. 'mvbutils' offers tools for organization of workspaces, function/documentation editing with backups, package construction and updating, seamless per-object

[R] Locate 'repeated' package?

2009-11-16 Thread Daniel R Jeske
I cannot find the 'repeated' package at the CRANs. Can anyone tell me how to get this package? Thanks, Daniel [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] How to use SQL code in R

2009-11-16 Thread Emmanuel Charpentier
Le lundi 16 novembre 2009 à 13:14 +0800, sdlywjl666 a écrit : Dear All, How to use SQL code in R? Depends on what you mean by using SQL code in R... If you mean Query, update or otherwise mess with an existing database, look at the RODBC packages and/or various RDBI-related packages (hint :

Re: [R] JGR GUI for R-2.10.0 Help Print

2009-11-16 Thread Liviu Andronic
Hello On 11/15/09, Bob Meglen bmeg...@comcast.net wrote: I have updated R 2.9.1 to 2.10.0. and JGR GUI 1.7. I am running Windows XP. I can't seem to get the JGR Print or Help functions to work. The system locks and requires me to stop the process. In the past I have preferred the opreation

[R] Plotting Moa clustering result

2009-11-16 Thread Zoe Hoare
Hi all, Is there a way of plotting a 'decision tree' from the results of Mona in the cluster package. The default bannerplot is not quite what I'm after - I would like a plot of the binary decision tree. Thanks Zoë __ R-help@r-project.org mailing

Re: [R] Locate 'repeated' package?

2009-11-16 Thread Uwe Ligges
Daniel R Jeske wrote: I cannot find the 'repeated' package at the CRANs. Can anyone tell me how to get this package? That is a package by Jim Lindsey who does not publish his non-standard R packages on CRAN but on some webpage. The current locations according to my Google search seems to

[R] ^ operator

2009-11-16 Thread carol white
Hi, I want to apply ^ operator to a vector but it is applied to some of the elements correctly and to some others, it generates NaN. Why is it not able to calculate -6.108576e-05^(1/3) even though it exists? tmp [1] -6.108576e-05 4.208762e-05 3.547092e-05 7.171101e-04 -1.600269e-03

[R] Odp: ^ operator

2009-11-16 Thread Petr PIKAL
Hi AFAIK, this is issue of the preference of operators. r-help-boun...@r-project.org napsal dne 16.11.2009 11:24:59: Hi, I want to apply ^ operator to a vector but it is applied to some of the elements correctly and to some others, it generates NaN. Why is it not able to calculate

Re: [R] pairs

2009-11-16 Thread David Winsemius
I'm not convinced it's right. In fact, I'm pretty sure the last step taking only the first half of the list is wrong. I also do not know if you have considered how you want to count situations like: 3 2 7 4 5 7 ... 7 3 8 6 1 2 9 2 .. How many pairs of 2-7/7-2 would that represent? --

Re: [R] Odp: ^ operator

2009-11-16 Thread carol white
but with complex, I get complex numbers for the first and last elements: (as.complex(tmp))^(1/3) [1] 0.01969170+0.03410703i 0.03478442+0.i 0.03285672+0.i [4] 0.08950802+0.i 0.05848363+0.10129661i whereas for the first element, we get the followings. Moreover,

[R] Labels in horizontal dendrogram not placed correctly?

2009-11-16 Thread joris meys
Hi all, I tried plotting a horizontal dendrogram, but it seems as if the labels are not taken into account in the function plot.dendrogram(). A minimal example : Test - data.frame( x1x = c(1:10), x2x = c(2:11), x3x = c(11:2) ) TestDist - daisy(data.frame(t(Test)))

Re: [R] Simple if else statement problem

2009-11-16 Thread anna_l
thanks petr, this is actually shorter ;) Petr Pikal wrote: Hi r-help-boun...@r-project.org napsal dne 13.11.2009 18:54:05: Ok Jim it worked, thank you! it´s funny because it worked with the first syntax in some cases... you can use another approach in this case P-max(c(P1,P2))

[R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread A Singh
Dear List, I'm having a curious problem with lapply(). I've used it before to convert a subset of columns in my dataframe, to factors, and its worked. But now, on re-running the identical code as before it just doesn't convert the columns into factors at all. As far as I can see I've done

Re: [R] Problems by saving Rprofile.site under vista

2009-11-16 Thread anna_l
Hi Charles, I´ve already been running it as an administrator this is why I don´t understand it. Charles Annis, P.E. wrote: You may have to run R as Administrator (right-click, choose run as administrator) to make these kinds of changes. After you have things the way you like them, run R

[R] Conditional statement

2009-11-16 Thread Rafael Moral
Dear useRs, I wrote a function that simulates a stochastic model in discrete time. The problem is that the stochastic parameters should not be negative and sometimes they happen to be. How can I conditionate it to when it draws a negative number, it transforms into zero in that time step? Here

Re: [R] ^ operator

2009-11-16 Thread David Winsemius
R does not know that 1/3 is 1/3. It is represented internally as 0.3...3, so certain mathematical facts such as the existence of real roots of fractional integer powers are opaque to R (since it is not a symbolic algebra system.) Try seaarching for cube roots on R-search (for

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread A Singh
Sorry, my file is at: http://www.4shared.com/file/153147281/a5c78386/Testvcomp10.html -- A Singh aditi.si...@bristol.ac.uk School of Biological Sciences University of Bristol __ R-help@r-project.org mailing list

Re: [R] Odp: ^ operator

2009-11-16 Thread Ted Harding
On 16-Nov-09 11:40:29, Petr PIKAL wrote: Hi AFAIK, this is issue of the preference of operators. r-help-boun...@r-project.org napsal dne 16.11.2009 11:24:59: Not in this case (see below), though of course in general - takes precedence over ^, so, for example, in the expression

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread Sundar Dorai-Raj
Works for me: x - read.csv(url(http://dc170.4shared.com/download/153147281/a5c78386/Testvcomp10.csv?tsid=20091116-075223-c3093ab0;)) names(x) x[2:13] - lapply(x[2:13], factor) levels(x$P1L55) [1] 0 1 is.factor(x$P1L96) [1] TRUE sessionInfo() R version 2.10.0 (2009-10-26) i386-apple

Re: [R] pairs

2009-11-16 Thread David Winsemius
I stuck in another 7 in one of the lines with a 2 and reasoned that we could deal with the desire for non-ordered pair counting by pasting min(x,y) to max(x,y); dput(prmtx) structure(c(2, 1, 3, 9, 5, 7, 7, 8, 1, 7, 6, 5, 6, 2, 2, 7), .Dim = c(4L, 4L)) prmtx [,1] [,2] [,3] [,4] [1,]

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread A Singh
odd. --On 16 November 2009 04:59 -0800 Sundar Dorai-Raj sdorai...@gmail.com wrote: Works for me: x - read.csv(url(http://dc170.4shared.com/download/153147281/a5c78386/Testvc omp10.csv?tsid=20091116-075223-c3093ab0)) names(x) x[2:13] - lapply(x[2:13], factor) levels(x$P1L55) [1] 0 1

Re: [R] survreg function in survival package

2009-11-16 Thread carol white
Thank you David. I don't think that I could pass by rweibull function since I use uniform random variable to generate survival times having weibull distribution. Therefore, like you, I have not found any other solution to set the shape parameter. If I want to calculate hazard, I will need both

Re: [R] Conditional statement

2009-11-16 Thread jim holtman
Generate the numbers, test for zero and then set negatives to zero: set.seed(1) x - rnorm(100,5,3) sum(x0) [1] 3 x[x0] - 0 sum(x0) [1] 0 On Mon, Nov 16, 2009 at 7:43 AM, Rafael Moral rafa_moral2...@yahoo.com.br wrote: Dear useRs, I wrote a function that simulates a stochastic model in

Re: [R] Conditional statement

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 7:43 AM, Rafael Moral wrote: Dear useRs, I wrote a function that simulates a stochastic model in discrete time. The problem is that the stochastic parameters should not be negative and sometimes they happen to be. How can I conditionate it to when it draws a negative

Re: [R] Odp: ^ operator

2009-11-16 Thread Liviu Andronic
On 11/16/09, Ted Harding ted.hard...@manchester.ac.uk wrote: Not in this case (see below), though of course in general - takes precedence over ^, so, for example, in the expression -2^(1/3) the - is applied first, giving (-2); and then ^ is applied next, giving (-2)^(1/3). There is a

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread David Winsemius
...@gmail.com wrote: Works for me: x - read.csv(url(http://dc170.4shared.com/download/153147281/a5c78386/Testvc omp10.csv?tsid=20091116-075223-c3093ab0)) names(x) x[2:13] - lapply(x[2:13], factor) levels(x$P1L55) [1] 0 1 is.factor(x$P1L96) [1] TRUE sessionInfo() R version 2.10.0 (2009-10-26

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread Sundar Dorai-Raj
: Works for me: x - read.csv(url(http://dc170.4shared.com/download/153147281/a5c78386/Testvc omp10.csv?tsid=20091116-075223-c3093ab0)) names(x) x[2:13] - lapply(x[2:13], factor) levels(x$P1L55) [1] 0 1 is.factor(x$P1L96) [1] TRUE sessionInfo() R version 2.10.0 (2009-10-26) i386

[R] Error on reading an excel file

2009-11-16 Thread anna_l
Hello everybody, here is the code I use to read an excel file containing two rows, one of date, the other of prices: library(RODBC) z - odbcConnectExcel(SPX_HistoricalData.xls) datas - sqlFetch(z,Sheet1) close(z) It works pretty well but the only thing is that the datas

Re: [R] Odp: ^ operator

2009-11-16 Thread Alain Guillet
Hi, You forgot to put the parenthesis in the way Petr told you : (-6.108576e-05)^(1/3) and the result is NaN. What do you want to preserve? Alain carol white wrote: but with complex, I get complex numbers for the first and last elements: (as.complex(tmp))^(1/3) [1]

[R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Ottorino-Luca Pantani
Dear R users, my problem today deals with my ignorance on regular expressions. a matter I recently discovered. Consider the following foo - c(V_7_101110_V, V_7_101110_V, V_9_101110_V, V_9_101110_V, V_9_s101110_V, V_9_101110_V, V_9_101110_V, V_11_101110_V, V_11_101110_V, V_11_101110_V,

Re: [R] Odp: ^ operator

2009-11-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.11.2009 13:27:03: but with complex, I get complex numbers for the first and last elements: (as.complex(tmp))^(1/3) [1] 0.01969170+0.03410703i 0.03478442+0.i 0.03285672+0.i [4] 0.08950802+0.i 0.05848363+0.10129661i And

Re: [R] Odp: ^ operator

2009-11-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.11.2009 13:55:30: On 16-Nov-09 11:40:29, Petr PIKAL wrote: Hi AFAIK, this is issue of the preference of operators. r-help-boun...@r-project.org napsal dne 16.11.2009 11:24:59: Not in this case (see below), though of course in

Re: [R] Odp: ^ operator

2009-11-16 Thread Ted Harding
On 16-Nov-09 13:13:27, Liviu Andronic wrote: On 11/16/09, Ted Harding ted.hard...@manchester.ac.uk wrote: Not in this case (see below), though of course in general - takes precedence over ^, so, for example, in the expression -2^(1/3) the - is applied first, giving (-2); and then ^ is

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread A Singh
expected it to be anyway. I don't quite know where the issue is. Very odd. --On 16 November 2009 04:59 -0800 Sundar Dorai-Raj sdorai...@gmail.com wrote: Works for me: x - read.csv(url(http://dc170.4shared.com/download/153147281/a5c78386/Test vc omp10.csv?tsid=20091116-075223-c3093ab0)) names(x) x[2

Re: [R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Duncan Murdoch
On 11/16/2009 8:21 AM, Ottorino-Luca Pantani wrote: Dear R users, my problem today deals with my ignorance on regular expressions. a matter I recently discovered. You were close. First, gsub by default doesn't need escapes before the parens. (There are lots of different conventions for

Re: [R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 8:21 AM, Ottorino-Luca Pantani wrote: Dear R users, my problem today deals with my ignorance on regular expressions. a matter I recently discovered. Consider the following foo - c(V_7_101110_V, V_7_101110_V, V_9_101110_V, V_9_101110_V, V_9_s101110_V, V_9_101110_V,

Re: [R] Relase positive with log and zero of negative with 0

2009-11-16 Thread Peter Ehlers
David Winsemius wrote: On Nov 15, 2009, at 10:18 AM, rkevinbur...@charter.net wrote: This is a very simple question but I couldn't form a site search quesry that would return a reasonable result set. Say I have a vector: x - c(0,2,3,4,5,-1,-2) I want to replace all of the values in 'x'

Re: [R] Relase positive with log and zero of negative with 0

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 8:55 AM, Peter Ehlers wrote: David Winsemius wrote: On Nov 15, 2009, at 10:18 AM, rkevinbur...@charter.net wrote: This is a very simple question but I couldn't form a site search quesry that would return a reasonable result set. Say I have a vector: x -

[R] R: phase determination

2009-11-16 Thread Lisandro Benedetti Cecchi
Hi again: Any thought on the following?? I'm trying to determine the phase of irregularly sampled data. Is there any particular reason why both spec.pgram and spec.ls return phase-NULL for vectors? Thank you. Lisandro

Re: [R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: On 11/16/2009 8:21 AM, Ottorino-Luca Pantani wrote: Dear R users, my problem today deals with my ignorance on regular expressions. a matter I recently discovered. You were close. First, gsub by default doesn't need escapes before the parens. (There are lots of

Re: [R] lapply() not converting columns to factors (no error message)

2009-11-16 Thread Peter Dalgaard
A Singh wrote: Dear List, I'm having a curious problem with lapply(). I've used it before to convert a subset of columns in my dataframe, to factors, and its worked. But now, on re-running the identical code as before it just doesn't convert the columns into factors at all. As far as I

[R] Cluster analysis: hclust manipulation possible?

2009-11-16 Thread Jopi Harri
I am doing cluster analysis [hclust(Dist, method=average)] on data that potentially contains redundant objects. As expected, the inclusion of redundant objects affects the clustering result, i.e., the data a1, = a2, = a3, b, c, d, e1, = e2 is likely to cluster differently from the same data

[R] violin - like plots for bivariate data

2009-11-16 Thread Eric Nord
I'm attempting to produce something like a violin plot to display how y changes with x for members of different groups (My specific case is how floral area changes over time for several species of plants). I've looked at panel.violin (in lattice), which makes nice violin plots, but is really set

Re: [R] violin - like plots for bivariate data

2009-11-16 Thread Gabor Grothendieck
Try: RSiteSearch(violin plot) On Mon, Nov 16, 2009 at 9:40 AM, Eric Nord ericn...@psu.edu wrote: I'm attempting to produce something like a violin plot to display how y changes with x for members of different groups (My specific case is how floral area changes over time for several species

Re: [R] on gsub (simple, but not to me!) sintax

2009-11-16 Thread Ottorino-Luca Pantani
Duncan Murdoch ha scritto: On 11/16/2009 8:21 AM, Ottorino-Luca Pantani wrote: Dear R users, my problem today deals with my ignorance on regular expressions. a matter I recently discovered. You were close. First, gsub by default doesn't need escapes before the parens. (There are lots of

Re: [R] Weighted descriptives by levels of another variables

2009-11-16 Thread Andrew Miles
Thanks! Using the plyr package and the approach you outlined seems to work well for relatively simple functions (like wtd.mean), but so far I haven't had much success in using it with more complex descriptive functions like describe {Hmisc}. I'll take a look later, though, and see if I

Re: [R] package tm fails to remove the with remove stopwords

2009-11-16 Thread Mark Kimpel
Thanks Ingo. Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129 Work, Mobile VoiceMail (317) 399-1219 Skype No Voicemail please On Sun, Nov 15, 2009 at 11:05 AM, Ingo Feinerer

[R] Data source name not found and no default driver specified

2009-11-16 Thread helpme
I'm stumped. When trying to connect to Oracle using the RODBC package I get an error: *[RODBC] Data source name not found and no default driver specified. ODBC connect failed.* I've read over all the posts and documentation manuals. The system is Windows Server 2003 with R 2.81. and the latest

[R] extracting estimated covariance parameters from lme fit

2009-11-16 Thread Green, Gerwyn (greeng6)
Dear all Apologies in advance as this seems like a trivial question. Nonetheless, a question I haven't been able to resolve myself !. Within a single repetition of a simulation (to be repeated many times) I am fitting the following linear mixed model using lme... Y_{gtr} = \mu + U_{g} + W_{gt}

Re: [R] violin - like plots for bivariate data

2009-11-16 Thread Liaw, Andy
sounds like bivariate density contours may be what you're looking for. Andy From: Eric Nord I'm attempting to produce something like a violin plot to display how y changes with x for members of different groups (My specific case is how floral area changes over time for several species

[R] (Parallel) Random number seed question...

2009-11-16 Thread Blair Christian
Hi All, I have k identical parallel pieces of code running, each using n.rand random numbers.  I would like to use the same RNG (for now), and set the seeds so that I can guarantee that there are no overlaps in the random numbers sampled by the k pieces of code.  Another side goal is to have

[R] extracting values from correlation matrix

2009-11-16 Thread Lee William
Hi! All, I have 2 correlation matrices of 4000x4000 both with same row names and column names say cor1 and cor2. I have extracted some information from 1st matrix cor1 which is something like this: rowname colname cor1_value a b0.8 b a0.8 c

Re: [R] extracting values from correlation matrix

2009-11-16 Thread jim holtman
Assuming that your data is in a dataframe 'cordata' , then following should work: cordata$cor2_value - sapply(1:nrow(cordata), function(.row){ cor2[cordata$rowname[.row], cordata$colname[.row]] } On Mon, Nov 16, 2009 at 11:44 AM, Lee William leeon...@gmail.com wrote: Hi! All, I have 2

Re: [R] Cluster analysis: hclust manipulation possible?

2009-11-16 Thread Charles C. Berry
On Mon, 16 Nov 2009, Jopi Harri wrote: I am doing cluster analysis [hclust(Dist, method=average)] on data that potentially contains redundant objects. As expected, the inclusion of redundant objects affects the clustering result, i.e., the data a1, = a2, = a3, b, c, d, e1, = e2 is likely to

[R] specifying group plots using panel.groups

2009-11-16 Thread wintere
Hi, I am trying to plot two types of data on the same graph: points and distributions. I am attempting to use the panel.groups function, but cannot seem to get it to work. I have a melted data set and put in a FLAG column to separate my data into the two groups that I would like to plot, point

[R] R-help

2009-11-16 Thread Lloyd Barcza
I have been trying to write a function for the following problem: Suppose I have three vectors a,b,c of different lengths: e.g. a=c(a1,a2,a3,...) where a[i] form the basis of our function variables: if we define a table for example: and define the fn(x)

[R] test for causality

2009-11-16 Thread tobiasfa
Hi useRs.. I cant figure out how to test for causality using causality() in vars package I have two datasets (A, B) and i want to test if A (Granger)cause B. How do I write the script? I dont understand ?causality. How do I get x to contain A and B. Further using the command VAR() to specify x,

[R] R-help

2009-11-16 Thread Lloyd Barcza
I have been trying to write a function for the following problem: Suppose I have three vectors a,b,c of different lengths: e.g. a=c(a1,a2,a3,...) where a[i] form the basis of our function variables: if we define a table for example: and define the fn(x)

Re: [R] Step Function Freezing R

2009-11-16 Thread Jgabriel
Can you think of any systemic changes that might interefere with R besides Symantec EndPoint and LiveUpdate? I have removed those programs and allocated more memory to R, but it is still way too slow. On Nov 13, 10:45 pm, J Dougherty j...@surewest.net wrote: On Friday 13 November 2009 07:17:28

Re: [R] (Parallel) Random number seed question...

2009-11-16 Thread Torsten Hothorn
On Mon, 16 Nov 2009, Blair Christian wrote: Hi All, I have k identical parallel pieces of code running, each using n.rand random numbers.  I would like to use the same RNG (for now), and set the seeds so that I can guarantee that there are no overlaps in the random numbers sampled by the k

[R] Discontinuous graph

2009-11-16 Thread Tim Smith
Hi, I wanted to make a graph with the following table (2 rows, 3 columns): a b c x 1 3 5 y 5 8 6 The first column represents the start cordinate, and the second column contains the end cordinate for the x-axis. The third column contains the y-axis co-ordinate. For example, the first row in the

Re: [R] Discontinuous graph

2009-11-16 Thread Steve Lianoglou
Hi Tim, On Nov 16, 2009, at 12:40 PM, Tim Smith wrote: Hi, I wanted to make a graph with the following table (2 rows, 3 columns): a b c x 1 3 5 y 5 8 6 The first column represents the start cordinate, and the second column contains the end cordinate for the x-axis. The third column

Re: [R] Discontinuous graph

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 12:40 PM, Tim Smith wrote: Hi, I wanted to make a graph with the following table (2 rows, 3 columns): a b c x 1 3 5 y 5 8 6 The first column represents the start cordinate, and the second column contains the end cordinate for the x-axis. The third column contains the

Re: [R] Error on reading an excel file

2009-11-16 Thread cls59
anna_l wrote: Hello everybody, here is the code I use to read an excel file containing two rows, one of date, the other of prices: library(RODBC) z - odbcConnectExcel(SPX_HistoricalData.xls) datas - sqlFetch(z,Sheet1) close(z) It works pretty well but the only thing is

Re: [R] Error on reading an excel file

2009-11-16 Thread anna_l
Thanks Charlie, well yes it included one row with two NA datas. I guess there is an explanation, let´s wait and see if someone knows more about it :) cls59 wrote: anna_l wrote: Hello everybody, here is the code I use to read an excel file containing two rows, one of date, the other of

Re: [R] Discontinuous graph

2009-11-16 Thread Steve Lianoglou
On Nov 16, 2009, at 12:58 PM, David Winsemius wrote: On Nov 16, 2009, at 12:40 PM, Tim Smith wrote: Hi, I wanted to make a graph with the following table (2 rows, 3 columns): a b c x 1 3 5 y 5 8 6 The first column represents the start cordinate, and the second column contains the end

Re: [R] Error on reading an excel file

2009-11-16 Thread Gabor Grothendieck
You could try one of the other methods of reading Excel files and see if they are affected: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows On Mon, Nov 16, 2009 at 8:19 AM, anna_l lippelann...@hotmail.com wrote: Hello everybody, here is the code I use to read an excel file

Re: [R] Error on reading an excel file

2009-11-16 Thread cls59
Gabor Grothendieck wrote: You could try one of the other methods of reading Excel files and see if they are affected: I would guess that since Excel includes the blank rows when exporting to CSV, then blank cells are being stored by Excel in the data files-- therefore any method of

[R] Sum over indexed value

2009-11-16 Thread Gunadi
I am sure this is easy but I am not finding a function to do this. I have two columns in a matrix. The first column contains multiple entries of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The second column contains unique numbers. I want to sum the numbers in column two based on the

[R] printing a single row, but dont know which row to print

2009-11-16 Thread frenchcr
I have 20 columns of data, and in column 5 I have a value of 17600 but I dont know which row this value is in (i have over 300,000 rows). I'm trying to do 2 things: 1) I want to find out which row in column 5 has this number in it. 2) Then I want to print out that row with all the column

Re: [R] Discontinuous graph

2009-11-16 Thread baptiste auguie
Hi, An alternative with ggplot2, library(ggplot2) ggplot(data=coords) + geom_segment(aes(x=a, xend=b, y=c, yend=c)) HTH, baptiste 2009/11/16 David Winsemius dwinsem...@comcast.net: On Nov 16, 2009, at 12:40 PM, Tim Smith wrote: Hi, I wanted to make a graph with the following table (2

Re: [R] Sum over indexed value

2009-11-16 Thread smu
P=data.frame(x=c(1,1,2,3,2,1),y=rnorm(6)) tapply(P$y,P$x,sum) regards, stefan On Mon, Nov 16, 2009 at 09:49:17AM -0800, Gunadi wrote: I am sure this is easy but I am not finding a function to do this. I have two columns in a matrix. The first column contains multiple entries of

Re: [R] printing a single row, but dont know which row to print

2009-11-16 Thread baptiste auguie
Hi, Try this, set.seed(2) # reproducible d = matrix(sample(1:20,20), 4, 5) d d[ d[ ,2] == 18 , ] You may need to test with all.equal if your values are subject to rounding errors. HTH, baptiste 2009/11/16 frenchcr frenc...@btinternet.com: I have 20 columns of data, and in column 5 I have

[R] No Visible Binding for global variable

2009-11-16 Thread Doran, Harold
While building a package, I see the following: * checking R code for possible problems ... NOTE cheat.fit: no visible binding for global variable 'Zobs' plot.jml: no visible binding for global variable 'Var1' I see the issue has come up before, but I'm having a hard time discerning how

Re: [R] printing a single row, but dont know which row to print

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 1:38 PM, baptiste auguie wrote: Hi, Try this, set.seed(2) # reproducible d = matrix(sample(1:20,20), 4, 5) d d[ d[ ,2] == 18 , ] You may need to test with all.equal if your values are subject to rounding errors. HTH, baptiste 2009/11/16 frenchcr

Re: [R] No Visible Binding for global variable

2009-11-16 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Monday, November 16, 2009 10:45 AM To: r-help@r-project.org Subject: [R] No Visible Binding for global variable While building a package, I see the

Re: [R] extracting estimated covariance parameters from lme fit

2009-11-16 Thread Kingsford Jones
The VarCorr function will extract the components of the random effects covariance matrix, but note the quirk that it returns values as characters: library(nlme) f1 - lme(distance ~ age, data = Orthodont, random = ~1 + age|Subject) (vc - VarCorr(f1)) # Subject = pdLogChol(1 + age) #

Re: [R] Sum over indexed value

2009-11-16 Thread Henrique Dallazuanna
Try this: with(DF, rowsum(Col2, Col1)) On Mon, Nov 16, 2009 at 3:49 PM, Gunadi boydkra...@gmail.com wrote: I am sure this is easy but I am not finding a function to do this. I have two columns in a matrix. The first column contains multiple entries of numbers from 1 to 100 (i.e. 10 ones, 8

[R] in excel i can sort my dataset, what do i use in R

2009-11-16 Thread frenchcr
In excel a handy tool is the sort data by column ...i.e. i can highlight the whole dataset and sort it according to a particular column...like sort the data in a column in acending or decending order where all the other columns change aswell. I need to do this in R now but dont know how.

Re: [R] in excel i can sort my dataset, what do i use in R

2009-11-16 Thread baptiste auguie
?order ?sort 2009/11/16 frenchcr frenc...@btinternet.com: In excel a handy tool is the sort data by column ...i.e. i can highlight the whole dataset and sort it according to a particular column...like sort the data in a column in acending or decending order where all the other columns

Re: [R] Data source name not found and no default driver specified

2009-11-16 Thread helpme
I forgot to mention that it's running Windows Server 2003 x64 OS version On Mon, Nov 16, 2009 at 11:22 AM, helpme myrquesti...@gmail.com wrote: I'm stumped. When trying to connect to Oracle using the RODBC package I get an error: *[RODBC] Data source name not found and no default driver

[R] fitting a logistic regression with mixed type of variables

2009-11-16 Thread Jack Luo
Hi, I am trying to fit a logistic regression using glm, but my explanatory variables are of mixed type: some are numeric, some are ordinal, some are categorical, say If x1 is numeric, x2 is ordinal, x3 is categorical, is the following formula OK? *model - glm(y~x1+x2+x3,

[R] object not found inside step() function

2009-11-16 Thread shuai yuan
Hi, there, My appologize if someone ask the same question before. I searched the mailing list and found one similar post, but not what i want. The problem for me is, I use the step( glm()) to do naive forward selection for logistic regression. My code is functional in the open environment.

Re: [R] fitting a logistic regression with mixed type of variables

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 2:22 PM, Jack Luo wrote: Hi, I am trying to fit a logistic regression using glm, but my explanatory variables are of mixed type: some are numeric, some are ordinal, some are categorical, say If x1 is numeric, x2 is ordinal, x3 is categorical, is the following formula

Re: [R] pairs

2009-11-16 Thread cindy Guo
I forgot to say that there are no ties in each row. So any number can occur only once in each row. Also as I mentioned earlier, actually I only need the top 50 most frequent pairs, is there a more efficient way to do it? Because I have 15000 numbers, output of all the pairs would be too long.

Re: [R] No Visible Binding for global variable

2009-11-16 Thread Duncan Murdoch
On 11/16/2009 1:54 PM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold Sent: Monday, November 16, 2009 10:45 AM To: r-help@r-project.org Subject: [R] No Visible Binding for global variable

Re: [R] pairs

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 2:32 PM, cindy Guo wrote: I forgot to say that there are no ties in each row. So any number can occur only once in each row. Also as I mentioned earlier, actually I only need the top 50 most frequent pairs, is there a more efficient way to do it? Because I have

Re: [R] Sum over indexed value

2009-11-16 Thread cls59
Gunadi wrote: I am sure this is easy but I am not finding a function to do this. I have two columns in a matrix. The first column contains multiple entries of numbers from 1 to 100 (i.e. 10 ones, 8 twos etc.). The second column contains unique numbers. I want to sum the numbers in

Re: [R] pairs

2009-11-16 Thread cindy Guo
Do you mean if the numbers in each row are ordered? They are not, but if it's needed, we can order them. The matrix only has 5000 rows. On Mon, Nov 16, 2009 at 1:34 PM, David Winsemius dwinsem...@comcast.netwrote: On Nov 16, 2009, at 2:32 PM, cindy Guo wrote: I forgot to say that there are

[R] extracting the last row of each group in a data frame

2009-11-16 Thread Hao Cen
Hi, I would like to extract the last row of each group in a data frame. The data frame is as follows Name Value A 1 A 2 A 3 B 4 B 8 C 2 D 3 I would like to get a data frame as Name Value A 3 B 8 C 2 D 3 Thank you for your suggestions in advance Jeff

Re: [R] pairs

2009-11-16 Thread cls59
David Winsemius wrote: ?order cindy Guo wrote: Do you mean if the numbers in each row are ordered? They are not, but if it's needed, we can order them. The matrix only has 5000 rows. No, he's suggesting you check out the order() function by calling it's help page: ?order order()

Re: [R] pairs

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 2:41 PM, cindy Guo wrote: Do you mean if the numbers in each row are ordered? They are not, but if it's needed, we can order them. The matrix only has 5000 rows. No, I mean type ?order at the R command line and read the help page. On Mon, Nov 16, 2009 at 1:34 PM,

[R] Writing a data frame in an excel file

2009-11-16 Thread anna_l
Hello, I am having trouble by using the write.table function to write a data frame of 4 columns and 7530 rows. I don´t know if I should just use a sep=\n and change the .xls file into a .csv file. Thanks in advance - Anna Lippel new in R so be careful I should be asking a lt of

Re: [R] extracting the last row of each group in a data frame

2009-11-16 Thread baptiste auguie
Hi, You could try plyr, library(plyr) ddply(d,.(Name), tail,1) Name Value 1A 3 2B 8 3C 2 4D 3 HTH, baptiste 2009/11/16 Hao Cen h...@andrew.cmu.edu: Hi, I would like to extract the last row of each group in a data frame. The data frame is as follows

Re: [R] fitting a logistic regression with mixed type of variables

2009-11-16 Thread Jack Luo
David, Thanks for your reply. Since I am kinda new to this forum, could you please advise me on where to read those questions in R-help? In addition, I did not pay much attention to the na.action, probably I should use na.action = na.omit instead of na.pass. -Jack On Mon, Nov 16, 2009 at 2:32

Re: [R] pairs

2009-11-16 Thread cindy Guo
Thank you. I will check that. Cindy On Mon, Nov 16, 2009 at 1:45 PM, cls59 ch...@sharpsteen.net wrote: David Winsemius wrote: ?order cindy Guo wrote: Do you mean if the numbers in each row are ordered? They are not, but if it's needed, we can order them. The matrix only has 5000

Re: [R] extracting the last row of each group in a data frame

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 2:42 PM, Hao Cen wrote: Hi, I would like to extract the last row of each group in a data frame. The data frame is as follows Name Value A 1 A 2 A 3 B 4 B 8 C 2 D 3 by(dfname$Value, dfname$Name, tail, 1) #which gets you a list Or: aggregate(dfname$Value,

Re: [R] extracting the last row of each group in a data frame

2009-11-16 Thread Jorge Ivan Velez
Dear Jeff, Here is a suggestion using tapply: data.frame(last = with(x, tapply(Value, Name, function(x) x[length(x)]))) See ?tapply for more information. HTH, Jorge On Mon, Nov 16, 2009 at 2:42 PM, Hao Cen wrote: Hi, I would like to extract the last row of each group in a data frame.

Re: [R] extracting the last row of each group in a data frame

2009-11-16 Thread cls59
jeffc wrote: Hi, I would like to extract the last row of each group in a data frame. The data frame is as follows Name Value A 1 A 2 A 3 B 4 B 8 C 2 D 3 I would like to get a data frame as Name Value A 3 B 8 C 2 D 3 Thank you for your suggestions in advance Jeff

Re: [R] object not found inside step() function

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 2:31 PM, shuai yuan wrote: Hi, there, My appologize if someone ask the same question before. I searched the mailing list and found one similar post, but not what i want. The problem for me is, I use the step( glm()) to do naive forward selection for logistic

  1   2   >