Re: [R] Help needed in double bar plot made using ggplot2

2021-08-20 Thread ken
Thanks Dr. Burradas too. i also had the same question. regards August 20, 2021 6:02 AM, "bharat rawlley via R-help" wrote: > Thank you, Dr. Burradas! > That resolved my query > Have a great rest of your day > On Thursday, 19 August, 2021, 04:47:42 pm GMT-4, Rui Barradas > wrote: > __

Re: [R] separate date and time

2011-05-12 Thread KEn
<-runif(435) nTime<-seq(1303975800, 1304757000, 1800) nDateT<-as.POSIXct(nTime, origin="1970-01-01") date <- substr(nDateT, 1, 10) time <- substr(nDateT, 12, 19) df1 <- data.frame(date, time, meas) means1<- aggregate(df1$meas, list(df1$time), mean) HTH, Ken

Re: [R] Changing x-axis when dealing with time

2011-05-16 Thread Ken
.time <- orig + excel.dates; time.only <- substr(date, 11, 18) # Y data y.dat = rnorm(7, 10, 3) # Plot it up! Don't add annotations or axes for now plot(date.time, y.dat, type="n", ann=F, axes=F) # Add data lines(date.time, y.dat, lwd = 2, col = "black") points(d

Re: [R] Changing x-axis when dealing with time

2011-05-16 Thread Ken
Ken bu.edu> writes: > # create "chron" time vector > library(chron) > excel.dates <- seq(40179.0 + 1/6, 40180.0 + 1/6, 1/6) > orig <- chron("12/30/1899") > date.time <- orig + excel.dates; > time.only <- substr(date, 11, 18) Found one error

Re: [R] Using a sting in variable names

2011-05-17 Thread Ken
ut not totally sure on it. Example: X <- 1:100 vpn <- vector(mode = "list", length = length(X)) for(i in 1:length(X)){ vpn[[i]] <- read.table(paste("vpn", X[i], ".dat", sep ="")) } HTH, Ken __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] slow computation of functions over large datasets

2011-08-03 Thread Ken
Sorry about the lack of code, but using Davids example, would: tapply(itemPrice, INDEX=orderID, FUN=sum) work? -Ken Hutchison On Aug 3, 2554 BE, at 2:09 PM, David Winsemius wrote: > > On Aug 3, 2011, at 2:01 PM, Ken wrote: > >> Hello, >> Perhaps transpose the table a

Re: [R] slow computation of functions over large datasets

2011-08-03 Thread Ken
Hello, Perhaps transpose the table attach(as.data.frame(t(data))) and use ColSums() function with order id as header. -Ken Hutchison On Aug 3, 2554 BE, at 1:12 PM, David Winsemius wrote: > > On Aug 3, 2011, at 12:20 PM, jim holtman wrote: > >> This takes abou

Re: [R] Convert matrix to numeric

2011-08-03 Thread Ken
How about Matrix[1:5,]=as.numeric(Matrix[1:5,]) -Ken Hutchison On Aug 3, 2554 BE, at 3:04 PM, Jeffrey Joh wrote: > > I have a matrix that looks like this: > > > structure(c("0.0376673981759913", "0.111066500741386", "1", "1

Re: [R] Installing R-Packages from zipp file

2011-08-06 Thread Ken
If you have an Internet connection try: > install.packages("copula", dep=TRUE) Good luck! Ken On Aug 6, 2554 BE, at 8:44 AM, poulomi wrote: > Hi, > > I'm a new user of R. I want to install 'copula' packages. I downloaded the > packa

Re: [R] Automating an R function call

2011-08-12 Thread Ken
Hey, Sys.sleep(300) ?Sys.sleep Ken Hutchison On Aug 12, 2554 BE, at 2:03 PM, RobertJK wrote: > Any way to run an R function every 5 minutes from the R terminal? Searched > around but couldn't find any answers. Thanks!! > Robert > > -- > View this message

Re: [R] seeking advice about rounding error and %%

2011-08-13 Thread Ken
How about something like: If(round(x)!=x){zap} not exactly working code but might help Ken On Aug 13, 2554 BE, at 3:42 PM, Paul Johnson wrote: > A client came into our consulting center with some data that had been > damaged by somebody who opened it in MS Excel. The columns were >

Re: [R] Test for Random Walk and Makov Process

2011-09-03 Thread Ken
For random walk, there are entropy based tests (Robinson 1991), or you could empirically test the hypothesis by generating random normal data with the same mean and standard deviation and looking at the distribution of your quantiles. You could make generic statements also about whether or not t

Re: [R] Generating data when mean and 95% CI are known

2011-09-07 Thread Ken
ble to anything because there is probably more to the story distributionally. If you can assume, say a normal distribution you are ?rnorm and ?quantile away from Monte Carlo-ing a good part of the story yourself for conclusions. Best of luck, and sorry for the bad R jokes. Ken Hutchiso

Re: [R] how to remove NA/NaN/Inf in a matrix??

2011-09-11 Thread Ken
Try: library(Hmisc) ?na.delete Ken Hutchison On Sep 11, 2554 BE, at 5:38 AM, anand m t wrote: > Hi all.. > I'm very new R, and i'm analyzing microarray data using Bioconductor.. > Recently i was given microarray data to analyze. The problem is whenever i > run MAS5 pr

Re: [R] Where to put tryCatch or similar in a very big for loop

2011-09-15 Thread Ken
What type of singularity exactly, if you're working with counts is it a special case? If using a Monte Carlo generation scheme, there are various workarounds such as while(sum(vec)!=0) {sample} for example. More info on the error circumstances would help. Good luck! Ken Hutchison O

Re: [R] Limitations of audio processing in R

2011-09-21 Thread Ken
Also with Linux you can add more swap memory(which I'm pretty sure R spills into if it hasn't reached it's internal limits on 32 bit installations). Windows pagefile is kind of obnoxious. Ken Hutchison On Sep 21, 2554 BE, at 5:05 PM, (Ted Harding) wrote: > Hi Ulisses

Re: [R] interpolation to montly data

2012-06-16 Thread Ken
uot;, "29/03/09","26/04/09","24/05/09", "28/06/09", "26/10/08","23/11/08","21/12/08","18/01/09", "15/02/09","16/03/09",&qu

Re: [R] append to PDF file

2011-11-26 Thread Ken
PDF files contain information at the end of them and so you cannot append without altering the file (universally true for PDF). Perhaps pdf() your plots and use external tools to convert the PDFs to .ps then re-merge. Might not be the best way, but an effective one. Ken Hutchison

Re: [R] Question about randomForest

2011-11-27 Thread Ken
uld get more votes on the error. Please correct me if I am wrong, Hopefully a specialist will come along and clear this up, Ken Hutchison On Nov 27, 2554 BE, at 3:21 AM, Matthew Francis wrote: > Thanks for the help. Let me explain in more detail how I think that > ran

Re: [R] window manager interface commands for linux

2011-11-28 Thread Ken
our R terminal settings so that organization and dir() will get you what you want. Hope that helps, Ken Hutchison On Nov 28, 2554 BE, at 6:07 AM, Ana wrote: > How can i replicate this in Linux: > source(file.choose()) > > > I've tried source(tkgetOpe

Re: [R] Principal componet plot from lower triangular matrix file

2011-11-28 Thread Ken
created, is going to be very hectic. HTH Ken Hutchison On Nov 28, 2554 BE, at 5:55 AM, cm wrote: > Hi, > > I have a comma separated file with element names in first column like shown > below : > > Name_1,0 > Name_2,0.8878,0 > Name_3,0.6777,0.7643,0 > Na

Re: [R] Help with the Mice Function

2011-12-09 Thread Ken
Try reducing the maximum iterations. Probably won't make your call instantaneous, but might be worth the slack gained over a day or so. Ken Hutchison On Dec 9, 2554 BE, at 1:59 PM, "Richard J. Buning" wrote: > Hi, > > I am attempting to impute my data for missi

Re: [R] fgrep with caret (^) meta-character in system() call

2011-10-04 Thread Ken
man awk? I've used awk for similar tasks (if I am reading the post correctly.) Google-Fu should turn up some useful examples. Also awk should be on your linux installation in some form or another. Regards, Ken Hutchison On Oct 4, 2554 BE, at 10:52 PM, "Tom D. Harray" wro

Re: [R] Perform 20 x one-way anova in 1 go

2011-10-13 Thread Ken
Hey, Doesn't this give you a ridiculous Type 1 error? Maybe randomly select one result and trust it. Try bestglm or stepwise regression maybe. Hope that's helpful, Ken Hutchison On Oct 14, 2554 BE, at 12:39 AM, "C.H." wrote: > This is on

Re: [R] Running R with browser without installing anything

2011-10-20 Thread Ken
Try Googling "R Portable" Ken Hutchison On Oct 20, 2554 BE, at 2:13 PM, jim holtman wrote: > It runs fine off a flash drive. > > On Thu, Oct 20, 2011 at 1:29 PM, Bogaso Christofer > wrote: >> Dear all, the company I work for has Matlab installed for >> sta

Re: [R] Arima Models - Error and jump error

2011-10-21 Thread Ken
Perhaps: require(forecast) ?auto.arima # Or look into package fitAR. The first performs seasonal optimization so it is likely better for your application. Ken Hutchison On Oct 21, 2554 BE, at 1:59 PM, Flávio Fagundes wrote: > Hi people, > > I´m trying to development a simple r

Re: [R] glm-poisson fitting 400.000 records

2011-10-21 Thread Ken
Your memory shouldn't be capped there, try ?memory.size and ?memory.limit. Background less things. Good luck, Ken Hutchison On Oct 21, 2554 BE, at 11:57 AM, D_Tomas wrote: > My apologies for my vague comment. > > My data comprises 400.000 x 21 (17 explanatory variables,

Re: [R] Imputing Missing Data: A Good Starting Point?

2011-11-01 Thread Ken
Hope this helps: http://rss.acs.unt.edu/Rdoc/library/randomForest/html/rfImpute.html Ken Hutchison On Nov 1, 2554 BE, at 5:29 PM, Sascha Vieweg wrote: > Hello > > I am working on my first attempt to impute missing data of a data set with > systematically incomplete answers (school

Re: [R] Create subset using variable

2012-01-21 Thread Ken
# if null values are given as NA df.data.sub = df.data.sub[df.data.sub >= 0] # if null values are < 0 #subset dataset is not created # analyses on subset take place j = j + 1 } Hope that helps, Ken __ R-help@r-project.or

Re: [R] Placing a Shaded Box on a Plot

2012-01-27 Thread Ken
Stephanie Cooke gmail.com> writes: > > Hello, > > I would like to place shaded boxes on different areas of a > phylogenetic tree plot. Since I can not determine how to find axes on > the phylogenetic tree plot I am not able to place the box over certain > areas. Below is example code for the sh

Re: [R] Multiple cbind according to filename

2012-05-25 Thread Ken
le name just makes sure that the strings in filenames is in the same order as the files are in list.files: a1 <- data.frame("col1" = seq(1,10, 1)) a2 <- data.frame("col2" = seq(11,20, 1)) b1 <- data.frame("col3" = seq(21,30, 1)) b2 <- data.f

Re: [R] Multiple cbind according to filename

2012-05-25 Thread Ken
le name just makes sure that the strings in filenames is in the same order as the files are in list.files: a1 <- data.frame("col1" = seq(1,10, 1)) a2 <- data.frame("col2" = seq(11,20, 1)) b1 <- data.frame("col3" = seq(21,30, 1)) b2 <- data.f

[R] data.table cant find function melt?

2015-05-22 Thread Ken Nussear
Hi all, trying to use the melt function in data.table and I'm getting an error Anyone seen this before or know how to fix it? Thanks str(Distdata) Classes ‘data.table’ and 'data.frame': 828451 obs. of 3 variables: $ Poly1 : int 50088 50088 50088 50088 50088 50088 50088 50088 50088 500

[R] Are melt and dcast with ffdf possible?

2015-06-05 Thread Ken Nussear
5 515 6 616 c.melt.ff <- melt(comb.ff, id.vars=c("Var1","Var2")) > c.melt.ff value NA NA 1 1 1 1 2 2 1 2 3 3 1 3 4 4 1 4 5 5 1 5 6 6 1 6 7 7 1 7 .

[R] help with ff matrix indexing and value assignment

2015-06-10 Thread Ken Nussear
g cbind = still getting only zeros. Tried a few other methods I just cant seem to wrap my head around how to do this. I had a look at ffindexset, but that looks like assigning whole rows at a time. I appreciate any help !! Thanks Ken __ R-help@r-p

Re: [R] Opposite color in R

2015-07-25 Thread ken knoblauch
the results are unlikely to match a given individual's vision. On top of that, decisions made when this norm was specified are such that it deviates from human vision for short wavelengths so that you would be better off using a corrected version like that proposed by Judd in the 1950's or

Re: [R] Help with GLM starting values in user defined link function

2014-10-23 Thread Ken Knoblauch
csiro.au> writes: > I'm trying to fit a binomial GLM with user defined link function (negative exponential), however I seem to > be unable to find the correct starting values to initialise such a model. I've tried taking starting > values from a logistic and log models fit to the same data an

[R] R matrix multiplication slowdown

2017-01-27 Thread ken eagle
o B, the same command takes 2.4 seconds; at 1050 rows in B, the command is up to almost 4 seconds. Just trying to understand why the big slowdown is occurring, especially since the matrices I actually want to multiply have 1000 and 5000 rows, not 100 and 1017. Thanks, Ken (Macbook Pro runn

Re: [R] R matrix multiplication slowdown

2017-01-27 Thread ken eagle
I've done more searching and found a problem with the data in one of the matrices that was corrupting the calculation. Data now fixed and problem is solved. Apologies if anyone wasted time on this. Ken On Fri, Jan 27, 2017 at 8:29 AM, Jeff Newmiller wrote: > You are asked by the

[R] History pruning

2008-07-30 Thread Ken Williams
ot" or the like. Thanks. -- Ken Williams Research Scientist The Thomson Reuters Corporation Eagan, MN __ 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/pos

Re: [R] History pruning

2008-07-31 Thread Ken Williams
nable to such things, with its pass-by-value functional semantics, etc. -- Ken Williams Research Scientist The Thomson Reuters Corporation Eagan, MN __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] History pruning

2008-07-31 Thread Ken Williams
ated. But coincidentally I work in a Natural Language Processing group, and one of the things we do is create exactly the kind of concise summaries you describe. =) -- Ken Williams Research Scientist The Thomson Reuters Corporation Eagan, MN __

Re: [R] History pruning

2008-07-31 Thread Ken Williams
On 7/31/08 2:12 PM, "Duncan Murdoch" <[EMAIL PROTECTED]> wrote: > > expression() returns a list of language objects, and we only asked for > one. We can look inside it: Hey, cool. Now let me see if I can do anything useful with that. Thanks. -Ken -- Ken Willia

Re: [R] History pruning

2008-08-01 Thread Ken Williams
around without using tools, I tend to do better when I have tools. > You also have to trust that there are no side effects, which I wouldn't > want to do, because plot() changes the value of par() parameters. It does? I wasn't aware of that, could

Re: [R] Multiple R console for OS X?

2008-08-02 Thread Ken Knoblauch
Anh Tran ucla.edu> writes: > I always open more than 1 R console in Windows. I can't figure out a way to > do this with OS X yet. I need that to utilize the duo core on my desktop. > How would I do that? > Have a look here https://stat.ethz.ch/pipermail/r-sig-mac/2008-April/004814.html __

Re: [R] History pruning

2008-08-04 Thread Ken Williams
ow=3) b <- matrix(2:13, nrow=3) c <- matrix(4:15, nrow=3) --- Note that the starting point of all of this is a sequence of commands (the output of savehistory(), so separating commands from output isn't necessary. I've made a bit of progress on this, hopefully I can get

Re: [R] History pruning

2008-08-08 Thread Ken Williams
On 8/8/08 1:04 PM, "Greg Snow" <[EMAIL PROTECTED]> wrote: > Ken, > > Others have given hints on pruning the history, but are you committed to doing > this way? Not necessarily. Only the starting point & ending point really matter; I'd like to be able to

[R] [R-pkgs] new package MLCM: Maximum Likelihood Conjoint Measurement

2009-09-10 Thread Ken Knoblauch
desirability. This package contains tools to estimate the additive contribution of the n scales to the judgment by a maximum likelihood method under several hypotheses of how the perceptual dimensions interact. -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative

Re: [R] How to convert numbers to words?

2009-09-14 Thread Ken Knoblauch
of a function that does this? > > Thanks, > Derek McCrae Norton Try Rnews Volume 5/1, May 2005, The Programmer's Niche by John Fox How Do You Spell That Number? -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue d

Re: [R] Sweave, lty = 3 line incorect in pdf output

2010-02-11 Thread Ken Knoblauch
Hi Achim, Thanks for trying. Maybe, it's a Mac-thing. I'll wait to see if I get other replies. It's strange, as the quartz graphic is correct but the pdf produced by Sweave doesn't contain the dotted line, with the caveat, on my Mac for the moment. Ken Quoting Achim

Re: [R] Sweave, lty = 3 line incorect in pdf output

2010-02-11 Thread Ken Knoblauch
, the dotted line is absent if viewed with Mac's Preview.app and the pdf viewer of TeXShop. I don't have acrobat on my Mac to test that, but it seems to in part, at least, viewer related. Still, it would be good to track this down and ideally solve it. Thanks. Ken Quoting Achim Zeileis :

Re: [R] NextMethod() example from S Programming by Vena bles and Ripley (page 78)

2010-02-13 Thread Ken Knoblauch
lass(x)=c('c1','c2') > test(x) It works fine for me if you add a default method, which I think is what it is looking for. test.default <- function(x){ cat("default") x } test(x) c1 c2 default[1] 1 attr(,"class") [1] "c1" "c2" --

Re: [R] lty dots pdf issue

2010-02-19 Thread Ken Knoblauch
e related to the problem that was driving me crazy last week https://www.stat.math.ethz.ch/pipermail/r-sig-mac/2010-February/007123.html but resolved in the latest patched version? HTH, Ken > Apologies in advance if this has an obvious resolution, I didn't see anything >

Re: [R] Direction and scaling of cumulative distribution in ecdfplot

2010-03-14 Thread Ken Knoblauch
- function(x, logY = TRUE, ...) { xy <- ecdflt(x) if (logY) xy[, 2] <- log10(xy[, 2]) panel.xyplot(xy[, 1], xy[, 2], ...) } xyplot(X ~ X | F, panel = function(x, y = NULL, ...){ panel.ecdflt(x, ...) }) > > Many thanks, > Jeff > > -- > Jeff Stevens

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Ken Knoblauch
that the responsible person is on vacation... -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron France tel: +33 (0)4 72 91 34 77 fax: +33 (0)4 72 91 34 61 portable: +33 (0)6 84 10 64 10 http://www.sbri.

[R] xtable formatting: RED for negative numbers?

2009-07-28 Thread Ken-JP
x.ts? Thanks in advance. - Ken # Sweave/xtable snippet below -- \begin{table}[ht] <>= x.ts <- ts(rnorm(100), start = c(1954, 7), frequency = 12) x.table <- xtable( x.ts, digits = 1 ) print( x.table, floating = FALSE

Re: [R] Compare lm() to glm(family=poisson)

2009-08-01 Thread Ken Knoblauch
default hypothesis when fitting with lm. Also, the default link function with the poisson family is log. So, these are things to take into account in any potential comparison. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du

Re: [R] Stack with factors

2010-04-01 Thread Ken Knoblauch
n verify for yourself that a factor yields FALSE here x <- db1[[1]] is.vector(x) [1] FALSE so I think that this at least explains why it doesn't work as you expected. > Thank you for your help. > > Kenneth -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department o

Re: [R] Excel date to R format

2010-04-13 Thread Ken Takagi
One useful package is "chron": example: library(chron) #convert excel time to date time format etime = 39965.0004549653 orig =chron("12/30/1899"); # "origin" of excel time. date.time = orig + etime; substr(as.character(date.time), 2, 18) # as character w

[R] xtable - how to add a "sum of values in a row" column?

2009-09-27 Thread Ken-JP
Hi, I saw this example for 2.10 Time series in the xtable gallery documentation. http://cran.r-project.org/web/packages/xtable/vignettes/xtableGallery.pdf How would I add a column at the end "Total" which sums the row, with minimal changes to the code below? Thanks in advance. -

Re: [R] xtable - how to add a "sum of values in a row" column?

2009-09-28 Thread Ken-JP
I wonder if the right approach is to convert temp.ts into a matrix, add the column at the end, and then call xtable()... ...anyone have any suggestions? TIA. - Ken Ken-JP wrote: > > Hi, > > I saw this example for 2.10 Time series in the xtable gallery > documentation. >

Re: [R] xtable - how to add a "sum of values in a row" column?

2009-09-28 Thread Ken-JP
Fantastic! I didn't know about addmargins()... It looks like with FUN=myfunc, I can make it do all sorts of fun calculations over the row. TYVM - Ken Henrique Dallazuanna wrote: > > Try this: > > temp.table <- xtable(temp.ts, digits = 0) > temp.table <- x

Re: [R] dichromat, regexp, and grid objects

2009-09-30 Thread Ken Knoblauch
aking, the dichromat package is of great value in avoiding color choices that about 1% of the population would have trouble discriminating. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bron Fran

[R] how do I name data frames and files according to the index of a for loop?

2009-10-07 Thread Ken Ervin
o like to produce the .csv files: ~/file/goes/here1.csv ~/file/goes/here2.csv ~/file/goes/here3.csv ... ~/file/goes/here2858.csv I've been noodling over this for a while and have looked all over but I can't seem to get the syntax right. Any help at all would be appreciated. Thanks again!

[R] reshaping data

2009-10-21 Thread Lo, Ken
time point 1 and 2. It sounds as though the reshape package should be able to do this, but the solution is not obvious to me. Can anybody help? Best, Ken __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] FW: reshaping data

2009-10-21 Thread Lo, Ken
I apologize for the previous post using HTML. Haven't posted for a while and e-mail client default. Best, Ken Hi all, I have a matrix of correlation values between all pairwise comparison in an experiment.  For example, I have 2 time points (1,2) each in triplicate. Thus, I hav

[R] how do I plot a regression curve with the data?

2009-10-27 Thread Ken Ervin
I have a data set of 6 or so ordered pairs, and I've been able to graph them and have decided to use a high-order polynomial regression. I've used the following piece of code: regression <- function(x,y) { x <- c(insert_numbers_here) y <- c(insert_other_numbers_here) fit <- lm(y ~ x +

Re: [R] design matrix construction question

2009-11-02 Thread Ken Knoblauch
0 0 5 0 0 6 0 0 7 0 1 8 0 1 attr(,"assign") [1] 1 1 attr(,"contrasts") attr(,"contrasts")$z [1] "contr.treatment" > > thanks > > Ben Bolker > > > > -- Ken Knoblauch Inserm U846 Stem-cell

[R] Setting column widths in heatmap

2009-11-03 Thread Ken Termiso
Hello, I cannot figure out how to set the column widths (either relative or absolute) for the heatmap function - the full manual hints that layout and lcm will control this, but I haven't had any luck. This is in R 2.9.2 compiled for either FC10 or SUSE11.1 (x86_64)... and am sending the out

Re: [R] How do I run to or more R consoles on Mac OS X?

2009-11-30 Thread Ken Knoblauch
ons/R.app to open as many copies of the app as you like. Be careful though, because these inherit environment variables from the terminal session, not necessarily the same as those when running the app from the Finder. I was bitten by that the first time I tried this. Ken -- Ken Knoblauch Inser

Re: [R] Getting Rd pages right for redefined S3 generic

2009-12-18 Thread Ken Knoblauch
.frame") so that they would still inherit other data frame methods. My rbind.mlds.df works fine with them, and I document it accordingly. HTH. Ken -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18 avenue du Doyen Lépine 69500 Bro

Re: [R] Problem with expand.grid

2009-12-22 Thread Ken Knoblauch
3 823 933 or just vectors expand.grid(1:3, 1:3) Var1 Var2 111 221 331 412 522 632 713 823 933 -- Ken Knoblauch Inserm U846 Stem-cell and Brain Research Institute Department of Integrative Neurosciences 18

[R] Converting data.frame to xts

2009-06-01 Thread Ken Spriggs
I have a data.frame object and I don't really understand how to made an xts class out of it. Consider: > x <- data.frame(datetime, ltp, ltv) > head(x, 2) datetime ltp ltv 1 2009-05-05 07:30:01.604 899 1 2 2009-05-05 07:30:01.963 899 15 > class(x$datetime) [1] "POSIXt" "POSI

Re: [R] Splicing factors without losing levels

2009-06-09 Thread Ken Knoblauch
lx <- levels(x) ly <- levels(y) lxy <- union(lx, ly) xy <- cbind(levels(x)[x], levels(y)[y]) xy <- t(xy) dim(xy) <- NULL xy <- factor(xy, levels = lxy) xy } > splice.factor(factor(1:3), factor(4:6)) [1] 1 4 2 5

[R] overshoot of formula line in summary output of Sweave

2009-06-16 Thread Ken Knoblauch
B = factor(letters[1:2]), C = factor(LETTERS[1:5]), S = factor(paste("S", 1:10, sep = "")), R = rnorm(10)) mod1 <- lm(R ~ A + B + C + S, ddataframe) summary(mod1) @ \end{document} I have attached the pdf output. Thanks,

Re: [R] overshoot of formula line in summary output of Sweave

2009-06-18 Thread Ken Knoblauch
y default to 60L, but you can't access it directly from the summary or anova arguments. It's a bit heavy-handed, but a solution is to change the default value of width.cutoff in base, using assignInNamespace. Making my own deparse in the workspace doesn't work because the base funct

Re: [R] overshoot of formula line in summary output of Sweave

2009-06-19 Thread Ken Knoblauch
quick guess: try keep.source=TRUE and format your commands > >> as you would like to see them appear ... > >> Ben Bolker > > Thanks, Ben, for the response. --- deleted text --- > > I wonder if there is a LaTeX-side solution, i.e. constructing a > v

[R] Roxygen vs Sweave for S4 documentation

2009-06-20 Thread Ken-JP
). Are there any users of Roxygen or Sweave who can comment on the strengths or weaknesses of one or othe other? Thanks in advance. - Ken -- View this message in context: http://www.nabble.com/Roxygen-vs-Sweave-for-S4-documentation-tp24131590p24131590.html Sent from the R help mailing list archive

[R] Roxygen to ignore a block of code?

2009-06-21 Thread Ken-JP
Any way to tell Roxygen to ignore a block of code? It is generating an unwanted .Rd file. I've been searching for hours for an example, scouring documentation, but no luck... Thanks. - Ken -- View this message in context: http://www.nabble.com/Roxygen-to-ignore-a-block-of

Re: [R] Roxygen to ignore a block of code?

2009-06-21 Thread Ken-JP
2. What do I do to prevent Roxygen from warning about: require( zoo ) ? Thx. - Ken -- View this message in context: http://www.nabble.com/Roxygen-to-ignore-a-block-of-code--tp24133293p24137672.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] 'require' equivalent for local functions

2009-03-22 Thread Ken-JP
I agree with Duncan. I used to do exactly what you did - source()ing data files inside a wrapper not unlike C #define wrappers, but it became a headache with more files and the files began looking more cluttered. It has taken me several days to learn about how create a package properly, along wi

[R] performance: zoo's rollapply() vs inline

2009-03-23 Thread Ken-JP
zoo's rollapply() function appears to be extremely useful for plugging in a function on-the-fly to run over a window. With inline, there is a lot more coding and room for error, and the code is less portable because the user has to have R compiling set up or it won't work. However, rollapply() s

[R] Converting a Matrix to a Vector

2009-03-25 Thread Ken-JP
Say I have: > set.seed( 1 ) > m <- matrix( runif(5^2), nrow=5, dimnames = list( c("A","B","C","D","E"), > c("O","P","Q","R","S") ) ) > m O P Q R S A 0.2655087 0.89838968 0.2059746 0.4976992 0.9347052 B 0.3721239 0.94467527 0.1765568 0.7176185 0.2121425 C

[R] Doing %o% that operates on columns instead of atomics

2009-03-25 Thread Ken-JP
Okay, this one is hard to put into words: > x <- 1:9; names(x) <- x > y <- x %o% x > y 1 2 3 4 5 6 7 8 9 1 1 2 3 4 5 6 7 8 9 2 2 4 6 8 10 12 14 16 18 3 3 6 9 12 15 18 21 24 27 4 4 8 12 16 20 24 28 32 36 5 5 10 15 20 25 30 35 40 45 6 6 12 18 24 30 36 42 48 54 7 7 14 21 28

Re: [R] Doing %o% that operates on columns instead of atomics

2009-03-25 Thread Ken-JP
CORRECTION: > my.foo <- function( a, b ) { c <- a - b; } #really more complex, but just > to illustrate -- View this message in context: http://www.nabble.com/Doing--o--that-operates-on-columns-instead-of-atomics-tp22701363p22701400.html Sent from the R help mailing list archive at Nabble.c

Re: [R] Error Running TinnR with R

2009-03-27 Thread Ken-JP
I had all these headaches with Tinn-R on Vista - tried reading all the message boards, reconfiguring .Rprofile, etc... ...no luck. I finally gave up and started using Eclipse with StatET. Now, it's actually easier to run RCMDs to check and release a package, and with SVN integration in Eclipse

[R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-03-28 Thread Ken-JP
I recently got a RFC on Eclipse and StatET setup from a R-help user, so here it is. Note: there may be slight errors of omission in my directions as I am making these notes after I had a successful install. If you have questions post here. Setup tested with Eclipse 3.4.0 on XP 32-bit and Eclips

[R] Excellent Talk on Statistics (Good examples of stat. visualization)

2009-03-30 Thread Ken-JP
with very good examples of statistical visualization. "Talks Hans Rosling: Debunking third-world myths with the best stats you've ever seen" http://www.ted.com/index.php/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen.html -- View this message in context: http://www.nabble.com/Excel

[R] [tcl] unknown color name "red" errors

2009-04-02 Thread Ken-JP
I am running on 64-bit Ubuntu, R version 2.8.1 If I do anything Tcl/Tk related like: > library( Rcmdr ) or > available.packages() I get the error: Error in structure(.External("dotTclObjv", objv, PACKAGE="tcltk"), class = "tclObj") : [tcl] unknown color name "red" --

[R] (SOLVED) Re: [tcl] unknown color name "red" errors

2009-04-04 Thread Ken-JP
On the boards for Ubuntu 8.10 64-bit, there were comments along the lines that: /etc/X11/rgb.txt was missing. However, even after I replace this file, and logged back out in, this problem went away. It's shocking that a file as old/basic as /etc/X11/rgb.txt can be removed - I'm sure a lot of

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-04 Thread Ken-JP
An update: after several days of struggling, I got StatET to work on Ubuntu 8.10 amd64, R 2.8.1. Here are some tips: 1. You may run into an X11 issue with tktcl in R as someone decided to omit /etc/X11/rgb.txt If you get weird issues with your R installation with window colors like "red" or "bla

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-04 Thread Ken-JP
ntu? There must be an obvious reason that I don't know about... Thanks for taking the time to answer. - Ken -- View this message in context: http://www.nabble.com/Eclipse-and-StatET-Howto-%28also-added-Subversion%2C-Rtools%29-tp22764049p22888024.html Sent fr

[R] showing values in levelplot or image

2009-04-05 Thread Ken Wilson
I am trying to visualize a 2D matrix, with some auxiliary labels associated with each rectangle in the chart. The image command and levelplot in the lattice package map data to colors, but I couldn't find any option to specify values I want to show. Is there an easy way to do this? Thanks

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-05 Thread Ken-JP
made obsolete or not. All I know is, removing it breaks some very basic programs. - Ken -- View this message in context: http://www.nabble.com/Eclipse-and-StatET-Howto-%28also-added-Subversion%2C-Rtools%29-tp22764049p22892507.html Sent from the R hel

[R] Need Help with StatET Error/Bug? on Ubuntu 8.10 amd64

2009-04-06 Thread Ken-JP
Hi, I posted this message on the StatET-user board last week, but it looks like a ghost-town... I have a bad feeling that there is some code in the plug-in which doesn't work well with my environment, but if I am lucky, maybe other users have worked around this problem somehow - I am hoping that

Re: [R] Eclipse and StatET Howto (also added Subversion, Rtools)

2009-04-06 Thread Ken-JP
for others in appreciation of help that I got from other posted messages, but also for my future reference when I need to get StatET working on a newly-upgraded system. I hope someone finds this thread useful. - Ken -- View this message in context: http://www.nabble.com/Eclipse-and-StatET-Howto

Re: [R] Need Help with StatET Error/Bug? on Ubuntu 8.10 amd64

2009-04-06 Thread Ken-JP
working on a 64-bit Windoze system, do please let us know. Thank you. - Ken John Fox-6 wrote: > > Dear Ken-JP, > > I'm not sure that this is relevant, but I posted a question recently to > the > StatET list about using StatET with 64 bit Vista (I don't yet have the >

[R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Ken-JP
27;m tempted to have some free-floating code in global space (in one of my package's .R files), but it just seems so wrong/hacky to do it this way. Where is the proper place to put this code? - Ken -- View this message in context: http://www.nabble.com/R-package%3A-Where-to-put-c

Re: [R] R package: Where to put code to Run Once Only?

2009-04-06 Thread Ken-JP
Thanks to pointers from Uwe, I first tried zzz.R and .First.lib(), which does what I needed (initialize once). Then under Martin's suggestion, I converted the package to use NAMESPACE and .onLoad(). Using NAMESPACE, I was able to hide my globals behind a "." (eg .myGlobal <<- 72) and use export

[R] parse_Rd() Version 2 on Japanese Vista 32 (encoding problems)

2009-04-06 Thread Ken-JP
n Japanese Vista 32 - The same setup on a R 2.9.0Alpha English XP Pro 32 works fine without any modification. - I just have ASCII text in my .Rd files. I don't need/intend to put any CJK characters in the files. Any ideas on how to eliminate the warnings would be greatly appr

  1   2   3   >