Displaying 20 results from an estimated 12000 matches similar to: "Correctly Setting New Seed"
2012 Sep 15
2
How to convert the output of tapply() so that it has the same order as the input?
Hi,
I try to apply a function to subsets of a data.frame. tapply() does the job, but
the as output, I am looking for a vector (not an array/matrix) ordered in the
same way as the original data, so I can simply cbind the result to the original
data.frame. Below is a minimal example.
I know that there are packages that can do these things easier, but I'm looking
for a fast solution not
2010 Aug 03
3
how to do a IF ELSE in a matrix format
Hey, Rers
I am new to R and this question may has been asked many times or a very old
one.?I have checked
the archive but found nothing (maybe I used?the wrong key words).?any advise is
appreciated
the question is:
I try to replace a col vector with some other values, see
edu<-matrix(0,1000,2)
edu1<-runif(1000,0,1)
edu[,1]<-edu1
the colum ?vector?edu[,1]? would?have value
2009 Mar 25
3
Converting a Matrix to a Vector
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
2008 Sep 05
5
Lowest k values of list
Hi @ all,
how do I get the largest or lowest k values of list? It must similar to the min() / max() function, but I just don't get it.
Best wishes,
Markus
2012 Mar 30
3
pooling in MICE
Hi everyone,
Does anyone here has experience using MICE to impute missing value? I am
having problem to pool the imputed dataset for a MANOVA test, could you
give me some advice please?
Here is my code:
> library(mice)
>
2004 Nov 29
2
[BASIC] Solution of creating a sequence of object names
Dear R-users,
I state that this is for beginners, so you may ignore
this in order not to be irritated.
By the way, "patience" is another important thing,
together with "kindness", we should keep in mind when
we teach students and our own children as Jim Lemon
pointed out well in the context of the Socratic
method. You may know that being kind does not mean
giving
2009 Jan 16
2
dummy ethernet interfaces
I have a 32bit(PAE) CentOS5 machine running (stock CentOS) Xen. I've
been using the kernel dummy ethernet driver to create interfaces on the
host machine so that I can create internal networks for the guests and
host to communicate with each other. The only issue I have with this is
that the interface is not >=100MB, but is 10MB.
Is there a way I can increase the speed of these
2004 Sep 20
2
Getting the real names of variables within functions
Greetings.
These days I find myself writing a lot of functions to handle routine
things. One of these is a function to create a scatterplot of
variables and draw a lowessed line so I can get some idea if there's
any relationship between them.
lowessed.plot <- function(x, y)
{ plot(x, y)
lines(lowess(x, y))
}
However, there's a slight problem: the plot axes come out labeled
2004 Jul 20
5
Precision in R
Greetings.
I'm trying to recreate in R some regression models I've done in SAS,
but I'm not getting the same results. My advisor suspects this may be
due to differences in precision between R and SAS. Does anyone know
where I can find specifications for R's type double? (It doesn't seem
to be in the R Language Definition.) Thanks in advance for any help
anyone can
2008 Sep 09
1
how to split a data framed with sequences
Hi all,
Given a data frame:
my.df <- data.frame(a = c(1:5, 1:10, 1:20), b = runif(35))
I want to split it by "a" such that I end up with a list containing 3
components i.e. the first containing a = 1 to 5, the second a = 1 to 10 etc.
In other words, sets of sequences of a.
I can't seem to find the right form using the split function - can you help?
Much appreciated.
David
2004 Nov 03
4
Newbie question: plotting regression models
Greetings.
Is there any way to get R to take a regression model object and draw a
plot of the regression function? How about overlaying that plot over a
scatterplot of the actual data? Thanks in advance for any help anyone
can provide.
Aaron
-----
Aaron Solomon?? (??ben Saul Joseph??) ??Adelman
E-mail??: ??adelmaas at musc.edu
Web site??: ??http??://??people.musc.edu??/??~adelmaas??/??
2013 Sep 10
3
to delete lines by means of a vector
Hi
I would like to eliminate a large number of lines of the dataframe df1
The lines to delete are given here by the values of Mat (ex : 2,4,7,10).
but I have a large number (300) values of Mat
dput(df1)
structure(list(Mat = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3,
3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7,
7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10,
10, 11,
2006 Mar 30
1
Laptop freezes when trying to load R packages?
Hello
I am having an R related problem and can't seem to fix it by looking at any of
the online documentation.
I have a laptop (using Windows XP home edition) and loaded R 2.2.1. I then
designated a mirror (USA-NC). But when I try to load a package, it freezes. I
have tried to close R, but it won't close; I end up having to restart the
laptop. I have no problems with any other
2006 Jul 04
1
Exporting tables to RTF?
Greetings.
Yesterday I managed to jury-rig a system to get a table out of R and
import it into Nisus Writer Express (a word processor for Mac OS X).
What I came up with is brittle, since it depends on an AppleScript
script which has to be in a specific location and on no one touching
the computer, since the AppleScript remotely controls Nisus Writer
Express rather blindly and will make
2008 Apr 21
1
[LLVMdev] newbie with pass registering Problem
Hi!!
This is my first time with llvm. I'm still learning and really need help.
I wrote only one Function Pass, which uses another Function Pass (blockNrs), and registered this:
RegisterPass<FunctionAnalysis> X("gasched", "Genom Scheduling Pass");
When I compile my sourcecode, everything was okay. But when I tried to test it, i got this error Message:
nicole at
2006 Dec 10
1
how to sort random numbers according to the sample ?
Dear R-users,
#### below is my code to randomized x three times.
> x=c(6,8,9,11)
> plan=NULL
> for(i in 1:3){
+ set.seed(i)
+ r<-runif(x)
+ plan=cbind(plan,r)
+ }
##### which gave the matrix
> plan
r r r
[1,] 0.2655087 0.1848823 0.1680415
[2,] 0.3721239 0.7023740 0.8075164
[3,] 0.5728534 0.5733263 0.3849424
[4,]
2007 Nov 22
5
Different networks between Dom0 and Guest?
Hi,
I''m running SLES10 SP1 with xen 3.0.4 and windows 2003 server as guest.
Is it possible to assign ips from different networks to Dom0 and Guest,
e. g. 172.27.10.1/24 for Dom0 and 172.27.15.1/24 for Guest?
I tried it, but I can''t reach the Guest.
If it''s possible, what should I have to configure?
Thanks!
Nicole
_______________________________________________
2012 Mar 07
3
pulling out 1 country and 1 wave
Hello.
I am trying to pull out one country from a time series of 5 waves. For example I need Norway from the 5th wave. This is new to me. Typically, I work with country specific surveys.
data = norway
I have attached a .tiff of the codebook showing the variable names for Norway and the wave. They appear to be Norway = v218 and wave = v15. But perhaps I am wrong and this is part of the
2013 Mar 28
4
bayesian HLM random effects
Hello, all.
I've been working on this for sometime and was almost at the end/ last chunk of code i would need.... When I received an error. Rather than go to bed and think about it in the morning, I messed with my data and now I am not getting anything. I was up until 4am trying to fix this.
Zip files of my data are attached (the data which ends in 'a' matches with wvsA and the
2009 Feb 19
2
error bars
Hello, I have a very simple data set i imported from excel including 96
averages in a column along with 96 standard errors associated with those
averages (calculated in excel). I plotted the 95 averages using r and I am
wondering if it is possible to plot the second column of standard errors
while applying error bars to each value so they represent the error
corresponding to each average?
thanks,