[R] Question about scatterplot in package car

2011-01-15 Thread David Perlman
I am getting an error message from scatterplot: > library(car) > scatterplot(Prestige$income~Prestige$type) Error in Summary.factor(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, : range not meaningful for factors In addition: Warning message: In Ops.factor(x[floor(d)], x[ceiling(d)]) : + not m

[R] Group labels in lattice barchart

2011-03-22 Thread David Perlman
Hello, I've been searching on the web for a few hours and seem to be stuck on this. The code pasted below generates a histogram of subject responses in four different conditions in an experiment. This version of the graph is one I'm using for internal consistency checking, so I've set it up to

[R] Reshape question

2012-03-06 Thread David Perlman
I have a data frame in wide format. There are six variables that represent two factors in long format 3x2, Valence and Temperature: > head(dpts) File Subj Time Group PainNeg.hot PainNeg.warm SociNeg.hot SociNeg.warm Positiv.hot Positiv.warm Errors 1 WB101_1_1_dp.txt 1011 MN

[R] by output into data frame

2012-03-19 Thread David Perlman
I could do this in various hacky ways, but what's the right way? I have a nice application of the by function, which does what I want. The output looks like this: > auc_stress lab.samples.stress$subid: 2 cortisol amylase 1 919.05 6834.8 -

[R] There must be a better way to do this

2012-05-08 Thread David Perlman
I made this rather cool plot which I am quite pleased with: http://brainimaging.waisman.wisc.edu/~perlman/data/BeeswarmLinesDemo.pdf However, I feel there must be a better way to do it than what I did. I'm attaching the code to create it, which downloads the data by http so it should run for yo

Re: [R] There must be a better way to do this

2012-05-09 Thread David Perlman
the question. :) I have replaced my old horrible code with the nice concise segments code. Thanks! On May 9, 2012, at 3:55 AM, Jim Lemon wrote: > On 05/09/2012 03:59 AM, David Perlman wrote: >> I made this rather cool plot which I am quite pleased with

[R] List indexing question

2012-05-21 Thread David Perlman
Consider the following: > x<-list(c(1,2,3),c(4,5,6)) > x[1] [[1]] [1] 1 2 3 > x[2] [[1]] [1] 4 5 6 So far that all seems reasonable. But now there's a problem. I'm used to python, where I would say x[2][1] and get the value 4. But I can't figure out how to do that in R. > x[2][1] [[1]] [1]