Re: [R] Wrong results from anova

2015-04-14 Thread Phil Spector
‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 summary(fit.Y) Df Sum Sq Mean Sq F valuePr(F) sample.Y 3 2202.70 734.23 190706 2.2e-16 *** Residuals80.030.00 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - Phil Spector

Re: [R] Capturing output of a C executable

2014-02-03 Thread Phil Spector
://www.stat.berkeley.edu/classes/s243/calling.pdf - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Extracting Numeric Columns from Data Fram

2013-02-16 Thread Phil Spector
Barry = Suppose your data frame is called mydat. Then something like mydat[,sapply(mydat,class) %in% c('numeric','integer')] might do what you want. - Phil On Sat, 16 Feb 2013, Barry DeCicco wrote: Hello, I've got a data frame

Re: [R] help with calculation from dataframe with multiple entries per sample

2012-09-17 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu

Re: [R] How to adjust the start of a series to zero? (i.e. subtract the first value from the sequence)

2012-06-30 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu

Re: [R] need help reshaping table using aggregate

2012-06-20 Thread Phil Spector
Tim - Another approach to your problem is to use xtabs: xtabs(count~site+bug,data=myf) bug site grasshopper ladybug spider stinkbug A 4 0 20 B 0 6 08 - Phil Spector

Re: [R] strings concatenation and organization (fast)

2012-06-15 Thread Phil Spector
.) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
.) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Wed, 30

Re: [R] reading file in zip archive

2012-05-30 Thread Phil Spector
Iain - Do you see the same behaviour if you use z - unz(pathToZip, 'x.txt') instead of z - unz(pathToZip, 'x.txt','r') - Phil Spector Statistical Computing Facility

Re: [R] SAS Import with sas.get {Hmisc} - status 127 error

2012-03-28 Thread Phil Spector
I've found the keep,log=TRUE option of sas.get to be useful in cases like this. There's also a log.file= option if you don't want the default location for the log file. - Phil Spector Statistical Computing Facility

Re: [R] obtaining a true/false vector with combination of strsplit, length, unlist,

2012-02-11 Thread Phil Spector
It sounds like the problem boils down to counting the number of _s in the WELLID variable, and seeing if there are two: nchar(gsub('[^_]','',edm$WELLID)) == 2 [1] FALSE FALSE TRUE TRUE TRUE TRUE FALSE - Phil Spector

Re: [R] apply pairs function to multiple columns in a data frame

2012-02-10 Thread Phil Spector
answer. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec

Re: [R] Rearanging Data

2012-02-09 Thread Phil Spector
Try sub - subset(Claims, Year==Y1) In R, the equality test is performed by two equal signs, not one. - Phil Spector Statistical Computing Facility Department

Re: [R] Subsetting for the ten highest values by group in a dataframe

2012-01-27 Thread Phil Spector
],]) should give you what you want. In this simple case, you could also use do.call(rbind,by(df,df$z,function(dat)dat[order(dat$x,decreasing=TRUE)[1:10],])) from base R to get the same result. Hope this helps. - Phil Spector

Re: [R] Using !is.na() in a HAVING clause in sqldf() XXXX

2012-01-17 Thread Phil Spector
Dan - Try using having Premie not null instead of having !is.na(Premie) . - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Deleting rows and store the deleted rows in new data frame

2011-07-24 Thread Phil Spector
There's no need to use sapply or loops with grep -- it's already vectorized. So you can find the rows you're interested in with wh = grep('^[.,]+$',df[,9]) store them with sf = df[wh,] and delete them with df = df[-wh,] - Phil Spector

Re: [R] list.files recursively to find files in a specific way...

2011-07-19 Thread Phil Spector
you what you want. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] cbind 3 or more matrices

2011-06-04 Thread Phil Spector
[,7] [,8][,9] [1,] -1.7481451 0.4467964 -0.41358420 [2,] -0.2882922 1.0243662 -0.48263684 [3,] 0.9402479 0.5467952 -0.01922035 [4,] 0.6795783 1.4560765 -0.23013826 [5,] 0.9800312 -1.3462175 -0.77064872 - Phil Spector

Re: [R] Oddity: I seem to have a variable in a dataframe that doesn't show in colnames() - can anyone advise?

2011-05-29 Thread Phil Spector
selected x[['PHQ']] NULL So if you don't want this feature, you can use brackets instead of the dollar sign for extraction. - Phil Spector Statistical Computing Facility

Re: [R] how to combine two data frames via factors (or somehow else)

2011-05-29 Thread Phil Spector
Philipp - I believe you're looking for the merge function. If you need more guidance, please provide a meaningful reproducible example. - Phil Spector Statistical Computing Facility

Re: [R] Installing package rgdal

2011-05-28 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Sun, 29

Re: [R] Count of rows while looping through data

2011-05-27 Thread Phil Spector
Jeanna - The family variable is being stored as a factor. You could eliminate the NA values manually, or you could try something like x$family = as.character(x$family) before subsetting. If neither of these solutions are satisfactory, please follow the posting guide and provide a

Re: [R] Arrange a multi-level list to a one-level list

2011-05-27 Thread Phil Spector
0 [2,]10 [[2]] [,1] [,2] [1,]32 [2,]32 [[3]] [,1] [,2] [,3] [1,]101 [2,]010 [[4]] [,1] [,2] [,3] [1,]222 [2,]223 - Phil Spector

Re: [R] Applying toupper to only portions of text strings

2011-05-26 Thread Phil Spector
|ddd - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec

Re: [R] Trouble Combining With Paste

2011-05-25 Thread Phil Spector
John - Try infert[,toolong] = sapply(infert[,toolong],cut2,g=10,levels.mean=TRUE) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Extracting day of month from Date objects

2011-05-24 Thread Phil Spector
as factors. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley On May 24, 2011, at 10:19 AM, Kang Min

Re: [R] Count of rows while looping through data

2011-05-24 Thread Phil Spector
this helps. Take a look at the help page for the ave function to understand how it works. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Multiple count if style queries

2011-05-20 Thread Phil Spector
rain forests']]$Genus Bromheadia Homalomena 1 1 Hope this helps. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] trouble with summary tables with several variables using aggregate function

2011-05-19 Thread Phil Spector
2 2 3 S1 T2 2 2 7 S2 T2 NA 4 - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] File to MYSQL

2011-05-16 Thread Phil Spector
of the final query. You might also familiarize yourself with dbGetQuery, which may be more suited to your needs. - Phil Spector Statistical Computing Facility Department

Re: [R] Creating dataframes

2011-05-13 Thread Phil Spector
The way to do what you want is to use the split function, for example, mydataframes = split(exmpl,exmpl$Site) This will return a list with all the data frames. If you don't understand why this is a better solution than creating many separate data frames, let us know what you plan to do with

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread Phil Spector
John - In your example, the misclassified observations (as defined by your predict.function) will be kyphosis[kyphosis$Kyphosis == 'absent' prediction[,1] != 1,] so you could start from there. - Phil Spector

Re: [R] about vector to the power of a decimal

2011-05-12 Thread Phil Spector
(-2)^2.1 [1] NaN complex(real=-2)^2.1 [1] 4.077269+1.324785i - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] help with mysql and R: partitioning by quintile

2011-05-08 Thread Phil Spector
One way to get the ratings would be to use the ave() function: rating = ave(x$freq,x$track, FUN=function(x)cut(x,quantile(x,(0:5)/5),include.lowest=TRUE)) - Phil Spector Statistical Computing Facility

Re: [R] simulate AR(1) process

2011-05-05 Thread Phil Spector
?arima.sim - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Help converting a data.frame to ordered factors

2011-05-02 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Mon, 2 May 2011

Re: [R] Regression Summary for a List

2011-04-29 Thread Phil Spector
Ryan - summary expects an lm object, and fit is a list. So you need to use something like lapply(fit,summary) to pass each list element to the summary function. - Phil Spector Statistical Computing Facility

Re: [R] How to define specially nested functions

2011-04-28 Thread Phil Spector
Here's one possibility: funmaker = function(x,y,z)function(z)x + y + (x^2 - z) uniroot(funmaker(1,3,z),c(0,10))$root [1] 5 uniroot(funmaker(5,2,z),c(30,40))$root [1] 32 (The third argument to the function doesn't really do anything.) - Phil Spector

Re: [R] paste function by INDICES

2011-04-27 Thread Phil Spector
),paste,collapse='') - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Question on list object

2011-04-27 Thread Phil Spector
,] -2.5787357 1.381395 -1.6545857 0.8239982 -1.169961 - Phil Spector Statistical Computing Facility Department of Statistics UC

Re: [R] merge with origin information in new variable names

2011-04-25 Thread Phil Spector
],nm,sep='.') df } Reduce(function(x,y)merge(x,y,by='id'),lapply(names(dfs),changenm)) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Phil Spector
Abraham - sudo apt-get install libxml2-dev is what you need to get the development libraries and xml2-config installed on your Ubuntu machine. - Phil On Mon, 25 Apr 2011, Abraham Mathew wrote: Hello folks, Here's is info on what system I'm

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Phil Spector
sudo apt-get install libcurl4-openssl-dev - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Problem installing XML in Ubuntu 10.10

2011-04-25 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu

Re: [R] Install and Configure RSQLite in Ubuntu

2011-04-25 Thread Phil Spector
sudo apt-get install libsqlite3-dev (Unfortunately, the method I described to find this package in my previous post doesn't work for this one.) - Phil Spector Statistical Computing Facility

Re: [R] Parametrized object name in Save statement

2011-04-22 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Fri

Re: [R] 'Record' row values every time the binary value in a collumn changes

2011-04-20 Thread Phil Spector
] = answer[,2] x[2] = answer[,3],4]) [1] 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] get cells by the combination of their column and row names

2011-04-20 Thread Phil Spector
[outer(rownames(mtrx),colnames(mtrx),function(x,y)substr(x,2,4) == substr(y,2,4))] Hope this helps. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Extract indices after comparing two vectors

2011-04-18 Thread Phil Spector
?which A - c(1,2,3,4) B - c(0,3,1,5) which(AB) max(which(AB)) [1] 4 - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] loop and sapply problem, help need

2011-04-09 Thread Phil Spector
= rbind(lcd1,lcd2,lcd3) pn = replicate(10,allvals[sample(smpool,1),]) but I can't be sure. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Finding elements in a character vector

2011-04-08 Thread Phil Spector
match(list.a,list.b) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Where is the tcltk package?

2011-04-07 Thread Phil Spector
Rolf - In order for R to build with tcltk support, the tcl/tk development packages need to be available when R is configured. This command apt-get install tcl8.5-dev tk8.5-dev will install the necessary development packages, but you'll need to reconfigure and rebuild R in order to get tcltk

Re: [R] Cannot install pakcage RMySQL

2011-04-06 Thread Phil Spector
You need to install the mysql client development libraries. On SUSE systems, I believe the package is called libmysqlclient-devel . - Phil Spector Statistical Computing Facility

Re: [R] Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Phil Spector
Walter - Since your codes represent numbers, you could use something like this: chk = as.numeric((hh.sub$HHFAMINC) hh.sub$CS_FAMINC = cut(chk,c(-10,0,5,10,15,17,18),labels=c(0,1:5)) - Phil Spector Statistical

Re: [R] Select subset of data

2011-03-29 Thread Phil Spector
Lisa - Suppose your data frame is called somedat. Then do.call(rbind,spl[sapply(spl,function(z)z$result[1] == 0 z$result[2] == 0 sum(z$result) == 1)]) should give you what you want. - Phil Spector

Re: [R] line graph question

2011-03-26 Thread Phil Spector
)) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Sat, 26 Mar 2011, Bulent

Re: [R] how to convert a data.frame to a list of dist objects for individual differences MDS?

2011-03-22 Thread Phil Spector
5.0 11.5 10.7 10.2 10.6 10.1 8.1 6.4 3.0 - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Loading mdb

2011-03-22 Thread Phil Spector
operating system you are using, but the mdb tools are designed for non-Windows systems. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Loading mdb

2011-03-22 Thread Phil Spector
. You should then be able to pass the Data Source Name you chose to the odbcConnect function, and use the result in the odbcQuery to make SQL queries to your data base. Hope this helps. - Phil Spector Statistical

Re: [R] problem running a function

2011-03-19 Thread Phil Spector
Try RN() - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] [O/T] reference for regular expressions

2011-03-18 Thread Phil Spector
Erin - If you seriously want to learn about regular expressions, I would recommend Mastering Regular Expressions by Jeffrey Freidl. (http://oreilly.com/catalog/9781565922570). I don't think there's anything that's more thorough or authoritive. - Phil

Re: [R] Reorganize data frame

2011-03-16 Thread Phil Spector
Ticker Return 1 20110301 MSFT 0.05 2 20110302 MSFT 0.01 3 20110301 GOOG -0.01 4 20110302 GOOG 0.04 - Phil Spector Statistical Computing Facility Department

Re: [R] Why doesn't this work ?

2011-03-16 Thread Phil Spector
%in% c(1,2,3),1,0) makez(3) [1] 1 makez(4) [1] 0 - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Large dataset operations

2011-03-11 Thread Phil Spector
To get the equivalent of what your loop does, you could use lapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean)) but you might find the output of sapply(data[,3:5],function(x)x/ave(x,data$plateNo,FUN=mean)) to be more useful. - Phil Spector

Re: [R] 'Date' elements within a matrix

2011-03-11 Thread Phil Spector
-01-07 2 2011-01-02 2011-01-05 2011-01-08 3 2011-01-03 2011-01-06 2011-01-09 sapply(z,class) pts.1.3. pts.4.6. pts.7.9. Date Date Date - Phil Spector Statistical Computing Facility

Re: [R] using lapply

2011-03-10 Thread Phil Spector
large problems. Learning to use the apply family of functions from the start avoids this misconception. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] A question about data frame

2011-03-10 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec

Re: [R] Help with read.csv

2011-03-09 Thread Phil Spector
Giovanni - If you change int (which has no meaning in R) to integer in your second example, it should work. - Phil Spector Statistical Computing Facility Department

Re: [R] Speed up sum of outer products?

2011-03-01 Thread Phil Spector
could just do the calculation directly: system.time({C1 = t(X) %*% X}) user system elapsed 0.008 0.000 0.007 all.equal(C,C1) [1] TRUE - Phil Spector Statistical Computing Facility

Re: [R] typecasting a function from character to double

2011-02-28 Thread Phil Spector
(3,2) [1] 0.75 expr1(10,5) [1] 0.5454545 - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Transform a dataset from long to wide using reshape2

2011-02-26 Thread Phil Spector
rearrange the values. Hope this helps. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] how to remove rows in which 2 or more observations are smaller than a given threshold?

2011-02-26 Thread Phil Spector
be of much use here. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] combining two columns into one column despite NAs

2011-02-24 Thread Phil Spector
Andrew - I believe character.data$z = ifelse(is.na(character.data$x), character.data$y,character.data$x) should do what you want. - Phil Spector Statistical Computing Facility

Re: [R] Mutiplying a data frame to a list

2011-02-21 Thread Phil Spector
Rohit- If I understand you correctly, and your list's name is mylist, then mapply('*',mylist,as.numeric(names(mylist))) will do what you want. In the future, please provide a reproducible example. - Phil Spector

Re: [R] (no subject)

2011-02-21 Thread Phil Spector
an informative subject line 2) showing us what you tried without including your typos and other errors. I think you'll find this a more effective strategy than trying to replace core elements of R that you don't understand with empty functions. - Phil Spector

Re: [R] Delete Comment Lines from SQL String as a Vector

2011-02-21 Thread Phil Spector
(width=20) use[use != ''] [1] select sysdate [2] from dual - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] How to speed up a for() loop

2011-02-17 Thread Phil Spector
of random numbers for each element of systemic, I don't see an easy way to vectorize your code (which doesn't mean that such a way doesn't exist). - Phil Spector Statistical Computing Facility

Re: [R] A very basic line-plot question

2011-02-17 Thread Phil Spector
in what ever way you want, to produce a whatever sort of plot you wanted. I'll leave it to you to figure out the details. - Phil Spector Statistical Computing Facility Department

Re: [R] sort by column and row names

2011-02-17 Thread Phil Spector
Jim - I believe dat[order(rownames(dat)),order(colnames(dat))] is what you are looking for. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Using Weights in R

2011-02-17 Thread Phil Spector
You can probably find the specific part you want from the above code. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] xyplot formula

2011-02-17 Thread Phil Spector
) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Fri, 18 Feb

Re: [R] Testing for empty result of which

2011-02-15 Thread Phil Spector
Francois - I think you're looking for the any function: x = c(1,2,3) y = c(4,5,6) any(x==y) [1] FALSE any(which(x==y)) [1] FALSE x = c(1,2,3) y = c(4,2,5) any(x==y) [1] TRUE any(which(x==y)) [1] TRUE - Phil Spector

Re: [R] Write File to Shared Drive

2011-02-15 Thread Phil Spector
use a call to file.choose() by itself to see what path R expects to see for a particular file or directory. - Phil Spector Statistical Computing Facility Department

Re: [R] help with aggregate()

2011-02-15 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu

Re: [R] selecting columns

2011-02-15 Thread Phil Spector
write.csv(mydata[,grep('Location|Ambient|Name',names(mydata),invert=TRUE)], file='mydata.csv') should do what you want, but without a more concrete example, it's just a guess. - Phil Spector Statistical

Re: [R] Loop to find dates whithin dates

2011-02-10 Thread Phil Spector
,'day','night') both$date = both$sunrise = both$sunset = NULL Then both should be the data frame you want. - Phil Spector Statistical Computing Facility Department

Re: [R] highest and second highest value in row for each combination

2011-02-10 Thread Phil Spector
a seed for the random number generator) I'm not exactly sure how to form your column combination, though. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] accessing members from a data frame

2011-02-10 Thread Phil Spector
Try my.data.frame[my.data.frame$Buy==1 | my.data.frame$Sell ==1, ] or subset(my.data.frame,buy == 1 | sell == 1) Then take a look at the help page for || i.e., help(||) to see what you did wrong. - Phil Spector

Re: [R] Calculating rowMeans from different columns in each row?

2011-02-10 Thread Phil Spector
Marine - Assuming your data frame is named df, I think apply(df,1,function(x)mean(x[x[7]:x[8]])) will give you what you're looking for. - Phil Spector Statistical Computing Facility

Re: [R] add mean and sd to dotplot in each panel using lattice

2011-02-09 Thread Phil Spector
-.1,i+.1),rep(mns[i] + 1.96 * sds[i],2)); llines(c(i-.1,i+.1),rep(mns[i] - 1.96 * sds[i],2))} panel.dotplot(x,y,...) } dotplot(Score ~ Dose | Sex, groups=Sex, data=dat,panel=mypanel) - Phil Spector

Re: [R] Keep date, strip time?

2011-02-08 Thread Phil Spector
-06-15 as.Date(sub('\\d+:\\d+:\\d+ [AP]M','',dts),'%m/%d/%Y') [1] 2009-06-10 2009-06-15 2009-06-15 as.Date(as.POSIXct(dts,format='%m/%d/%Y %H:%M:%S %p')) [1] 2009-06-10 2009-06-15 2009-06-15 - Phil Spector

Re: [R] manipulating the Date Time classes

2011-02-08 Thread Phil Spector
here.   -- xkcd -- Help protect Wikipedia. Donate now: http://wikimediafoundation.org/wiki/Support_Wikipedia/en On Tue, Feb 8, 2011 at 12:31 PM, Phil Spector spec...@stat.berkeley.edu wrote: Mike -   In what sense do min and max not work? tm = as.POSIXct(c(2010-12-14 20:25

Re: [R] delete a row in dataframe w/o changing indexing

2011-02-08 Thread Phil Spector
Nicolas - I don't think it can be done automatically, but you can use row.names(pop) = 1:nrow(pop) after deleting the column(s) to restore consecutive numbers for the row names. - Phil Spector Statistical

Re: [R] Removing X and Y labels in graph error

2011-02-08 Thread Phil Spector
Contrast the behaviour of these two statements: plot(x,y,xlab=NULL,ylab=NULL) plot(x,y,xlab='',ylab='') In other words, use xlab='' to supress the label, not NULL. - Phil Spector Statistical Computing Facility

Re: [R] Using Aggregate for Date

2011-02-07 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu

Re: [R] Applying 'cbind/rbind' among different list object

2011-02-06 Thread Phil Spector
Another possibility is mapply(rbind,list1,list2,SIMPLIFY=FALSE) - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] Multiplying elements of vectors

2011-02-05 Thread Phil Spector
outer(x,y) [,1] [,2] [,3] [,4] [1,] 25 50 75 100 [2,] 50 100 150 200 [3,] 75 150 225 300 [4,] 100 200 300 400 The outer() function will accepts a FUN= argument which defaults to '*'. - Phil Spector

Re: [R] dataframes from a function

2011-02-04 Thread Phil Spector
. - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Fri, 4 Feb 2011

Re: [R] aggregate function - na.action

2011-02-04 Thread Phil Spector
is the function you're calling is that na.omit will remove the entire row of data when it encounters a missing value, while the na.rm=TRUE argument will remove missing values separately from each variable.) Hope this helps. - Phil Spector

Re: [R] tapply output as a dataframe

2011-02-03 Thread Phil Spector
Try as.data.frame(as.table(a)) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

  1   2   3   4   >