Displaying 20 results from an estimated 30000 matches similar to: "Frame from long to wide format"
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All,
I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order.
My data have a variable called "RowNo" that functions almost like a
2008 Feb 07
5
Row percentages for a table object
I an stumbling on something that is probably very simple, but I cannot
see the solution. I have an object generated by the table () function
and want to recompute this table so each cell represents the
percentage of the corresponding row sum.
Of course a dedicated function can be written (which I have done),
containing the necessary loops etc., but there should be a simpler
way. I'd
2007 Jan 17
2
Repeated measures
I am having a hard time understanding how to perform a "repeated
measures" type of ANOVA with R. When reading the document found here:
http://cran.r-project.org/doc/contrib/Lemon-kickstart/kr_repms.html
I find that there is a reference to a function make.rm () that is
supposed to rearrange a "one row per person" type of frame to a "one
row per observation" type
2006 Feb 09
11
Tranferring R results to word prosessors
I have just started looking at R, and are getting more and more irritated
at myself for not having done that before.
However, one of the things I have not found in the documentation is some
way of preparing output from R for convenient formatting into something
like MS Word. An example: If you use summary(lm(....)) you get nice
output. However, if you try to paste that output into the word
2017 Nov 07
5
Missing information in source()
Dear R-help,
I am running a Mac under Sierra, with R version 3.4.2 and RStudio 1.1.383. When running head () or tail () on an object in a script using source (<script name>) nothing appears in the output file, but if I use these commands in the normal R window the normal output appears.
What am I doing wrong?
Tom Backer Johnsen
University of Bergen
Norway
2008 Oct 24
18
Transferring results from R to MS Word
R-users
At the moment I am teaching a course on the use of R for data analysis.
Part of course requirements involves the transfer of results from R to
something that resembles the APA (American Psychological Associations)
type tables to MS Word. Until now I have used the HTML function in the
R2HTML library, with a call like this:
HTML(summary(model1), file("clipboard",
2006 Jun 26
2
reshaping data.frame question
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear R-helpers,
my data.frame is of the form
x <- data.frame( f=gl(4,3), X=rep(0:2,4), p=c(.1,.2,.3))
x
f X p
1 1 0 0.1
2 1 1 0.2
3 1 2 0.3
4 2 0 0.1
5 2 1 0.2
6 2 2 0.3
7 3 0 0.1
8 3 1 0.2
9 3 2 0.3
10 4 0 0.1
11 4 1 0.2
12 4 2 0.3
which tabulates some values p(X) for several factors f.
Now I want to put it in "wide"
2009 Nov 15
1
Help with unstack() function
Hi Everyone,
I am trying to understand the unstack() function but after struggling for
two days, I have given up. More specifically, I am trying the exercises at
the end of Chapter 1 of Data Analysis and Graphics Using R by Maindonald
and Braun, 2nd ed. Exercise 18 (p. 41) asks to unstack the Rabbit data frame
from the MASS package to get a certain data frame that is shown in the
exercise.
2007 Dec 04
6
Is R portable?
Recently I came across an interesting web site:
http://portableapps.com/. The idea is simple, this is software that
is possible to install and run on some type of USB memory, a stick or
one of these hard disks. I can think of a number of situations where
this could be handy. In addition memory sticks are getting cheaper
and more powerful by the day.
So: Is it possible to run R off one of
2007 Nov 02
4
Permutation test, grouped data
I am perfectly aware that this question is not an R question, at least
not yet, but I have not succeeded in finding what I want in other
ways, so ...
What I am looking for are two algorithms, preferabley in Pascal, but
other languages may do. For (a) systematic (complete) permutations
for grouped data with unequal group sizes, and (b) random permutations
for the same kind of data. I know
2008 May 19
1
reshape a wide data frame from wide to a long format with metadata columns
Hello R users and developers,
I have a general question about reshaping a wide data frame using the
"reshape" command. I have a data frame consisting of 108 columns that
I would like to convert to a long table and remove the metadata
(embedded in the column names of the wide table) to new metadata
columns in the long format.
#example data frame. NOTE column names contain metadata::
2006 Aug 22
5
Authoring a book
Me and some colleagues are planning to write a textbook together
("Statistics using R") where the target audience for the book is
psychologists and students of psychology.
We thought that it might be a good idea to use a Wiki when writing the
text. Is that a good idea? Does anybody have any experience in that
direction? What alternatives are there?
The tool (Wiki) would have to be
2006 Apr 19
9
I am surprised (and a little irritated)
I have started with using R on Windows, and I am really happy about
the system. Now, one of my other ambitions is to learn how to use
Linux, so yesterday I downloaded OpenSuse and installed that. The
next problem was to try to use R with Linux. And there I met the
wall. I've understood that RPM's are somewhat like installing
programs on Windows, so that was downloaded and started
2011 Mar 12
1
Column order in stacking/unstacking
Dear R users,
I'm having some problems with the stack() and unstack() functions, and
wondered if you could help.
I have a large data frame (400 rows x 2000 columns), which I need to reduce
to a single column of values (and therefore 800000 rows), so that I can use
it in other operations (e.g., generating predictions from a GLM object).
However, the problem I'm having can be reproduced
2009 Mar 31
2
Programming objects in R
I am planning a project where an object-oriented approach would be
appropriate, and for a number of reasons I would prefer using either
Python or R. My problem at the moment is to find out how to do OO
programming in R. Are there any introductory texts anywhere ?
Tom
--
+----------------------------------------------------------------+
| Tom Backer Johnsen, Psychometrics Unit, Faculty of
2006 Oct 18
7
Latex editor recommendations
This question is not oriented towards R, but is posted here because I
have the impression that there are at least some Latex users among the
contributors. The question is: What editors for Latex are to be
recommended? I have located one:
http://www.latexeditor.org/
What other alternatives are there? I am (for the most part) using
Windows XP.
Tom
2008 Nov 07
5
Agent-based social simulation and R
Do anyone know anything about the use of R for agent-based social
simulation? It should be possible, and would be convenient for the
simple reason that there are several nice packages containing useful
stuff for SNA (Social Network Analysis). Information about packages,
web sites, experienced persons in the field, etc. would be very welcome.
Tom
2009 Apr 07
2
Running an R script from Delphi 7
Gentlepersons:
A long time ago I used to be able to start R (version 2.6.1) from a
Delphi 7 program and run a script by using a procedure like the following:
function StartRAndWait (CommandLine : string) : Boolean;
var
Proc_info: TProcessInformation;
Startinfo: TStartupInfo;
ExitCode: longword;
CreateOK : Boolean;
begin
Result := False;
{ Initialize the structures }
2017 Nov 07
0
Missing information in source()
Hello,
Try
print(head(...))
Hope this helps,
Rui Barradas
Em 07-11-2017 20:01, Tom Backer Johnsen escreveu:
> Dear R-help,
>
> I am running a Mac under Sierra, with R version 3.4.2 and RStudio 1.1.383. When running head () or tail () on an object in a script using source (<script name>) nothing appears in the output file, but if I use these commands in the normal R window the
2008 Feb 15
1
Latent class analysis
Which package(s) contain something on latent class analysis?
Tom
--
+----------------------------------------------------------------+
| Tom Backer Johnsen, Psychometrics Unit, Faculty of Psychology |
| University of Bergen, Christies gt. 12, N-5015 Bergen, NORWAY |
| Tel : +47-5558-9185 Fax : +47-5558-9879 |
| Email : backer at psych.uib.no URL :