Re: [R] R on Linux - a primer

2010-03-17 Thread Mike Miller
Thanks for sharing the interesting information about cran2deb. I was unaware of that project (but I did know that Dirk E. had been doing Octave and R binaries for Debian for years). Dirk Eddelbuettel (you spelled his name correctly) and Charles Blundell gave a talk at UseR! 2009... http://di

[R] Using indexing to manipulate data

2010-03-17 Thread duncandonutz
I know one of R's advantages is it's ability to index, eliminating the need for control loops to select relevant data, so I thought this problem would be easy. I can't crack it. I have looked through past postings, but nothing seems to match this problem I have a data set with one column of act

[R] Care to share an R presentation?

2010-03-17 Thread Paul Johnson
The R movement is picking up steam in the center of America. People that ignored my R-enthusiasm 10 years ago are now calling me up asking for presentations. I need to make a 2 hour presentation to a collection of faculty and grad students who might like to use R. I don't want to make it seem to

Re: [R] Locating an error

2010-03-17 Thread Erik Iverson
Worik R wrote: Related: I found the problem eventually. It was a parameter that was too large and the function called "stop". Looking at the documentation I see I can supply my own error handler. Cool. Are there already written error handlers that dump a stack trace? Is ?traceback what you

Re: [R] Intersect, Union of date/time ranges

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 10:52 PM, Nathan S. Watson-Haigh wrote: I have 2 sets of data which defines the start and end of date/time periods. I want to be able to obtain the following: 1) The intersect of those 2 sets of date/time ranges i.e. return start/end date/time ranges where both sets ove

Re: [R] R and getting a file through https

2010-03-17 Thread David Winsemius
On Mar 18, 2010, at 12:03 AM, Orvalho Augusto wrote: Dears! I have a system that generates links on a https webserver. I have to be logged on with a username and password; Then follow at least fife links to get into the link where I can download the file. The question is: How can I accomplis

Re: [R] Distances between two datasets of x and y co-ordinates

2010-03-17 Thread Adrian Baddeley
Tom_R wrote: > How do I use nncross to measure min distances between > point patterns i,j, ENSURING each point in pattern i > is only connected to a single partner point in pattern j ? > I do realise that there are many possible pairings > between the i-j point pairs... perhaps some average > m

Re: [R] how to take multiple subsets from a matrix

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 8:54 PM, dc896148 wrote: useR's I have a matrix from which I want to take multiple subsets from, according to a particular scheme I will now describe. The matrix below (mat) is 5x5, and I want to take 9 subsets of it, each of dimension 3x3. The best way to explain

Re: [R] Distances between two datasets of x and y co-ordinates

2010-03-17 Thread Rolf Turner
On 18/03/2010, at 12:25 PM, Tom_R wrote: > > Hi, > How do I use nncross to measure min distances between point patterns i,j, > ENSURING each point in pattern i is only connected to a single partner > point in pattern j ? > I do realise that there are many possible pairings between the i-j poi

[R] R and getting a file through https

2010-03-17 Thread Orvalho Augusto
Dears! I have a system that generates links on a https webserver. I have to be logged on with a username and password; Then follow at least fife links to get into the link where I can download the file. The question is: How can I accomplish that with R? Caveman

[R] error while usig "tm" package

2010-03-17 Thread Himanshu B. Dave
I have recently started using "tm" package by Feinerer, K. Hornik, and D. Meyer. While trying to create a term-document matrix from a corpus (approxly 440 docs) I get the following error: tdm <- TermDocumentMatrix(tmp, control=list(weighting=weightTfIdf, minDocFreq=2, minWordLength=3)) *Error in r

[R] how to take multiple subsets from a matrix

2010-03-17 Thread dc896148
useR's I have a matrix from which I want to take multiple subsets from, according to a particular scheme I will now describe. The matrix below (mat) is 5x5, and I want to take 9 subsets of it, each of dimension 3x3. The best way to explain what the result should look like is with the following:

[R] Intersect, Union of date/time ranges

2010-03-17 Thread Nathan S. Watson-Haigh
I have 2 sets of data which defines the start and end of date/time periods. I want to be able to obtain the following: 1) The intersect of those 2 sets of date/time ranges i.e. return start/end date/time ranges where both sets overlap 2) The union of those 2 sets of date/time ranges i.e. return

Re: [R] Distances between two datasets of x and y co-ordinates

2010-03-17 Thread Tom_R
Hi, How do I use nncross to measure min distances between point patterns i,j, ENSURING each point in pattern i is only connected to a single partner point in pattern j ? I do realise that there are many possible pairings between the i-j point pairs... perhaps some average min distance for many

Re: [R] How to use "ifelse" to generate random value from a distribution

2010-03-17 Thread alex46015
Thanks for all you guys'  help above.   Actually my question is for Multivariate Normal   m1<-c(2.5,3.5,4.5) m2<-c(-3,-4,-5) m3<-c(100,120,130) n1<-length(data$x) sigma1<-matrix(c(1,0.3,0.4,0.3,1,0.2,0.4,0.2,1),nrow=3,byrow=T)   trait1<-ifelse(data$x==1,list(rmvnorm(n1,mean=m11,sigma=sigma1)

Re: [R] Locating an error

2010-03-17 Thread Worik R
Related: I found the problem eventually. It was a parameter that was too large and the function called "stop". Looking at the documentation I see I can supply my own error handler. Cool. Are there already written error handlers that dump a stack trace? cheers Worik On Thu, Mar 18, 2010 at 2:

Re: [R] Sweave and kile

2010-03-17 Thread Sébastien Bihorel
Thanks Martin, your reply was extremely helpful. It took me a bit of time to figure out what TEXINPUTS are and where they should be specify, but it is working now. Just for reference, I had to include an "export TEXINPUTS" statement in my .bashrc for pdflatex to work in a command line, and add a p

[R] Locating an error

2010-03-17 Thread Worik R
I have a large programme that after running half an hour or so fails with an error Error in x[value] <- NA : only 0's may be mixed with negative subscripts How can I find out where that error occurs? If I have to do a binary search using error messages it will take a long time! Is there some wa

[R] Do colClasses in readHTMLTable (XML Package) work?

2010-03-17 Thread Marshall Feldman
Hi, I can't get the colClasses option to work in the readHTMLTable function of the XML package. Here's a code fragment: require("XML") doc <- "http://www.nber.org/cycles/cyclesmain.html"; table <- getNodeSet(htmlParse(doc),"//table") [[2]]# The main table is the second on

Re: [R] How to remove levels?

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 8:57 PM, Soyeon Kim wrote: Dear All, My data looks like this new_ns chr nc_two nc_not_two 11488 58 22325114 33233 79 44200153 55239 53 66196313 77229 45 8

[R] How to remove levels?

2010-03-17 Thread Soyeon Kim
Dear All, My data looks like this > new_ns chr nc_two nc_not_two 11488 58 22325114 33233 79 44200153 55239 53 66196313 77229 45 88231137 99164111 10 1

Re: [R] Sweave and kile

2010-03-17 Thread Sharpie
pomchip wrote: > > Dear R-users, > > I want to give a try to Sweave and Latex but I am having some problems > compiling my .Rnw files within Kile. I have followed the recommendations > given in http://tolstoy.newcastle.edu.au/R/e5/help/08/10/4277, but they do > not seem to address my particular

Re: [R] plm "within" models: is the correct F-statistic reported?

2010-03-17 Thread Liviu Andronic
On 3/17/10, Achim Zeileis wrote: > Hmm, that sounds strange. Maybe something about the data pre-processing > went wrong? > I traced plm() in step-by-step mode, and the process stalls on plm.fit(), apparently after all the pre-processing. > Depending on how unbalanced the data is, there might no

[R] Plotting symbols over a screenshot

2010-03-17 Thread Ralf B
Hi all, I would like to generate a very simple visualization in R and wonder if somebody here could tell me about a simple script that can do exactly that. Input: I have about 1000-3000 screen coordinates of mouse movements and mouse click positions in a data.frame (each collumn for each data typ

Re: [R] Adding text outside (lattice barchart) plotting region.

2010-03-17 Thread Peng Cai
Thanks Richard and Jim for your reply! @All: Is there a way to do this without altering default x-labels (because in my case there could be up to 30-40 x-labels and I may have to repeat the script multiple times with different x-lables). OR, not sure but can it be done by extending plotting regi

Re: [R] R Advanced Programming Course in USA

2010-03-17 Thread Henrik Bengtsson
Though not providing courses, if you're in that area, the Bay Area useR Group http://www.meetup.com/R-Users/ that often meet in San Francisco, might be useful to connect with. /Henrik On Wed, Mar 17, 2010 at 9:24 PM, Trevor O'brien wrote: > Hi folks, > > I am working on my student internship t

[R] Sweave and kile

2010-03-17 Thread Sébastien Bihorel
Dear R-users, I want to give a try to Sweave and Latex but I am having some problems compiling my .Rnw files within Kile. I have followed the recommendations given in http://tolstoy.newcastle.edu.au/R/e5/help/08/10/4277, but they do not seem to address my particular problem. I am using R 2.11.0 a

Re: [R] Cropped graph using lattice

2010-03-17 Thread Susan Durham
Paul, Yes, perfect! Thank you! Susan ~~~ Susan Durham Utah State University Ecology Center 5205 Old Main Hill Logan, UT 84322-5205 (435)797-1337 > -Original Message- > From: Paul Murrell [mailto:p.murr...@auckland.ac.nz] > Sent: Wednesday, March 17, 2010 5:13 PM > To: Susan Durham >

Re: [R] Adding text outside (lattice barchart) plotting region.

2010-03-17 Thread Jim Lemon
On 03/18/2010 09:50 AM, Peng Cai wrote: Hi All, I need some help with adding text at the bottom of the graph (outside of default outline of graph). Say, I need to write "Month: 01 04" below each of the two years in the following R code, something like this: ___

Re: [R] Adding text outside (lattice barchart) plotting region.

2010-03-17 Thread RICHARD M. HEIBERGER
barchart(yield ~ year, data = barley, stack=TRUE, col="black", ylim=c(0,85), scales=list(x=list(labels=c(expression(atop(March, 1932)), expression(atop(April, 1932) ) This gets most of what you want. [[alternative HTML version deleted]] __

Re: [R] Cropped graph using lattice

2010-03-17 Thread Paul Murrell
Hi Susan Durham wrote: I'm fitting data from a mixture experiment, and I'd like to present the results in a ternary graph with contours. I found this code by Walmes Zeviani http://n4.nabble.com/Triangular-filled-contour-plot-td1557386.html which is just what I want--except I would like the ax

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread admin
Hi Paul & al, R-PLUS 3.3 has R publication quality tables with SAS ODS look & feel and yes you can get R-PLUS 3.3 Nano trial and keep it free for life. youtube.com/rplus33 shows you a quick R-PLUS 3.3 demo and you can request a longer video by sending us an email. Download Rplus 3.3 at http://

Re: [R] How to use "ifelse" to generate random value from a distribution

2010-03-17 Thread Erik Iverson
alex46015 wrote: I think I figure it out. ifelse(data1$x==1,rnorm(12,2,1),ifelse(data1$x==2,rnorm(12,-2,1),rnorm(12,110,1))) Where is the number 12 coming from? Is that the length of data1$x? Here is a sample using the fact that rnorm can accept vectors of means and sds. My x is rand

[R] Cropped graph using lattice

2010-03-17 Thread Susan Durham
I'm fitting data from a mixture experiment, and I'd like to present the results in a ternary graph with contours. I found this code by Walmes Zeviani http://n4.nabble.com/Triangular-filled-contour-plot-td1557386.html which is just what I want--except I would like the axis titles and labels to b

[R] Adding text outside (lattice barchart) plotting region.

2010-03-17 Thread Peng Cai
Hi All, I need some help with adding text at the bottom of the graph (outside of default outline of graph). Say, I need to write "Month: 01 04" below each of the two years in the following R code, something like this: ___ | |

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Jim Lemon
On 03/18/2010 01:51 AM, Paul Miller wrote: Hello Everyone, I have just started learning R and am in the process of figuring out what it can and can't do. I must say I am very impressed with R so far and am amazed that something this good can actually be free. Recently, I finished reading R fo

Re: [R] Troubles on retrieving rownames

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 3:25 PM, anna wrote: Hi guys, I am using the blp() function from RBloomberg package which returns a matrix of prices with the columns corresponding to the security name and the columns to the date. When I have a look at the matrix I can see the rownames (dates) on the

Re: [R] Troubles on retrieving rownames

2010-03-17 Thread jim holtman
do 'str(prices)' so we can see the structure of the data. On Wed, Mar 17, 2010 at 2:25 PM, anna wrote: > > Hi guys, I am using the blp() function from RBloomberg package which > returns > a matrix of prices with the columns corresponding to the security name and > the columns to the date. When I

Re: [R] constrOptim - error: initial value not feasible

2010-03-17 Thread Thomas Lumley
You can't use two inequality constraints to simulate an equality constraint in constrOptim(). -thomas On Wed, 17 Mar 2010, Herb wrote: Hello at all, working with a dataset I try to optimize a non-linear function with constraint. test<-read.csv2("C:/Users/Herb/Desktop/Opti/NORM.cs

Re: [R] Vector multiplication

2010-03-17 Thread Duncan Murdoch
On 17/03/2010 2:03 PM, Kaspar Bernet wrote: Hi, this may sound stupid (and it probably is), but I can't seem to find out how to multiply each element of a vector with each element of another vector where the result would be a matrix of dim[length(vectorOne),length(vectorTwo)] without using loops

Re: [R] odfWeave: odt-file damaged

2010-03-17 Thread Jean lobry
Dear all, I'm resurrecting this old post (about 6 monts old, reproduced thereafter) because I have struggled against the same problem and found a solution so that I found it was worth posting for the record. The simple fix when you want to use odfWeave with 7-ZIP as a compressing/decompressing u

Re: [R] mmap error on macbook pro

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 4:57 PM, Steve Lianoglou wrote: Hi, On Wed, Mar 17, 2010 at 8:14 AM, Shyamasree Saha [shs] wrote: Dear List, I am trying to read some files using read.csv and total size of those files are 3.99 GB. I am using MacBook Pro with 4GB RAM(snow leopard). I also tried to

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread s...@xlsolutions-corp.com
Hi Paul & al, R-PLUS 3.3 has R publication quality tables with SAS ODS look & feel and yes you can get R-PLUS 3.3 Nano trial and keep it free for life. youtube.com/rplus33 shows you a quick R-PLUS 3.3 demo and you can request a longer video by sending us an email. Download Rplus 3.3 at http://

Re: [R] How can I return rows from a data frame with maximum value by factor?

2010-03-17 Thread Greg Snow
For future reference you may want to look at the plyr package, or even the sapply and aggregate functions and possibly simpler ways to do what you did below. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Messa

Re: [R] mmap error on macbook pro

2010-03-17 Thread Steve Lianoglou
Hi, On Wed, Mar 17, 2010 at 8:14 AM, Shyamasree Saha [shs] wrote: > Dear List, > > I am trying to read some files using read.csv and total size of those files > are 3.99 GB. I am using MacBook Pro with 4GB RAM(snow leopard). I also tried > to run a chunk from those files and altogether the size

Re: [R] R Advanced Programming Course in USA

2010-03-17 Thread s...@xlsolutions-corp.com
Dear Trevor, Check out XLSolutions Corporation course list at: www.xlsolutions-corp.com/rcourses for upcoming schedule in USA. We've listed 3 R Advanced programming courses in *San Francisco *New York City *Salt lake city We do have other levels of courses that mig

Re: [R] Lexis.diagram()

2010-03-17 Thread David Winsemius
I'm pretty sure there are worked examples dealing with age-period- chohort models in the Epi package. But it appears you already have a function in mind and it's not clear why you are not looking at the documentation and positing your question to the package authors? On Mar 17, 2010, at 4:27

Re: [R] R Advanced Programming Course in USA

2010-03-17 Thread Bert Gunter
I think you need to define what you mean by "advanced" to avoid misunderstanding. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Trevor O'brien Sent: Wednesday, March 17, 2010 1:

Re: [R] How to use "ifelse" to generate random value from a distribution

2010-03-17 Thread alex46015
I think I figure it out. ifelse(data1$x==1,rnorm(12,2,1),ifelse(data1$x==2,rnorm(12,-2,1),rnorm(12,110,1))) Please correct me if I am wrong. Thanks -- View this message in context: http://n4.nabble.com/How-to-use-ifelse-to-generate-random-value-from-a-distribution-tp1597064p1597102.html Se

[R] How to use "ifelse" to generate random value from a distribution

2010-03-17 Thread alex46015
I need use different parameters of distribution for different case to generate random value, but I use ifelse, the generated value is fixed without change. Here is example data1 y x 1 1 2 2 2 1 3 3 2 4 4 3 5 5 3 6 6 1 7 7 2 8 8 1 9 9 1 10 10 3 11 11 3 12 12 2 ifelse(data1$x

[R] Lexis.diagram()

2010-03-17 Thread AneSR
I have a hypothetical cohort with: lo = 1000 l1 = 900 l2 = 800 ... How to represent this cohort with Lexis.diagram function () .. and how to calculate rates of age-cohort, cohort-period and period-age. Regards, Ane -- View this message in context: http://n4.nabble.com/Lexis-diagram-tp1597

[R] R Advanced Programming Course

2010-03-17 Thread Trevor O'brien
Hi folks, I am working on my student internship to USA, california and would like to attend a R Advanced Programming course while I am in USA. Where can I find such a course. I am new to this list. Trevor O'brien >From Ireland. [[alternative HTML version deleted]] __

[R] R Advanced Programming Course in USA

2010-03-17 Thread Trevor O'brien
Hi folks, I am working on my student internship to USA, california and would like to attend a R Advanced Programming course while I am in USA. Where can I find such a course. I am new to this list. Trevor O'brien >From Ireland. [[alternative HTML version deleted]] __

Re: [R] Writing own simulation function in C

2010-03-17 Thread Phil Spector
I've written a handout that talks about calling C from R and calling R from C using both the .C and .Call methods. (It also shows similar information for matlab -- my apologies.) You can find it here: http://www.stat.berkeley.edu/classes/s243/calling.pdf

Re: [R] Writing own simulation function in C

2010-03-17 Thread Sharpie
TheSavageSam wrote: > > Thanks for the huge help. I have learned a lot and been able to start > writing my own code. > > If you could give me a reference(a link, name of a book, etc.) to a good > manual of how to use and manipulate and use SEXP variables in C > (considering creating R libraries

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Frank E Harrell Jr
Hi Ista, Our material on statlib is far out of date. Please refer to the primary source at http://biostat.mc.vanderbilt.edu/StatReport Thanks Frank Ista Zahn wrote: Hi Paul, For instructions and examples using the Hmisc latex() function you might want to take a look at http://lib.stat.cmu.

Re: [R] Vector multiplication

2010-03-17 Thread Peter Alspach
Tena koe Kaspar ?outer outer(b, a) or b %o% a HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Kaspar Bernet > Sent: Thursday, 18 March 2010 7:03 a.m. > To: r-help@r-project.org > Subject: [R] Vector

Re: [R] Vector multiplication

2010-03-17 Thread Henrique Dallazuanna
Try this: b %o% a On Wed, Mar 17, 2010 at 3:03 PM, Kaspar Bernet wrote: > Hi, > > this may sound stupid (and it probably is), but I can't seem to find out how > to multiply each element of a vector with each element of another vector > where the result would be a matrix of > dim[length(vector

Re: [R] Retaining variable name in a function

2010-03-17 Thread AC Del Re
Wow, wonderful! Thank you for all the response -- and so quick! ac On Wed, Mar 17, 2010 at 2:19 PM, Sarah Goslee wrote: > How about this? It changes a column to a factor, and > optionally renames it. > > facts <- function(meta, mod, newmodname) { > meta[,mod] <- factor(meta[,mod]) > if(!

Re: [R] Date conversion issue

2010-03-17 Thread Henrique Dallazuanna
Use %y indeed of "%Y". On Wed, Mar 17, 2010 at 12:00 PM, ManInMoon wrote: > > I am parsing dates as follows: > >> z[1:10,1:3] >    V1       V2           V3 > 1    0 03/02/09 22:20:51.274 > 2  100 03/02/09 22:28:18.801 > 3  200 03/02/09 22:33:33.762 > 4  300 03/02/09 22:40:21.826 > 5  400 03/02/09

Re: [R] plm "within" models: is the correct F-statistic reported?

2010-03-17 Thread Achim Zeileis
On Wed, 17 Mar 2010, Liviu Andronic wrote: In short: - plm(..., model = "within") offers a convenient approach of what is usually done in this kind of analysis. Unfortunately plm(..., effect="twoways", model = "within") fails on my particular unbalanced panel data (100% CPU and the task

[R] How can I return rows from a data frame with maximum value by factor?

2010-03-17 Thread Nick Ackerman
Hi, I'm new to R and new to this forum. I'm struggling with trying to extract certain rows of data from my data.frame. The data.frame has eleven columns. Among those columns are "FISH_ID" and "DATE_TIME". FISH_ID is a factor. For each of my 21 unique FISH_IDs (levels) I have a few to a few thousa

Re: [R] How can I return rows from a data frame with maximum value by factor?

2010-03-17 Thread Nick Ackerman
Solved my own question by looking at some other threads. For those who may be intersted, here was the solution to my problem. do.call(rbind,lapply(split(data.frame,FISH_ID),function(x)x[which.max(x$DATE_TIME),])) -- View this message in context: http://n4.nabble.com/How-can-I-return-rows-from-a

Re: [R] Date conversion issue

2010-03-17 Thread ManInMoon
Sorry -- View this message in context: http://n4.nabble.com/Date-conversion-issue-tp1596548p1596880.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] Vector multiplication

2010-03-17 Thread Kaspar Bernet
Hi, this may sound stupid (and it probably is), but I can't seem to find out how to multiply each element of a vector with each element of another vector where the result would be a matrix of dim[length(vectorOne),length(vectorTwo)] without using loops. example: if a -> c(1,2,3) b -> c(4,5,

[R] [R-pkgs] tmvtnorm: version 1.0-2

2010-03-17 Thread Stefan Wilhelm
Dear R users, the tmvtnorm package, the package for the truncated multivariate normal and Student-t distribution, has been updated on CRAN. The major changes in version 1.0-2 (2010-03-04) are: * The package now provides methods for the truncated multivariate Student-t distribution, i.e. random

Re: [R] Writing own simulation function in C

2010-03-17 Thread TheSavageSam
Thanks for the huge help. If you could give me a reference(a link, book, etc.) to a good manual of how to use and manipulate and use SEXP variables in C (considering creating R libraries). -- View this message in context: http://n4.nabble.com/Writing-own-simulation-function-in-C-tp1580190p15967

[R] How to plot line, points, using Dates as X-axis

2010-03-17 Thread P J JAYNES
Hello, I have an x, y data set of circa 966 points, and counting, where I am trying to plot one integer y-axis number per a corresponding x-axis date, in R. The command plot(initialPlot$Dates, initialPlot$AxisData), where $Dates is 2007-07-24:2010-03-15, and $AxisData is the corresponding y

[R] Partial least square regression and the effect of sampling site

2010-03-17 Thread Claude Leroux
Hi, I am trying to use pls regression to find links between some environmnental variables and the biomass of a marine snail species. I am not an expert with this type of analysis. I sampled both the species' biomass and the environmental variables on 3 transects in 6 different sites. I would li

[R] constrOptim - error: initial value not feasible

2010-03-17 Thread Herb
Hello at all, working with a dataset I try to optimize a non-linear function with constraint. test<-read.csv2("C:/Users/Herb/Desktop/Opti/NORM.csv") fkt<- function(x){ a<-c(0) s<-c(0) #Minimizing square error for(j in 1:107){ s<-(test[j,2] - (x[1] * test[j,3]) - (x[2] * test[j,4]) - (x[3]*test[

Re: [R] odfWeave Error

2010-03-17 Thread Btibert3
Hi Max, I appreciate your time. Sorry, I am not really a progammer- how would I test this? Thanks again! - Brock On Wed, Mar 17, 2010 at 11:00 AM, Max Kuhn [via R] < ml-node+1596549-1426779930-75...@n4.nabble.com > wrote: > Can you use 7zG to unzip an odt file from a dos prompt? > > Max > >

[R] Date conversion issue

2010-03-17 Thread ManInMoon
I am parsing dates as follows: > z[1:10,1:3] V1 V2 V3 10 03/02/09 22:20:51.274 2 100 03/02/09 22:28:18.801 3 200 03/02/09 22:33:33.762 4 300 03/02/09 22:40:21.826 5 400 03/02/09 22:41:38.361 6 500 03/02/09 22:42:50.882 7 600 03/02/09 22:45:19.885 8 700 03/02/09 22:4

[R] [R-pkgs] NORMT3

2010-03-17 Thread Guy Nason
Dear all, The package NORMT3 which computes the erf, erfc functions as well as the exact values of the convolution of a Gaussian with a Student's t 3 distribution has been enhanced with the addition of a function to compute Faddeeva's function. Thanks to Krishna Myneni for this addition. Guy N

[R] [R-pkgs] cthresh

2010-03-17 Thread Guy Nason
Dear all, The package cthresh, for computing complex-valued wavelet shrinkage has now been uploaded to CRAN. This was previously bundled with wavethresh, but has now been unbundled. Best wishes, Guy Nason -- Professor Guy Nason Head of Department Department of Mathemat

[R] Troubles on retrieving rownames

2010-03-17 Thread anna
Hi guys, I am using the blp() function from RBloomberg package which returns a matrix of prices with the columns corresponding to the security name and the columns to the date. When I have a look at the matrix I can see the rownames (dates) on the left of the prices but when I call the rownames()

Re: [R] Retaining variable name in a function

2010-03-17 Thread Henrique Dallazuanna
Try this: transform(DF, newA = factor(a), a = NULL) On Wed, Mar 17, 2010 at 4:06 PM, AC Del Re wrote: > Hi All, > > Im interested in creating a function that will convert a variable within a > data.frame to a factor while retaining the original name (yes, I know that I > can just:  var <-factor(

Re: [R] Retaining variable name in a function

2010-03-17 Thread Sarah Goslee
How about this? It changes a column to a factor, and optionally renames it. facts <- function(meta, mod, newmodname) { meta[,mod] <- factor(meta[,mod]) if(!missing(newmodname)) { colnames(meta)[colnames(meta) == mod] <- newmodname } meta } > testdata <- data.frame(a=c(1,2,3), b=

[R] Retaining variable name in a function

2010-03-17 Thread AC Del Re
Hi All, Im interested in creating a function that will convert a variable within a data.frame to a factor while retaining the original name (yes, I know that I can just: var <-factor(var) but I need it as a function for other purposes). e.g.: # this was an attempt but fails. facts <- function(

Re: [R] plm "within" models: is the correct F-statistic reported?

2010-03-17 Thread Liviu Andronic
On 3/17/10, Achim Zeileis wrote: > Here, you compare apples and oranges. gr_fe1 is of class "plm" and > gr_fe1_null is of class "lm". This does not fly. > > gr_fe1_lm <- lm(invest ~ 0 + value + capital + firm + year, data = pgr) > anova(gr_fe1_lm, gr_fe1_null) > > which does the job. > Indeed,

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Muenchen, Robert A (Bob)
Hi Paul, Sorry I didn't get to that subject in the first edition of R for SAS and SPSS Users. Several of the options people have mentioned will be in the second edition, although that's about a year off. I did get them added to R for Stata Users, due out in early April. Cheers, Bob >-Ori

Re: [R] Using nrow with summaryBy

2010-03-17 Thread Gabor Grothendieck
Use NROW rather than nrow. On Wed, Mar 17, 2010 at 11:23 AM, Tony Laidig wrote: > Hello Everyone- > I'm calculating summary statistics on a dataset (~4000 records, > observations are not uniformly distributed) using summaryBy and trying > to add a column with the number of observations to the out

Re: [R] Odp: Loop overwrite and data output problems

2010-03-17 Thread RCulloch
Hi Petr, Thanks again!!! model is a list. So your suggestion: mod <- matrix(NA, 1000, ncols) doesn't work. I thought that do.call and rbind would be the best for these data? Cheers, Ross -- View this message in context: http://n4.nabble.com/Loop-overwrite-and-data-output-problems-tp1570593p

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Erich Neuwirth
If you are working in Windows and want Word output, it might be worthwhile to have a look at SWord available from the download section on rcom.univie.ac.at. Warning: the program is free for noncommercial use, but NOT licensed under GPL or LGPL. On 3/17/2010 3:51 PM, Paul Miller wrote: > Hello Ev

Re: [R] replace NA value with 0

2010-03-17 Thread ehux
Building on the question how to replace NA with 0. My data set below has date, station 1, flags for station 1, station 2, flags for station 2, etc... I would like to make the values in the station columns equal to 1 and the NA in the station columns equal to 0 and then sum each row for the numbe

Re: [R] Writing dataframes to SAS XPT format

2010-03-17 Thread Tobias Verbeke
Dennis Fisher wrote: Colleagues, On occasion, I need to output an R dataframe to a file in SAS XPT format. Although the foreign package supports reading of XPT files and writing to a format that SAS can read, it does not support writing to XPT format (confirmed with Thomas Lumley, the author

Re: [R] plm "within" models: is the correct F-statistic reported?

2010-03-17 Thread Achim Zeileis
On Wed, 17 Mar 2010, Liviu Andronic wrote: Dear Achim On 3/16/10, Achim Zeileis wrote: Hence, when saying summary() different models with "no effects" are assumed. For gr_fe the model without effects just omits value/capital but keeps the firm-specific interecepts. For gr_lm not even the int

Re: [R] Retrieving latitude and longitude via Google Maps API

2010-03-17 Thread Greg Snow
You may want to look at http://www.openstreetmap.org/ or http://maps.cloudmade.com/ instead of google maps. I don't know if they give the same detail/searches, but open source sites tend to be easier to work with and have fewer restrictions on use. While I like the google maps, I tend to not

Re: [R] mmap error-12, macbook pro

2010-03-17 Thread Thomas Lumley
There seem to have been three almost identical reports of this from three different email addresses, including two widely-separate UK academic institutions, and two user names, which is a bit weird. However: R will need more than 4GB memory to handle a 3.99GB file, and probably more than 4

[R] Writing dataframes to SAS XPT format

2010-03-17 Thread Dennis Fisher
Colleagues, On occasion, I need to output an R dataframe to a file in SAS XPT format. Although the foreign package supports reading of XPT files and writing to a format that SAS can read, it does not support writing to XPT format (confirmed with Thomas Lumley, the author of write.foreign). Ha

Re: [R] Using nrow with summaryBy

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 12:10 PM, Ivan Calandra wrote: Hi David, I have probably 2 stupid questions regarding what you said but it might be important to understand: - why nrow() "would not make sens for a subsetted vector"? On the help page of nrow(), it's written that we can apply it on a v

Re: [R] Using nrow with summaryBy

2010-03-17 Thread Ivan Calandra
Hi David, I have probably 2 stupid questions regarding what you said but it might be important to understand: - why nrow() "would not make sens for a subsetted vector"? On the help page of nrow(), it's written that we can apply it on a vector, array or dataframe (basically everything...?). So

Re: [R] Why eval(parse(text="var(vec)")) return a matrix but NOT a number?

2010-03-17 Thread Charles C. Berry
On Wed, 17 Mar 2010, Yong Wang wrote: Dear List I am getting a problem when using "eval(parse)". Code below sketchs what I am trying to do: For each row of a N*K dataframe (I use a 2*2 dataframe in the example below), applying a number of functions and get the outputs (two functions, "sum" and

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Liviu Andronic
On Wed, Mar 17, 2010 at 2:51 PM, Paul Miller wrote: > Am I right or wrong about this? If I am wrong, can anyone show me some > examples of how R can be used to create really nice looking tables? I often > make tables of adverse events in clinical trials that have n(%) values in the > cells. I'd

Re: [R] Using nrow with summaryBy

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 11:23 AM, Tony Laidig wrote: Hello Everyone- I'm calculating summary statistics on a dataset (~4000 records, observations are not uniformly distributed) using summaryBy and trying to add a column with the number of observations to the output as well. What occurs to me is to

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Douglas Bates
On Wed, Mar 17, 2010 at 10:25 AM, Erik Iverson wrote: > > > Paul Miller wrote: >> >> Hello Everyone, >> >> I have just started learning R and am in the process of figuring out >> what it can and can't do. I must say I am very impressed with R so >> far and am amazed that something this good can ac

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Ista Zahn
Hi Paul, For instructions and examples using the Hmisc latex() function you might want to take a look at http://lib.stat.cmu.edu/S/Harrell/doc/summary.pdf. -Best, Ista On Wed, Mar 17, 2010 at 10:51 AM, Paul Miller wrote: > Hello Everyone, > > I have just started learning R and am in the process

Re: [R] save data to an R object

2010-03-17 Thread cheba meier
Yes, that was very useful, thank you, Cheba 2010/3/17 Ivan Calandra > Hi, > > Here is one option: > #some sample dataframes > df1 <- data.frame(letter=letters[1:3], number=1:3) > df1 <- data.frame(letter=letters[4:6], number=4:6) > > #save the dataframes > save(df1, df2, file="test.Rda") > #load

[R] Adding minutes to 24 hour time

2010-03-17 Thread Hosack, Michael
Thank you Gustaf for your help! It worked perfectly. Now I just need to figure out how you did it. Petr, thank you for assisting me, but I could not get your approach to work. Mike __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/list

Re: [R] How good is R at making publication quality tables?

2010-03-17 Thread Erik Iverson
Paul Miller wrote: Hello Everyone, I have just started learning R and am in the process of figuring out what it can and can't do. I must say I am very impressed with R so far and am amazed that something this good can actually be free. Recently, I finished reading R for SAS and SPSS Users and

[R] Using nrow with summaryBy

2010-03-17 Thread Tony Laidig
Hello Everyone- I'm calculating summary statistics on a dataset (~4000 records, observations are not uniformly distributed) using summaryBy and trying to add a column with the number of observations to the output as well. What occurs to me is to use nrow(), but this doesn't appear to be working

  1   2   >