Displaying 20 results from an estimated 2000 matches similar to: "Reshape"
2012 Jun 20
2
reshape
Hello, helpeRs,
I am attempting to reshape (either base R or package reshape) multiple .csv
spreadsheets from a very unfortunate wide format to long format. ?Each spreadsheet
looks something like this, after being read in to R:
toy <- data.frame(year = rep(2007:2008,each = 20), month = rep(1:5,each = 4, length = 40),
day = rep(1:2,each = 2,length = 40), hhmm = rep(1100:1101,length = 40),
2006 Dec 20
1
Reformat meteorological data
Dear HelpeRs:
I have a data set in the following format,
which will be familiar to those of you working
with NCDC climate data.
Example:
Year <- rep(1:3, each = 3)
Year <- c(Year,Year)
ID <- rep(1:2, each = 9)
Jan <- runif(18, min = 0, max = 20)
Feb <- runif(18, min = 0, max = 20)
Mar <- runif(18, min = 0, max = 20)
var <- gl(3,1,18,label =
2010 Mar 29
2
Reshaping a data frame with a series of factors and 23 repeated measures
I have a data frame that I created using read.table on a csv spreadsheet.
The data look like the following:
Steer.ID stocker.trt Finish.trt Date Days Wt ......
Steer.Id, stocker.trt, Finish.trt are factors------ Date, Days, Wt are data
that are repeated 23 times (wide format).
I want to reshape the data such that I have the correct Steer.ID,
stocker.trt, Finish.trt identifying all of
2010 Aug 12
4
conditional selection of dataframe rows
Dear helpeRs,
I have a dataframe (14947 x 27) containing measurements collected
every 5 seconds at several different sampling locations. If one
measurement at a given location is less than zero on a given day, I
would like to delete all measurements from that location on that day.
Here is a toy example:
toy <- data.frame(CH = rep(3:5,3), DAY = c(rep(4,5), rep(5,4)),
SLOPE =
2006 Dec 08
2
dyn.load and function calls without 'PACKAGE' argument
I'm writing a package that interfaces to the FAME database, via a
library of compiled C routines accessible through a Linux .so file. My
.onLoad() function loads the .so like this:
dyn.load("/opt/fame/timeiq/lib/linux_x86/libjchli.so", local = F)
and after that I also load my own fame.so via
library.dynam("fame", package = "fame")
The code in fame.so uses
2007 Jul 12
5
In creating a Windows binary package (zip), how do I make the installation configurable
I would like to create a binary package for Windows which when
installed will give the user an option of whether to install
one version or another.
Here is the problem, I have a package 'FAME' that can run
in two different modes on Windows. An old mode that uses
R to connect to a remote linux machine and a new way that
uses a locally installed database.
I would allow this decision to be
2007 Feb 02
2
Help with OS X (BSD) ps command
My fame package has a function that checks to see if a FAME SERVER process is
already running. On Linux, I can do this in one of two ways:
pid <- Sys.getpid()
user <- Sys.info()["user"]
cmd <- paste("pgrep -fU", user, "-P", pid, "'FAME SERVER'")
fameRunning <- as.logical(length(system(cmd, intern = T)))
or I can use
cmd
2009 Jan 20
1
Problem with FAME
Dear All,
I wonder whether anyone has an experience with FAME package written by Jeff Hallman. All my attempts to send him the following problem report did not succeed (the mail system says that my e-mail could not be delivered), so I turn for help to this list.
I tried to use your FAME package written for R, but somehow I cannot get it working. I am using Windows XP and the newest R
2007 Jun 05
1
Can configure.ac detect 64 bit R?
My fame package has to link to the libchli.so that comes with FAME.
However, FAME is now supplying both 32 and 64 bit versions of the
library. The 32-bit version is $FAME/hli/libchli.so while the 64-bit
version is $FAME/hli/64/libchli.so. To set the right flags, it seems
that I need to know, from within configure.ac, whether the R
installation is 32 bit or 64 bit. Is there a way to detect this?
2008 Nov 17
2
Cannot quit R - fame package issue?
Hello list member:
I've recently had a problem in that I'm unable to quit an R Session. I
noticed this after the update to 2.8.0, but I believe I also noticed it
on another machine, in the previous version. It occurs on both linux
and Mac platforms. It only occurs when I start R in some particular
workspaces that have alot of objects in them; it does not occur if I
start R in an
2006 Aug 24
1
how to constrast with factorial experiment
Hello, R users,
I have two factors (treat, section) anova design experiment where
there are 3 replicates. The objective of the experiment is to test if
there is significant difference of yield between top (section 9 to 11)
and bottom (section 9 to 11) of the fruit tree under treatment. I
found that there are interaction between two factors. I wonder if I
can contrast means from levels of
2011 May 03
3
ANOVA 1 too few degrees of freedom
I'm running an ANOVA on some data for respiration in a forest. I am having a
problem with my degrees of freedom. For one of my variables I get one fewer
degrees of freedom than I should.
I have 12 plots and I therefore expected 11 degrees of freedom, but instead
I got 10.
Any ideas?
I have some code and output below:
> class(Combined.Plot)
[1] "character"
>
2011 Mar 07
5
Parsing question, partly comma separated partly underscore separated string
Dear R-list,
I have a partly comma separated partly underscore separated string that I am trying to parse into R.
Furthermore I have a bunch of them, and they are quite long. I have now spent most of my Sunday trying to figure this out and thought I would try the list to see if someone here would be able to get me started.
My data structure looks like this,
(in a example.txt file)
Subject
2007 Mar 14
1
How to transform matrices to ANOVA input datasets?
Hello, R experts,
I have a list called dataHP which has 30 elements (m1, m2, ..., m30).
Each element is a 7x6 matrix holding yield data from two factors
experimental design, with treatment in column, position in row. For
instance, the element 20 is:
dataHP[[20]]
col1 col2 col3 trt1 trt2 trt3
[1,] 22.0 20.3 29.7 63.3 78.5 76.4
[2,]
2008 Oct 15
2
Network meta-analysis, varConstPower in nlme
Dear Thomas Lumley, and R-help list members,
I have read your article "Network meta-analysis for indirect treatment
comparisons" (Statist Med, 2002) with great interest. I found it very
helpful that you included the R code to replicate your analysis;
however, I have had a problem replicating your example and wondered if
you are able to give me a hint. When I use the code from the
2010 Dec 01
2
Lattice dotplots
Dear,
I have a dataset with 4 subjects (see ID in example), and 4 treatment (see
TRT in example) which are tested on 2 locations and in 3 blocs. By using
Lattice dotplot, I made a graph that shows the raw data per location and
per bloc. In that graph, I would like to have a reference line per bloc
that refers to the first treatment (T1). However, I can not find how to do
that.
I can make
2006 Mar 03
1
Help with lme and correlated residuals
Dear R - Users
I have some problems fitting a linear mixed effects model using the lme function (nlme library). A sample data is as shown at the bottom of this mail. I fit my linear mixed model
using the following R code:
bmr <-lme (outcome~ -1 + as.factor(endpoint)+ as.factor(endpoint):trt, data=datt,
random=~-1 + as.factor(endpoint) + as.factor(endpoint):trt|as.factor(Trial),
2008 Jun 04
1
"& not meaningful for factors"
I am trying to define groupings from levels of factor variables and this the warning message that R give
"& not meaningful for factors".
The nature of my task is this. I have a variable stage which has the levels (1B, 2A, 2B) - these are the AJCC TNM stages of cancer, and another variable diameter with factor levels ("=< 4", "4 - 6.5, > 6.5; limit values are
2012 Jan 27
1
Confused with Student's sleep data description
I am confused whether Student's sleep data "show the effect of two
soporific drugs" or Control against Treatment (one drug). The reason
is the next:
> require(stats)
> data(sleep)
> attach(sleep)
> extra[group==1]
numeric(0)
> group
[1] Ctl Ctl Ctl Ctl Ctl Ctl Ctl Ctl Ctl Ctl Trt Trt Trt Trt Trt Trt Trt Trt Trt
[20] Trt
Levels: Ctl Trt
> sleep$group
[1] 1 1 1 1 1
2013 Sep 13
1
Creating dummy vars with contrasts - why does the returned identity matrix contain all levels (and not n-1 levels) ?
Hello,
I have a problem with creating an identity matrix for glmnet by using the
contrasts function.
I have a factor with 4 levels.
When I create dummy variables I think there should be n-1 variables (in this
case 3) - so that the contrasts would be against the baseline level.
This is also what is written in the help file for 'contrasts'.
The problem is that the function