Displaying 20 results from an estimated 20000 matches similar to: "split the data"
2011 Feb 17
3
sampling
I want to sample from the ID. For each ID, i want to have 2 set of data. I
try the sample() function but it didn't work.
> x<-data.frame(id=c(1,1,1,2,2,2,2,3,3,3,4,4), v1=c(1:12), V2=c(12:23))
> x
id v1 V2
1 1 1 12
2 1 2 13
3 1 3 14
4 2 4 15
5 2 5 16
6 2 6 17
7 2 7 18
8 3 8 19
9 3 9 20
10 3 10 21
11 4 11 22
12 4 12 23
--
View this message in
2011 Feb 17
2
convert the sas file into csv in R
i am trying to convert sas file into csv. I used write.csv(a,
file="cool.csv") but nothing come out. i don't know why. Thanks.
library(Hmisc)
a<- sasxport.get("C:\\Users\.....")
write.csv(a, file="cool.csv")
--
View this message in context: http://r.789695.n4.nabble.com/convert-the-sas-file-into-csv-in-R-tp3311769p3311769.html
Sent from the R help mailing
2010 Jun 15
3
How to see how a function is written
Hello,
If I want to see how, say, apply function is written, how would I be
able to do that?
Just typing "apply" at the prompt does not work.
Thank you for help!
Sergey
2007 Mar 05
3
Rbind with data frames -- column names question
As part of my work, I am trying to append matrices onto data frames.
Naively I assumed that when rbinding a data.frame and matrix, the matrix
would be coerced and appended, keeping the names from the data frame.
Clearly, I am not fully understanding the process by which rbind works.
Example code:
> A<-data.frame(1,1,1); names(A)=letters[1:3] ; B<-matrix(0,2,3)
> rbind(A,B)
2006 Nov 01
2
xyplot: Plotting two variables, one as points - the other as line. Can that be done without explicitly using panel functions
Hi! Consider
d <- data.frame(x=1:10,y=5+1:10, yf=rnorm(10,5+1:10))
x y yf
1 1 6 5.268621
2 2 7 8.623896
3 3 8 8.114830
4 4 9 10.125955
5 5 10 9.977261
...
I plot y and yf against x with
xyplot(y+yf~x,data=d,col=c('red','green'),pch=c("a","b"))
BUT - I would like that the plot of y against x is with type='l' and the
2008 Jun 03
1
splitting data frame based on a criteria
Hi,
I have a data frame that I want to split into two based on the values of a
variable in it.
The variable Y has numeric values ranging between 0 through 70. I want to
plot the frequencies of another variable X in two different cases:
- When Y = 0 and
- When Y > 0
How does one go about doing this?
In general, I want to do several analyses with this data frame that are a
variation of the
2009 Aug 05
4
multiple lty on same panel in xyplot
I would like to use lattice graphics to plot multiple functions (or groups
or subpopulations) on the same plot region, using different line types "lty"
or colors "col" to distinguish the functions (or groups).
In traditional graphics, this seems straightforward: First plot all the data
using 'type="n"', and subsequently execute a series of "points"
2017 Mar 25
7
[Bug 2699] New: PKCS#8 private keys with AES-128-CBC stopped working
https://bugzilla.mindrot.org/show_bug.cgi?id=2699
Bug ID: 2699
Summary: PKCS#8 private keys with AES-128-CBC stopped working
Product: Portable OpenSSH
Version: 7.5p1
Hardware: amd64
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: ssh-keygen
Assignee:
2008 Jun 20
2
Problems with basic loop
I'm having trouble creating a looping variable and i can't see wher ethe
problem arises from any hep gratfully appreciated
First create a table
x<-table(SURVEY$n_0,exposed)
> x
exposed
False True
Under 16 24 1
16-19 68 9
20-24 190 37
25-34 555 204
35-44 330 87
45-54 198 65
55-64 67 35
65+
2001 Jan 10
1
optmizing with monotone stepfunctions?
Before re-inventing the wheel I would like to ask: does anyone know about
an optimizer in R which can reliably identify which value of X (Xopt) leads
to Y (Yopt) closest to Ytarget in
Y <- MonotoneStepFun(X)
optionally with the restriction that Yopt <= Ytarget
(at least if any Y <= Ytarget, otherwise any Yopt > Ytarget would be the
preferred answer)
If none is known, I will write
2000 Apr 10
2
Newbie: how to calculate group averagege?
Dear R-List,
I?m new in R, so I hope my question is not to primitive, but I haven?t
found a solution in the R-help. I?ve got a datatframe with 3 factors,
called xf (9 levels), yf (9 levels), zf (3 levels) and one variable
(rt):
> xf yf zf rt
> 1 1 1 67
> 1 1 1 56
> 1 1 1 60
[...]
> 1 1 2 58
> 1 1 2 61
[...]
> 9 1
2006 Nov 09
2
Single precision data behaviour with readBin()
Hi all,
I am running R version 2.4.0 (2006-10-03) on an i686 pc with Mandrake
10.2 Linux. I was given a binary data file containing single precision
numbers that I would like to read into R. In a previous posting,
someone suggested reading in such data as double(), which is what I've
tried:
> zz <- file(file, "rb")
> h1 <- readBin(con = zz, what = double(), n = 1, size
2011 Jan 17
1
isoreg memory leak?
I believe there is a memory leak in isoreg in the current version of R,
as I believe the following shows
> gc()
used (Mb) gc trigger (Mb) max used (Mb)
Ncells 120405 3.3 350000 9.4 350000 9.4
Vcells 78639 0.6 786432 6.0 392463 3.0
> for(k in 1:100) {
+
+ y <- runif(10000)
+ isoreg(x,y)
+ }
> rm(x)
> rm(y)
> gc()
used (Mb) gc
2006 May 16
2
split the data.frame
Dear R folks:
I wonder anyone has a elegent way of doing what I need to do.
I have a data frame called with four columns: V1, V2, A1 and A2:
V1 V2 A1 A2
A B 1.2 2.0
A D 1.2 4.0
A C 2.4 2.2
What I need to do is to convert it into the following data frame with a new column x, where x is just the stacked up of A1 and A2 placed with respective V1 and V2 in the first two
2018 Nov 03
4
inquiry about limitation of file system
Thank you for your hint.
I really mean I am planning to store millions of files on the file system.
Then may I ask that what is the maximum number of files which could be stored in one directory without affecting the performance of web server?
At 2018-11-03 16:03:56, "Walter H." <Walter.H at mathemainzel.info> wrote:
>On 03.11.2018 08:44, yf chu wrote:
>> I have
2004 Jan 28
3
unstability when using isoreg() function (PR#6494)
Full_Name: Petr Klasterecky
Version: 1.8.1
OS: Windows XP, Linux
Submission from: (NULL) (195.113.27.212)
The isoreg() function causes R to crash when called repeatedly. Consider the
following simple script:
{
library(modreg)
N <- 10
x <- rnorm(N)
print("Original x values:")
print(x)
for(n in (1:N)){print(y <- isoreg(x[1:n])$yf)}
}
I am able to run (call) it several
2012 Aug 11
8
Pass array to a define
How can I pass an array to a define? It''s not documented in the puppet
language guide.
I''ve got:
define lvm::create_vg ( $pvdisks ) {
exec {
''pvcreate'':
command => "/sbin/pvcreate -yf $pvdisks",
unless => "/sbin/pvdisplay $pvdisks",
...
}
}
class someclass {
lvm::create_vg {
2011 Jan 11
1
glm specification where response is a 2col matrix
Hi,
when I apply a glm() model in two ways,
first with the response in a two column matrix specification with
successes and failures
y <- matrix(c(
5, 1,
3, 3,
2, 2,
0, 4), ncol=2, byrow=TRUE)
X <- data.frame(x1 = factor(c(1,1,0,0)),
x2 = factor(c(0,1,0,1)))
glm(y ~ x1 + x2, data = X, family="binomial")
second with a model matrix that
2012 Dec 27
3
Retrieve indexes of the "first occurrence of numbers" in an effective manner
Hi,
That sounds simple but I cannot think of a really fast way of getting
the following:
c(1,1,2,2,3,3,4,4) would give c(1,3,5,7)
i.e., a function that returns the indexes of the first occurrences of numbers.
Note that numbers may have any order e.g., c(3,4,1,2,1,1,2,3,5), can
be very large, and the vectors are also very large (which prohibits
any loop).
The best I could think of is:
tmp =
2011 Feb 28
3
nls not solving
I am running the following nls equation. I tried it with data that excel was
fitting and got the error:
singular gradient matrix at initial parameter estimates
I thought it was due to a low number of points (6), but when I create a
dataset, I get the same problem. If I remove the parameter "a," then it can
find a solution. Does anyone know what I can do to fit this model?