Displaying 20 results from an estimated 2000 matches similar to: "How to pick colums from a ragged array?"
2012 Jun 22
3
removing NA from a data frame
Removing rows with NAs, using na.omit(), doesn't seem to be working for me.
Dataset:
> str ( ex10s )
'data.frame': 2189576 obs. of 5 variables:
$ LOPNR : int 58 58 58 58 64 64 64 64 64 64 ...
$ DIAGNOS: Factor w/ 173 levels "F20","F200","F2000",..: 128 128 128 128 105 105 105 160 105 105 ...
$ X_DATE : int 20060821 20061207 20080102 20090904
2002 Jan 18
1
RE: z-scores for different factor levels
Hi Stuart,
I often use this small function
standardize <- function(x) ( x - mean(x, na.rm=T) ) / sqrt(var(x,
na.rm=T))
to standardize variables.
You should be able to use this to do what you want by splitting the data
frame into sections based on the factor level, using standardize() to create
a new variable in each section, then paste the data frame back together.
Something like:
#
2002 Jan 08
3
Finding functions in uninstalled libraries
(Many thanks to David Barron & Jonathan Baron for pointing me to 'recode' in
the 'car' package).
I think I've been told this before, but how do I search for a
function/keyword in libraries I don't yet have installed?
(ie. on the CRAN site I tried the search engines with "recode" etc., but
didn't pick up the car package this way)
Stuart
Dr Stuart Leask
2012 Jul 18
3
'symbols' not plotting correct circle radii
Hi there.
I have been plotting some circles using 'symbols', with radii representing my data, but the radii looked incorrect.
It seems to happen with a single circle too:
Symbols ( 0, 0, circles = 40, xlim = c(-40, 40), ylim= c(-40, 40))
If I put a ruler up to my monitor (technology!) to compare the radius with the axes, the circle isn't radius 40; it is closer to 15...
I
2003 May 23
1
Fw: write.table only writes the first 256 variables/columns
Thanks. I was "believing" an Excel import of the file - as you say, a
re-import
into R still has 333 columns. I shall look elsewhere for the cause of the
mysterious truncation.
Stuart
> ----- Original Message -----
> From: "Thomas Lumley" <tlumley at u.washington.edu>
> To: "Stuart Leask" <stuart.leask at nottingham.ac.uk>
> Cc:
2010 Apr 30
2
RBloomberg for 2.11 ?
Dear R Users,
Is there a version of the Windows binary for RBloomberg that works with R 2.11 ?
Thanks in advance,
Tolga
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at
2001 Sep 18
4
help in a separate window under linux
Hi there.
R v1.3.0, Slackware linux 7.1 or Windows 98SE, PII 266, 64Mb RAM.
I notice that under windows, R puts help info (ie. the response to
'?<function>') into a new window, whereas under linux, it puts it into the
main console window. I find the former much more helpful when checking a
function's syntax.
Is there a simple way of configuring R under linux to put its help
2001 Sep 21
4
How to change the levels of a variable???
Hi,
I have a simple question.
I have a variable with 3 levels.
Variable
A A A A A A
B B B B B B
C C C C C C
I need to make a new vector renaming de levels B and C for D.
NewVariable
A A A A A A
D D D D D D
D D D D D D
I dont find how to make it in manuals or in this list.
Can anyone help-me???
Thank you
Ronaldo
--
Agnes' Law:
Almost everything in life is easier to get into than out of.
2011 Oct 18
3
Database custom formatter
I am trying to write a custom formatter to update a database record based on
example results. Having a lot of trouble, so I thought to ask if anyone has
a custom formatter that writes results to a database or outputs results in
JSON or some other programmatic format. A working example will go a long way
in helping me work thru my own use case.
Thanks
-------------- next part --------------
An
2002 Jan 09
1
value labels from read.spss()?
>From owner-r-help at stat.math.ethz.ch Wed Jan 9 10:08:44 2002
>
>Does anyone know how to access/list the value labels stored in a SPSS .sav
>file?
>At the moment I can read in variables using read.spss() (foreign package),
>but have to power up SPSS to check value labels.
>
>Stuart
There may be a solution to this in R, and I would love to hear
it, but I was just faced
2006 Nov 24
2
Diebold Mariano Test
Dear List
Has anyone used R to distnguish between alternative forecasting models? In particular
is the Diebold Mariano test available for use within R.
Any assistance would be greatly appreciated.
Graham Leask
Lecturer in Strategy
Economics & Strategy Group
Aston University
Aston Triangle
Birmingham
B4 7ET
Tel: 0121 204 3150
E Mail: g.leask at aston.ac.uk
2007 Feb 09
2
RE gap statistic in cluster analysis
Has anyone implemented Tibrishani's gap statistic in R or S plus? If so I would greatly appreciate the relevant script file.
Any help will be much appreciated
Kind regards
Dr Graham Leask
Economics and Strategy Group
Aston Business School
Aston University
Aston Triangle
Birmingham
B4 7ET
Tel: Direct line 0121 204 3150
email g.leask@aston.ac.uk
[[alternative HTML version deleted]]
2001 Mar 10
1
Bug in qchisq?
Hello developers and users:
My system fails (the computer freezes) when I use the ncp parameter,
with the lower.tail=FALSE option in the qchisq function.
qchisq(0.025,31,ncp=1,lower.tail=FALSE)
Thank you very much for your help.
Kenneth Cabrera
Universidad Nacional de Colombia
ICNE
Sede Medellin
krcabrer at perseus.unalmed.edu.co
PS
I am using:
$platform "i386-pc-mingw32"
2002 May 03
2
an info on 3d representation
Dear list,
sorry to waste your time. I downloaded R and I like it very much.
However, my main interest is in plotting 3D graphics form imported data
(points and lines in a 3d space). I imported data in a very elegant way
but I wasn't able to find in R something similar to the simple "splot"
function of WGNUplot (I don't need persp, image, contour: my values are
not
2003 Feb 19
4
Help in separate window under X11
Dear R users,
Is there the possibitily in R under X11 to get (after typing help(...)
command) separate help window, as it is in Windows version?
Best wishes,
=================================
Dr. Alexey B. Shipunov
Section of Molecular Systematics
Jodrell Laboratory
Royal Botanic Gardens, Kew,
Richmond, Surrey, TW9 3DS, U.K.
e-mail: a.shipunov at rbgkew.org.uk
2002 Jan 06
2
Passing names of variables to functions
Hi,
I am still new to R and have a programming question. I have created a
small function which takes a parameter. In the function I want to be able
to refer to the names of the variables sent to the function (specifically
I want to be able to use the name of the variable given to the function in
an output table). For example, in the following (fictional) function I
want some way of printing
2006 Jul 30
3
main= bquote(paste("Results for ", beta, "3", ==.(b1)))) doesn't work.
Hi,
I need to plot the beta as the symbol, followed by the index 3 as the title of a graph.
This code works> main= bquote(paste("Results for ", beta ==.(b1))
but I also need the index 3.
I tried (simplified):
>plot(x,y, main= bquote(paste("Results for ", beta, "3", ==.(b1))))
and a few other versions, but I can not get it to run properly.
Any help would
2006 May 26
4
stopping effects, help me again please
Hi * and thanks for you responses
some body help me stop effect, just last effect.
Thanks! to somebody help me with:
Pulsator = Class.create();
Pulsator.prototype = {initialize: function(element)
{
this.stopped = false;
new Effect.Pulsate(element, { afterFinish: this.action.bind(this) });
},action: function(element){if(!this.stopped) new Effect.Pulsate(element,
{ afterFinish:
2011 Oct 16
2
question: ragged array
Hello,
I have a big problem which I’m just not able to solve.
I created the following mean value from the following dataset structure:
Id |value
1 | 2
1 | 3
1 | 4
2 | 2
2 | 1
3 | 5
4 | 3
etc.|etc.
with the command:
mean_rating <- tapply(ratok$value, ratok$project_id , mean,simplify = FALSE)
this gives me a ragged array:
> mean_rating [1]
$`14`
2011 Dec 20
1
Convert ragged list to structured matrix efficiently
Hi All,
I'm wanting to convert a ragged list of values into a structured matrix for
further analysis later on, i have a solution to this problem (below) but
i'm dealing with datasets upto 1GB in size, (i have 24GB of memory so can
load it) but it takes a LONG time to run the code on a large dataset. I
was wondering if anyone had any tips or tricks that may make this run
faster?
Below is