Re: [R] Vertical subtraction in dataframes

2010-03-12 Thread Gabor Grothendieck
And here is one more SQL solution. This one uses the window functions in PostgreSQL and is slightly more compact and even closer to the pure R version in our prior post. We quote Count so its not regarded as the reserved word of the same name. Note that if RpgSQL is loaded then sqldf will automati

Re: [R] Vertical subtraction in dataframes

2010-03-12 Thread Gabor Grothendieck
Try this ave solution noting that summing Count * (stain == "none") over each group gives the Count in its stain=="none" row and ave causes that Count value to be repeated for every row of the group so we get a vector that can be subtracted from Count: transform(DF, calib = Count - ave(Count * (st

Re: [R] Vertical subtraction in dataframes

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 5:27 PM, Sam Albers wrote: Hello all, I have not been able to find an answer to this problem. I feel like it might be so simple though that it might not get a response. Suppose I have a dataframe like the one I have copied below (minus the 'calib' column). I wish to cre

Re: [R] Vertical subtraction in dataframes

2010-03-12 Thread Dennis Murphy
Hi: Here's a ddply solution to your problem (package plyr): library(plyr) # within group function to apply; assumes that 'none' is first obs in group # x will be the Count variable in the call... subt2 <- function(x) x - x[1] head(df) rep Count stain 11 1522.0none 21 147.0

Re: [R] Usage of apply function with two matrices

2010-03-12 Thread jim holtman
Consider using the indices instead of the matrices themselves. You can pass a list of indices and then reference the two matrices any way you want to compute the return value. On Fri, Mar 12, 2010 at 6:49 AM, Michal Szewczyk wrote: > > Hello, > > I am struggling to overcome following problem: >

Re: [R] Define column names to a series of data.frames

2010-03-12 Thread Gabor Grothendieck
Try this # set up test data # BOD1 and BOD2 are same as built in BOD BOD1 <- BOD2 <- BOD env <- .GlobalEnv object.names <- objects(pattern = "BOD", env) # change col names of BOD1 to A & B. Ditto for BOD2. for(nm in object.names) names(env[[nm]]) <- c("A", "B") On Thu, Mar 11, 2010 at 7:33 AM,

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread Don MacQueen
Everyone is being too complicated. c( A[1,2] , A[3,3] ) will do what you ask. A <- matrix(seq(1,9),nrow=3) c( A[1,2] , A[3,3] ) [1] 4 9 But I would assume you have some more general problem in mind, and I do not know if this simple approach will meet those needs. -Don At 3:26 PM

[R] testing parallelism of does-response curves using nls()

2010-03-12 Thread array chip
Hi, I am trying to use F test or Chi-square test to test if 2 5-parameter (A, B, xmid, scal and H) logistic curves are parallel based on residual sum of squares. What's usually done is to first fit the 2 curves using a constraint (or global) model where all parameters are kept the same except f

Re: [R] Odp: Define column names to a series of data.frames

2010-03-12 Thread Nikos Alexandris
Thanks to all for the replies. I'll post back here when I get things working (...in a couple of days). Nikos __ 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/post

Re: [R] defining columns in a matrix

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 5:29 PM, Kindra Martinenko wrote: Hi all, I have the following 7 x 7 matrix. I am trying to figure out how to label the columns to something more descriptive other than [,1], [,2], etc. I have tried the c(x,y,z,) function, but I get a error returned stating that my vectors

Re: [R] Vertical subtraction in dataframes

2010-03-12 Thread Jonathan Christensen
Hello, On Fri, Mar 12, 2010 at 3:27 PM, Sam Albers wrote: > Hello all, > > I have not been able to find an answer to this problem. I feel like it > might > be so simple though that it might not get a response. > > Suppose I have a dataframe like the one I have copied below (minus the > 'calib' co

Re: [R] defining columns in a matrix

2010-03-12 Thread Joshua Wiley
Dear Kindra, I think you are talking about... matrix(1:9, nrow=3, dimnames=list(NULL, c("First","Second","Third"))) First Second Third [1,] 1 4 7 [2,] 2 5 8 [3,] 3 6 9 If I am correct, what you are missing is that "dimnames" requires a list with two e

[R] StatEt: Error R Object Browser Update java.lang.NullPointerException

2010-03-12 Thread Paul
Hello, I'm trying to use StatEt on my kubuntu karmic system. I've set everything up according to the website and a guide pdf I've got, but when I start the R session, or issue a command, I get a "An internal error occurred during: "R Object Browser Update"." error; Any ideas on what to look

Re: [R] defining columns in a matrix

2010-03-12 Thread Ted Harding
On 12-Mar-10 22:29:07, Kindra Martinenko wrote: > Hi all, > I have the following 7 x 7 matrix. _I am trying to figure out > how to label the columns to something more descriptive other > than [,1], [,2], etc. > I have tried the c(x,y,z,) function, but I get a error returned > stating that my vector

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Ted Harding
On 12-Mar-10 19:41:22, Ali Tofigh wrote: > On Fri, Mar 12, 2010 at 14:27, Ted Harding > wrote: >> However, all that was a long time ago. Check 'page' in your >> newer R! > > Thanks for the tip. But I don't understand what page is supposed to > do. For example, > > page(1:3) > > simply displays

Re: [R] help about solving two equations

2010-03-12 Thread Ravi Varadhan
Here you go: require(BB) fn <- function(x, s){ f <- rep(NA, length(x)) f[1] <- digamma(x[1]) - digamma(x[1]+x[2]) - s[1] f[2] <- digamma(x[2]) - digamma(x[1]+x[2]) - s[2] f } nr <- 10 smat <- matrix(runif(2*nr, -3, -1), nr, 2) soln <- matrix(NA, nr, 2) for (i in 1:nr) { ans <- dfsane(

[R] defining columns in a matrix

2010-03-12 Thread Kindra Martinenko
Hi all, I have the following 7 x 7 matrix.  I am trying to figure out how to label the columns to something more descriptive other than [,1], [,2], etc. I have tried the c(x,y,z,) function, but I get a error returned stating that my vectors need to be the same length. Do I need to convert this to

[R] Vertical subtraction in dataframes

2010-03-12 Thread Sam Albers
Hello all, I have not been able to find an answer to this problem. I feel like it might be so simple though that it might not get a response. Suppose I have a dataframe like the one I have copied below (minus the 'calib' column). I wish to create a column like calib where I am subtracting the 'Co

Re: [R] Print density of 600 dpi for a plot

2010-03-12 Thread Barry Rowlingson
On Fri, Mar 12, 2010 at 9:52 PM, Bob Green wrote: > > I have to create a plot with a print density of 600 dpi . Within R, is there > a way to determine the print density of a plot? > > Any assistance is much appreciated, A PostScript, embedded PostScript, or PDF file has essentially infinite dpi

Re: [R] using xval in mvpart to specify cross validation groups

2010-03-12 Thread Andrew Dolman
Thank you Dennis, I've got the idea now. However, a followup question to make sure I'm not wasting my time. If I specify the precise CV folds to use, should I not get the same tree every time? e.g. here I have an hypothetical time sequence observed with error from 3 sites 's' If I specify to l

[R] Print density of 600 dpi for a plot

2010-03-12 Thread Bob Green
I have to create a plot with a print density of 600 dpi . Within R, is there a way to determine the print density of a plot? Any assistance is much appreciated, regards Bob __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Data frame question

2010-03-12 Thread Claudia Beleites
apjawor...@mmm.com wrote: Thanks for the quick reply. No, I did not run into any problems so far. I have been using the PLS package and the modelling functions seem to work just fine. In fact, even if I let the data.frame convert the x matrix to separate column, the "y ~ x" modeling syntax

Re: [R] remove text from the calibration plot

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 4:14 PM, paaventhan jeyaganth wrote: Dear all, how can i get rid of the text in the calibration plot below the x- axis. http://en.wikipedia.org/wiki/Correction_fluid David Winsemius, MD West Hartford, CT __ R-help@r-pro

Re: [R] Form using R

2010-03-12 Thread Barry Rowlingson
On Fri, Mar 12, 2010 at 7:06 PM, Nilza BARROS wrote: > It would be a form that is filled daily, but some fields were tabulated and > other fields would be filled with only the opinions of users. > > Currently, my form is a Word document that is the filling and printed. At > the end of every month

[R] remove text from the calibration plot

2010-03-12 Thread paaventhan jeyaganth
Dear all, how can i get rid of the text in the calibration plot below the x-axis. thanks Paaveen _ Check your Hotmail from your phone. [[alternative HTML version deleted]]

Re: [R] Handling repeated values differently

2010-03-12 Thread Ali Tofigh
Here is a suggestion: tapply(mat[,2], as.factor(m[,1]), sum) Cheers, /Ali On Fri, Mar 12, 2010 at 15:28, Juliet Ndukum wrote: > mat is a matrix with X and Y values. >> mat >       X  Y >  [1,] 56 20 >  [2,] 56 21 >  [3,]  2 50 >  [4,]  3 46 >  [5,] 18 77 >  [6,] 57 12 >  [7,] 57 36 >  [8,] 95 4

Re: [R] Handling repeated values differently

2010-03-12 Thread Jorge Ivan Velez
Hi Juliet, Here are two options: with(mat, aggregate(Y, list(X), sum)) with(mat, tapply(Y, list(X), sum)) See ?aggregate and ?tapply for more information. HTH, Jorge On Fri, Mar 12, 2010 at 3:28 PM, Juliet Ndukum <> wrote: > mat is a matrix with X and Y values. > > mat > X Y > [1,] 56

[R] unknown compression

2010-03-12 Thread R Heberto Ghezzo, Dr
Hello, I am trying to modify some functions in an existing package. I can get a function by just typing the name in the console, but how can I get all the functions in a package? the ./R/ subdirectory has files xx.rdb and xx.rdx which I can not decompress with 7-zip or with unzip, unrar etc. The

Re: [R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread Ali Tofigh
I would just get row indices: row.indices <- as.vector(sapply(0:25 * 5 + 1, function(x) {sort(sample(x:(x+4), 2))})) new.data.fram <- your.data.frame[row.indices, ] Cheers, /Ali On Fri, Mar 12, 2010 at 15:06, Hosack, Michael wrote: > Fellow R users, > > I am stumped on what would seem to be som

[R] Handling repeated values differently

2010-03-12 Thread Juliet Ndukum
mat is a matrix with X and Y values. > mat X Y [1,] 56 20 [2,] 56 21 [3,] 2 50 [4,] 3 46 [5,] 18 77 [6,] 57 12 [7,] 57 36 [8,] 95 45 [9,] 65 23 [10,] 33 25 [11,] 33 98 [12,] 63 96 [13,] 66 75 [14,] 99 54 [15,] 78 65 [16,] 75 69 [17,] 54 68 [18,] 54 67 [19,] 0 22 [20,] 14 74 [21

Re: [R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread Chuck Cleland
On 3/12/2010 3:06 PM, Hosack, Michael wrote: > Fellow R users, > > I am stumped on what would seem to be something fairly simple. > I have a dataframe that has a variable named 'WEEK' that takes > the numbers 1:26 (26 week time-period) with each number repeated > five times consecutively (once

Re: [R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread Dennis Murphy
Hi: A ddply solution: library(plyr) somedata = data.frame(week=rep(1:26,rep(5,26)),day=rep(1:5,26)) # sample two rows out of five per week daysamp <- function(x) x[sample(1:5, 2), ] # Ram it through ddply: ddply(somedata, .(week), daysamp) First part of output: week day 1 1 4 2 1

Re: [R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread Stephan Kolassa
Hi Mike, take an index vector that selects Monday and Tuesday out of each week, and then run a restricted random permutation on this vector which only permutes indices within each week. rperm() is in the sna package. library(sna) foo <- rep(c(TRUE,TRUE,FALSE,FALSE,FALSE),26) your.data[foo[rpe

Re: [R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 3:06 PM, Hosack, Michael wrote: Fellow R users, I am stumped on what would seem to be something fairly simple. I have a dataframe that has a variable named 'WEEK' that takes the numbers 1:26 (26 week time-period) with each number repeated five times consecutively (once for

Re: [R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread Phil Spector
Mike - Perhaps these suggestions will be helpful: somedata = data.frame(week=rep(1:26,rep(5,26)),day=rep(1:5,26)) res = by(somedata,somedata$week,function(x)x[sample(1:nrow(x),2),]) do.call(rbind,res) or do.call(rbind,lapply(split(somedata,somedata$week), function(x)x[sample(

Re: [R] Data frame question

2010-03-12 Thread Claudia Beleites
Andy, Did you run into any kind of trouble? I'm asking because I'm maintaining a package for spectroscopic data that heavily uses "I (spectra.matrix)" ... However, once you have the matrix safe inside the data.frame, you can delete the "AsIs": > a <- matrix (1:9, 3) > str (a) int [1:3, 1:

[R] Randomly sampling subsets of dataframe variable

2010-03-12 Thread Hosack, Michael
Fellow R users, I am stumped on what would seem to be something fairly simple. I have a dataframe that has a variable named 'WEEK' that takes the numbers 1:26 (26 week time-period) with each number repeated five times consecutively (once for each weekday, Monday through Friday). Ex. 12

[R] Data frame question

2010-03-12 Thread apjaworski
Hi, I have the following question about creating data frames. I want to create a data frame with 2 components: a vector and a matrix. Let me use a simple example: y <- rnorm(10) x <- matrix(rnorm(150), nrow=10) Now if I do dd <- data.frame(x=x, y=y) I get a data frame with 16 colums, but if

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 2:15 PM, Natalie Van Zuydam wrote: Hi, I did quote the string and as I told read.table to strip.white I also tried it with no spaces. "ASPIRIN DISP AAH" %in% tsf_data$name [1] FALSE "ASPIRINDISPAAH" %in% tsf_data$name [1] FALSE I have looked at the last lines of my y_d

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Ali Tofigh
On Fri, Mar 12, 2010 at 14:27, Ted Harding wrote: > However, all that was a long time ago. Check 'page' in your > newer R! Thanks for the tip. But I don't understand what page is supposed to do. For example, page(1:3) simply displays the text string "1:3" in less. And if I do x <- 1:3 page(x)

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 2:31 PM, David Winsemius wrote: On Mar 12, 2010, at 9:26 AM, Nils Rüfenacht wrote: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A <- matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 9:26 AM, Nils Rüfenacht wrote: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A <- matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and A[3,3] = 9 with a single command and without using a

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Ted Harding
Another approach may be useful. Back in May 2003 I raised a similar query: How to divert R output into a separate X window (in Linux) where it would apear after being piped through 'less'. This has the advantage that, if you choose to do it this way, it leaves your R console untouched. I raised the

Re: [R] Error Running TinnR with R

2010-03-12 Thread Jeff Laake
I'm considering going back to that version (or switching to Eclipse) because the newer Tinn-R version requires pacakges Tinn-r and Hmisc and something is aliasing functions in xtable which blows up my Sweave runs. For the time being I'm using cut-paste. On 3/12/2010 10:41 AM, jim holtman wrot

Re: [R] Form using R

2010-03-12 Thread Bert Gunter
Sounds like a job for sweave or perhaps one of the packages brew or odfWeave. See also the xtable package, perhaps. You would then be able to: -- read the latest data file -- have R produce all tabular summaries, analyses, plots -- output all the results in a nicely formatted template (report) wi

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
Hi, I did quote the string and as I told read.table to strip.white I also tried it with no spaces. "ASPIRIN DISP AAH" %in% tsf_data$name [1] FALSE "ASPIRINDISPAAH" %in% tsf_data$name [1] FALSE I have looked at the last lines of my y_data object and there is a problem with the file that I'm goin

Re: [R] Exporting animation of a series of plots

2010-03-12 Thread davidr
I think you can use package animation. See http://animation.yihui.name/ . HTH, David L. Reiner -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Flana Sent: Friday, March 12, 2010 12:14 PM To: r-help@r-project.org Subject: [R] Exportin

Re: [R] Form using R

2010-03-12 Thread Nilza BARROS
It would be a form that is filled daily, but some fields were tabulated and other fields would be filled with only the opinions of users. Currently, my form is a Word document that is the filling and printed. At the end of every month they are analyzed and the reasons for delays are tabulated and

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread Henrique Dallazuanna
Try this: diag(A[c(1,3),c(2,3)]) 2010/3/12 Nils Rüfenacht : > Dear all! > > I'm trying to get multiple values from a matrix by using a single command. > > Given a matrix A > > A <- matrix(seq(1,9),nrow=3,ncol=3) > > How can I get e.g. the values A[1,2] = 4 and A[3,3] = 9 with a single > command

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
842752|ASPIRIN DISP AAH|TABS|75MG|2.9 is taken directly from my y_data text file. If I search for ASPIRIN DISP AAH %in% y$name I get: FALSE. Despite the fact that it is there in the text file that I loaded into y. There must be a problem with my input. tsf_data <- read.table("feb09_267_presc_i

Re: [R] Getting multiple matrix-values using a single command

2010-03-12 Thread Claudia Beleites
use a matrix of n x 2 to index. For details: sec. 5.3 "Index matrices" in the introduction. HTH Claudia Nils Rüfenacht wrote: Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A <- matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the val

[R] Exporting animation of a series of plots

2010-03-12 Thread Flana
Hi All, Thank you in advance for your help. I made an agent-based model in R and I plot it using image() each timestep creating a nice animation. I can't seem to find in any of the R codes a means to export the series of images so that they can be played as a movie or animation. Thank you again.

[R] Likelihood Optimization With Categorical Variables

2010-03-12 Thread Dr. Federico Andreis
Dear all, I have the following problem: I have been using the routine "optim" in order to maximize a joint likelihood (basically a mixture with modeled weights) with quantitative variables..so far so good. Now I need to plug into the model a categorical variable (namely, age classes). Obviousl

[R] Usage of apply function with two matrices

2010-03-12 Thread Michal Szewczyk
Hello, I am struggling to overcome following problem: I have matrix Vf and matrix V, which both have 3 columns and I want to create a spline function basing on coordinates from this matrices (more precisely coordinates of function nr 1: x are taken from Vf[,1] and y are taken from V[,1] respecti

[R] Getting multiple matrix-values using a single command

2010-03-12 Thread Nils Rüfenacht
Dear all! I'm trying to get multiple values from a matrix by using a single command. Given a matrix A A <- matrix(seq(1,9),nrow=3,ncol=3) How can I get e.g. the values A[1,2] = 4 and A[3,3] = 9 with a single command and without using any loop? My first idea was to generate a row- and a

Re: [R] Error Running TinnR with R

2010-03-12 Thread jim holtman
These are some of the reasons I have stuck with version 1.19.4.7 of Tinn-R; it still works fine. On Fri, Mar 12, 2010 at 10:09 AM, stephen's mailinglist account < stephen4mailingli...@googlemail.com> wrote: > On 12 March 2010 14:27, teck-corp wrote: > > > > Hi Stephen, > > > > Thanks a lot for y

Re: [R] Help with aggregate and cor

2010-03-12 Thread James Marca
On Wed, Mar 10, 2010 at 12:08:52AM -0800, hvollmeier wrote: > > James, > > you may post your question to the R-SIG finance group with a small example. > If I understand your problem correctly it's like converting tick data of > financial time series into aggregates. (to 1-minute, hourly, daily

Re: [R] construct a list that consists of lists

2010-03-12 Thread Zhongyi Yuan
Hi Henrique, Great. I tried a similar thing but used list( replicate(6, list(para1 = 1:5, para2 = 5:9), simplify = FALSE) ) and didn't work. Seems I don't need list(...). Thanks. Zhongyi On Fri, Mar 12, 2010 at 11:56 AM, Henrique Dallazuanna wrote: > You can do this also, using replicate: > >

Re: [R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
That is not so. 842752 does not exist in y$item_code and ASPIRIN has a code of 22730. > 842752 %in% y$item_code [1] FALSE > subset(y, name == "ASPIRIN") item_codename formulation_code strength bnf_code 850 22730 ASPIRIN TABS300MG4.7.1 855 22780 ASPIRIN

Re: [R] construct a list that consists of lists

2010-03-12 Thread Henrique Dallazuanna
You can do this also, using replicate: replicate(6, list(para1 = 1:5, para2 = 5:9), simplify = FALSE) On Fri, Mar 12, 2010 at 2:51 PM, Zhongyi Yuan wrote: > Hi Jim, > > Dennis Murphy solved my problem by the following code. > Thank you for you suggestion. Will check out listBuilder function too.

[R] Fwd: sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
-- Forwarded message -- From: Natalie Van Zuydam Date: Fri, Mar 12, 2010 at 5:49 PM Subject: Re: [R] sqldf not joining all the fields To: David Winsemius Dear David I'm not sure what the problem is as for every item code there is a corresponding information in the y_data. For

Re: [R] construct a list that consists of lists

2010-03-12 Thread Zhongyi Yuan
Hi Jim, Dennis Murphy solved my problem by the following code. Thank you for you suggestion. Will check out listBuilder function too. best, Zhongyi # (2) A little more general: prespecify the number of list components # and run a one-line loop to populate the list > l <- vector('list', 6) >

[R] invalid connection with pipe()

2010-03-12 Thread Ali Tofigh
After using pipe() to view output in less, the pipe becomes invalid: $ p <- pipe("less") $ capture.output(1:100, file=p) $ p Error in summary.connection(x) : invalid connection $ close(p) Error in close.connection(p) : invalid connection Is this a bug? Other uses of pipe works differently: $ p <

Re: [R] sqldf not joining all the fields

2010-03-12 Thread David Winsemius
If I assign the file input to y_data and change you sqldf to > z <- sqldf("select * from x_data left join y_data using (item_code)"); z I can replicate your result. Even after changing the types of the two item_code fields to match I still get the same result and when I see to what degre

Re: [R] looking for a package to solve current-voltage equation I=f(I)

2010-03-12 Thread Berend Hasselman
On 12-03-2010, at 13:25, PtitBleu wrote: > > Hello, > > I'm looking for a R-package to solve such an equation : > > http://n4.nabble.com/file/n1590462/iv.png > > which is one current-voltage equation of a solar cell. ?uniroot Berend __ R-help@

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Natalie Van Zuydam
Sorry! It is the end of the day for me. So dput(x) structure(list(prochi = c("CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713"), prescribed_date = c("22/06/2001", "28/04/2000", "10/04/2000", "03/07/2000", "

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
Yes, its not clear what data was used. Please provide a single email that contains code that can be copied from R and pasted into another session that will reproduce the problem. x_data <- ...dput output goes here... y_data <- dput output goes here ... library(sqldf) ... rest of code ... or else

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
Sorry! It is the end of the day for me. So dput(x) structure(list(prochi = c("CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713"), prescribed_date = c("22/06/2001", "28/04/2000", "10/04/2000", "03/07/200

Re: [R] Help on getting help from manuals

2010-03-12 Thread Greg Snow
For programming you should start with "Writing R Extensions" (just scan the sections that don't apply to you yet). I would also recommend "S poetry" by Patrick Burns (http://www.burns-stat.com/) and "S Programming" by Venables and Ripley. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Cente

Re: [R] sqldf not joining all the fields

2010-03-12 Thread David Winsemius
You have now given two different assignments to x_data and none to y_data: The str( from the file access offering: > str(x_data) 'data.frame': 2848 obs. of 5 variables: $ item_code : int 100 110 150 160 161 164 200 210 212 220 ... $ name: chr "NEONACLEX K" "NEONACLEX"

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
The y_data file has over 9000 rows in it so I thought it would be more practical to give you the file to download -- View this message in context: http://n4.nabble.com/sqldf-not-joining-all-the-fields-tp1590786p1590833.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
What about y_data? On Fri, Mar 12, 2010 at 12:14 PM, Newbie19_02 wrote: > > dput(x_data) > > structure(list(prochi = c("CAO713", "CAO713", "CAO713", > "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", > "CAO713", "CAO713"), prescribed_date = c("22/06/2001"

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
Please provide code that I can just copy from your post and paste into my session. Either provide dput output as requested or provide the files on the internet together with code that reads them off the internet. On Fri, Mar 12, 2010 at 12:06 PM, Newbie19_02 wrote: > > http://n4.nabble.com/file

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
y_data <- read.table("feb_267_presc_items_tsf.txt", header = TRUE, sep = "|", quote = "\"'", dec = ".",as.is = TRUE,na.strings = "NA",colClasses = NA, nrows = 3864284, skip = 0, check.names = TRUE,fill=TRUE, strip.white = TRUE, blank.lines.skip = TRU

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
dput(x_data) structure(list(prochi = c("CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713", "CAO713"), prescribed_date = c("22/06/2001", "28/04/2000", "10/04/2000", "03/07/2000", "09/01/2001", "16/10/2001", "16/08/20

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
http://n4.nabble.com/file/n1590804/feb09_267_presc_items_tsf.txt feb09_267_presc_items_tsf.txt is the total file for y so if I use the command line with the total data for y then I get the output specified in z Thanks, Natalie -- View this message in context: http://n4.nabble.com/sqldf-not-jo

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Gabor Grothendieck
Try the View command. On Fri, Mar 12, 2010 at 11:15 AM, Ali Tofigh wrote: > I'm using R under Linux. Since the help function in R can use the > program less to display text, I'd like to know if it is possible for a > user to do the same. It would be very helpful to be able to view large > objects

Re: [R] sqldf not joining all the fields

2010-03-12 Thread Gabor Grothendieck
Can you show the output of dput(x_data) and dput(y_data). On Fri, Mar 12, 2010 at 11:56 AM, Newbie19_02 wrote: > > Dear R users, > > I have two data frames that were read from text files as follows: > > x_data <- read.table("x.txt", header = TRUE, sep = "|", quote = "\"'", >                dec =

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Greg Snow
Is this what you want? > pairs(iris[,-5], lower.panel=NULL) Also look at the pairs2 function in the TeachingDemos package for a way to plot one set of variables against another set. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.811

[R] sqldf not joining all the fields

2010-03-12 Thread Newbie19_02
Dear R users, I have two data frames that were read from text files as follows: x_data <- read.table("x.txt", header = TRUE, sep = "|", quote = "\"'", dec = ".",as.is = TRUE,na.strings = "NA",colClasses = NA, nrows = 3864284, skip = 0, check.names = TRUE,fill=TRUE

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Marc Schwartz
I am not seeing an immediately evident way of doing that. Bear in mind that pairs() is essentially a wrapper to automate the process of using par(mfrow = c(rows, columns)) and setting other graphical parameters such as margins, which sets up the grid of individual plots within the overall graph

Re: [R] ggplot2: Changing colour scheme for bar plot filling?

2010-03-12 Thread Xie Chao
On Wed, Mar 10, 2010 at 6:13 PM, baptiste auguie wrote: > not with the theme, as far as I know, but you can do: > > set_default_scale("fill", "discrete","grey") Can I set default shape in similar way? I tried this: set_default_scale("shape", "discrete", 19) Error in get(paste("Scale", firstUpper

Re: [R] Redirect/pipe output to less

2010-03-12 Thread Ali Tofigh
On Fri, Mar 12, 2010 at 11:18, David Winsemius wrote: > > On Mar 12, 2010, at 11:15 AM, Ali Tofigh wrote: > >> I'm using R under Linux. Since the help function in R can use the >> program less to display text, I'd like to know if it is possible for a >> user to do the same. It would be very helpfu

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Jack Luo
That works, thanks. In addition, is there a way to specify the color and symbol for some of the figures in the panel, but not all of them? Seems that the color and symbol arguments apply to all the figures in the panel. Thanks, -Jack On Fri, Mar 12, 2010 at 11:16 AM, Marc Schwartz wrote: > On M

Re: [R] Redirect/pipe output to less

2010-03-12 Thread David Winsemius
On Mar 12, 2010, at 11:15 AM, Ali Tofigh wrote: I'm using R under Linux. Since the help function in R can use the program less to display text, I'd like to know if it is possible for a user to do the same. It would be very helpful to be able to view large objects (matrices/dataframes etc) using

Re: [R] looking for a package to solve current-voltage equation I=f(I)

2010-03-12 Thread Mario Valle
?optim RSiteSearch("nonlinear equation solver") CRAN task view (optimization) Do a little work for your own before asking other to work for you. mario On 12-Mar-10 13:25, PtitBleu wrote: Hello, I'm looking for a R-package to solve such an equation : http://n4.nabble.com/file/

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Marc Schwartz
On Mar 12, 2010, at 10:09 AM, Jack Luo wrote: > Hi, > > I am trying to use function pairs to plot the scatterplot, but I only want > to keep the upper triangle, what's the argument to do this? > > Thanks, > > -Jack Try setting the 'lower.panel' argument to NULL. Compare: pairs(USJudgeRatin

Re: [R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Steve Lianoglou
Hi, On Fri, Mar 12, 2010 at 11:09 AM, Jack Luo wrote: > Hi, > > I am trying to use function pairs to plot the scatterplot, but I only want > to keep the upper triangle, what's the argument to do this? I don't really understand what you're trying to ask, but does upper.tri function help? R> ?upp

Re: [R] Help on getting help from manuals

2010-03-12 Thread Patrick Burns
A new resource along these lines is: "Some hints for the R beginner" http://www.burns-stat.com/pages/Tutor/hints_R_begin.html If you have ideas on how to improve on it, please let me know. Pat On 12/03/2010 09:41, ManInMoon wrote: Hi, A number of people have suggested "I read the manuals"..

[R] Redirect/pipe output to less

2010-03-12 Thread Ali Tofigh
I'm using R under Linux. Since the help function in R can use the program less to display text, I'd like to know if it is possible for a user to do the same. It would be very helpful to be able to view large objects (matrices/dataframes etc) using less. This is preferable to redirecting output to f

[R] how to plot only the upper triangle using the pairs function?

2010-03-12 Thread Jack Luo
Hi, I am trying to use function pairs to plot the scatterplot, but I only want to keep the upper triangle, what's the argument to do this? Thanks, -Jack [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.et

Re: [R] Error Running TinnR with R

2010-03-12 Thread Keith Jewell
Many people seem to have trouble defining '.trPaths' which is the set of file names which TinnR uses to communicate with R; the user must be able to create/write/read these files/folders. In my Rprofile.site I have the single assingment: .trPaths <- paste(paste(Sys.getenv("APPDATA"), "\\Tinn-R\\

Re: [R] Error Running TinnR with R

2010-03-12 Thread stephen's mailinglist account
On 12 March 2010 14:27, teck-corp wrote: > > Hi Stephen, > > Thanks a lot for your answer. Unfortunately this does not work for me > neither. > Could you maybe let me know what is written in you RprofileSite-file now? > > Best > Dennis > -- > View this message in context: > http://n4.nabble.com/E

Re: [R] Return one value, print another

2010-03-12 Thread Joshua Wiley
Dieter: I had considered creating a special class, but you are right that it was more than I (really) wanted to do. Setting the global digits option is an excellent suggestion. Thank you. Right now I am working with simple functions mostly to save myself a few steps. Miguel: I did not use pri

[R] Form using R

2010-03-12 Thread Nilza BARROS
Hi, R users We can create a form using R? I would like to create a form where the information can be read by R. Itneeds to be updated daily because I have to tabulate the reasons for delays in the generation of numerical models products. I really appreciate any help, Thanks in advance, Nilza B

Re: [R] rmaxwell in C

2010-03-12 Thread Yihui Xie
The manual R-exts, section 6.7.1 should help if you want to call rgamma() in C. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA 2010/3/12 xie : > rmaxwell() depends on rgamma(), so what you actu

Re: [R] rmaxwell in C

2010-03-12 Thread Yihui Xie
rmaxwell() depends on rgamma(), so what you actually need is to download R source (rgamma() might depend further on other functions, though). > library(VGAM) > rmaxwell function (n, a) { if (!is.Numeric(n, posit = TRUE, allow = 1)) stop("bad input for argument 'n'") if (any(a <= 0)

Re: [R] Error Running TinnR with R

2010-03-12 Thread teck-corp
Hi Stephen, Thanks a lot for your answer. Unfortunately this does not work for me neither. Could you maybe let me know what is written in you RprofileSite-file now? Best Dennis -- View this message in context: http://n4.nabble.com/Error-Running-TinnR-with-R-tp876004p1590576.html Sent from the

Re: [R] Return one value, print another

2010-03-12 Thread Miguel Porto
Yeah that's right; in that case implementing the print.myclass as you say would be the best option. Miguel On Fri, Mar 12, 2010 at 2:17 PM, Dieter Menne wrote: > > > Miguel Porto wrote: > > > > Hmm... do something like that, no need to change the global option (I > used > > a > > named vector in

Re: [R] Return one value, print another

2010-03-12 Thread Dieter Menne
Miguel Porto wrote: > > Hmm... do something like that, no need to change the global option (I used > a > named vector instead of a list, it's more convenient): > > eg <- function(x, digits=4) { > xbar <- mean(x) > sdx <- sd(x) > value <- c(xbar, sdx) > names(value) <- c("Mean of X", "SD of X")

  1   2   >