similar to: Randomly extract rows from a data frame

Displaying 20 results from an estimated 1000 matches similar to: "Randomly extract rows from a data frame"

2008 Jan 04
2
R2WinBUGS sending variables as factors
Hello R and BUGS users, I am writing a heirarchical model in R to send to BUGS via R2WinBUGS and I am finding it difficult to get the model to run. I seem to be having two problems. 1) I can't seem to send variables classed as factors (Month), is there a way do this? 2) Checking the Log in WinBUGS I can see that the model is Syntactically correct, but Bugs is not able to recognise the the
2003 Nov 24
2
1.8.1 and subsetting dataframes
I've encountered something that didn't arise using earlier versions of R (Linux). A dataframe is created and new columns added to it by doing calculations using apply with various functions on some of the original columns. It's somewhat too involved to give a toy example that's reproducible. However, the resulting phenemonon can be characterised by the following: Browse[1]>
2011 Jan 27
1
subloop - flexible coding - variable number of loops
Hello, I want to create a flexible code for the following example: In stead of using a different code for each n (as in my example below), I want to write a general code for every n (n from 1 to 10). I tried a lot of things, but I always got stuck with the number of subloops or witch closing the brackets. Any suggestions? Cheers, Peter Department of Mathematics and Statistics
2008 Oct 09
2
samba v2 works, v3 does not - Unix groups
Shifting from a v2 samba server to v3 - Read documentation and googled LOTS but can't seem to find the bits that apply to my simple(?) server with regards to groups. # rpm -qi samba Version : 3.0.28 Vendor: Red Hat, Inc. Release : 1.el5_2.1 Source RPM: samba-3.0.28-1.el5_2.1.src.rpm Samba on server (Red Hat Enterprise Linux 5.2) IS MOSTLY WORKING... home directories
2000 Nov 29
4
offset
I would like to do a logistic multiple regression on a binary variate, with what Genstat calls an offset, ie a regression variable with the coefficient constrained=1. I'm far from home and have Splus but not R here, but any information from either source would be very welcome. I'd hate to have to go back to using Genstat . . . Thanks, Ted. --------------- Dr E.A. (Ted) Catchpole
2012 Aug 20
1
Kendall package tau-a, b, and c
Hi all, I would like to ask a question related to Kendall package. I ran Kendall (x,y) and saw the results. But I am not sure which tau values R reported. I have ties in my data set, so I want tau-b. Can anybody tell how Kendall package is calculating tau values? I have looked at the package PDF, but I could not find any useful information. As long as I see from the following link, there
2001 Sep 18
1
textbook on experimental design?
I'll be teaching a graduate course on (the analysis of) experimental designs next year, using R. Does anyone know of a suitable textbook? (Venables and Ripley MASS Ch6 on Linear Models covers roughly the right material, but at a level that is way too difficult for my students.) Sorry if this has been asked before. I've looked through the archives and found Julian Faraway's book, but
2001 Feb 13
3
xfig boxplot (polygon) bug??
There appears to be a bug in the R xfig() driver. When I run a simple example, eg > data(InsectSprays) > boxplot(count ~ spray, data = InsectSprays, col = "lightgray") the boxplot is fine. Doing the same thing after > xfig(file='test.fig') and then opening in Xfig (ver3.2 patchlevel 2) on my Linux box produces boxplots where the boxes, although correctly shaded in,
2001 Feb 13
3
xfig boxplot (polygon) bug??
There appears to be a bug in the R xfig() driver. When I run a simple example, eg > data(InsectSprays) > boxplot(count ~ spray, data = InsectSprays, col = "lightgray") the boxplot is fine. Doing the same thing after > xfig(file='test.fig') and then opening in Xfig (ver3.2 patchlevel 2) on my Linux box produces boxplots where the boxes, although correctly shaded in,
2015 Mar 10
1
aio_pthread on Debian?
Hello Volker, Thank you for the reply. I've seen your name mentioned several times against this topic :-) >What effect do you have in mind exactly? Read/write is done >asynchronously these days without that module as long as the >build detected pthreads. This is the thing... it looks like the Debian packages (stable + back port) are built without the --with-aio-support (at least
2002 Jun 24
3
Tunnel SMB thru SSH?
It is possible to tunnel various protocols - NNTP, FTP, HTTP etc thru SSH. Is it possible to do the same using SMB? TIA, Alex. -------------------- Mr Alex Meaden Computer Science Undergraduate University of Kent at Canterbury aejm1@meaden.dyndns.org http://meaden.dyndns.org/
2002 Apr 23
2
Asking about how to use R to draw Time Series graph
Hi I'm study at University of Canterbury. Now, We have one project use R to do time series. The problem is I don't know how to use R to draw time series graph! Can you help me sovle this problem? I can not find in manuals book! Can you tearch me what fuction command I have to use? Thanks alway! Sam
2004 Sep 06
4
100% CPU utilisation
Dovecot (0.9.11) consumes 100% CPU utilisation when accessing (either pop or imap) one of my mailboxes. It doesn''t happen with other mailboxes. The mailbox has about 500 mails while others have many more. They are all in mbox format. OS: OpenBSD-3.5 with all patches MTA: Sendmail-8.12.11 It happened with other RCs of dovecot-0.9.11 Configured as: ./configure --without-pam
2009 Oct 26
2
R CMD check: Error in .C
Function/file names are hypothetical. Say I have written myfunction.R, which calls myfunction.c via .C("myfunction", ...). I've compiled successfully myfunction.c via R CMD SHLIB myfunction.c in the terminal. Then, in the R console: dyn.load("myfunction.so") source("myfunction.R") test <- myfunction() # works fine So everything is in order, myfunction works
2010 Feb 09
3
subset in a matrix
Hi, I have a matrix of data values like the example bellow. I would like to extract a subset of the matrix for the values where the first column is negative. I am using the subset function. However, I am getting an error message that the conditional variable doe snot exist. For some reason, the subset operation only works if I transform the matrix to a data set using as.data.set(). The help
2008 Dec 18
1
vbscript in wine
Hi there, I'm having an issue with vbscript in wine. It relates to a problem with the cardbox database client which you can see here: http://www.cardbox.com/wine.htm I get the Cardbox error message and pressing OK will return me to the Cardbox window, indicating vbscript is not installed. First I just ran the installer which I found here:
2011 Mar 29
1
Creating a list of all objects
Dear all I am trying to create a list of all objects created over the course of a function. To wit: foo <- function(x){ first <- x*(1:8) second <- matrix(x*(1:16), ncol = 4) third <- 1:x list(x=x, first=first, second=second, third=third) } foo(5) No worries there. However, in the search for typing efficiency I wondered if it would be possible to use list(ls()) in
2003 Feb 19
2
plotmath
There's something (probably a lot) missing in my understanding of plotmath. The LaTeX code for what I'm trying to produce is \log(-\log(\hat R)) My (probably hopeless) attempt at it uses nested group()s: expression(plain(log) * group("(", -plain(log)*group("(", \hat(R), ")"), ")")) Can anyone do it right for me, please? Thanks, Ted. Dr E.A.
2008 Jun 17
2
Reshape or Stack? (To produce output as columns)
Dear all, I have used 'read.table' to create a data frame of 720 columns and 360 rows (and assigned this to 'Jan'). The row and column names are numeric: > columnnames <- sprintf("%.2f", seq(from = -179.75, to = 179.75, length = 720)). > rnames <- sprintf("%.2f", seq(from = -89.75, to = 89.75, length = 360)) > colnames(Jan) <- columnnames
2017 Oct 27
4
Cannot Compute Box's M (Three Days Trying...)
It can't be this hard, right? I really need a shove in the right direction here. Been spinning wheels for three days. Cannot get past the errors. I'm doing something wrong, obviously, since I can easily compute the Box's M right there in RStudio But I don't see what is wrong below with the coding equivalent. The entire code snippet is below. The code fails below on the call to