Displaying 20 results from an estimated 8000 matches similar to: "regression on data subsets in datafile"
2007 Jul 18
1
passing a parameter to a file from command line
Hi,
I have a file fileFoo.R, say that contains these two lines, invoking
function foo that is specified in "foo_details.R":
source("foo_details.R")
foo(parameter1)
I want to specify and pass parameter1 in my command line when invoking R
in linux: R --no-save <fileFoo.R.
How can I do that?
And how can I retrieve the value of parameter1 in my fileFoo.R function
2010 Jan 29
3
Applying a function on each columns of a matrix
Hello everyone, I have the following matrix
[,1] [,2] [,3] [,4]
[1,] 0.002809706 0.0063856960 0.0063856960 0.011749681
[2,] 0.004893124 0.0023118418 -0.0005122951 -0.014646465
[3,] 0.003547897 0.0063355297 0.0030410542 0.011403953
[4,] 0.004838299 -0.0040383645 -0.0090406831 -0.011027569
[5,] 0.035648755 0.0334815590 0.0380977404
2008 Nov 20
2
Elegant way to transform dataframe?
Hello,
I have a dataframe with columns like:
parameter1 parameter2 metricname value
and I'd like to transform it into a dataframe with columns:
parameter1 parameter2 metric1 metric2 metric3
where the values for each metric would be in the appropriate column. There are often multiple values for a given (parameter1, parameter2, metricname) triple. In this case, I want to use the
2000 Sep 20
1
'fixing' list components
I have a list x (say) that will contain many inputs to and outputs a model.
x$input1 <- assign.input1(parameter1, parameter2)
is one way to assign input1, but it would be neater to be able to do
assign.input1(x, parameter1, parameter2)
Is this a good idea? If so, what is a good way to do it?
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing
2011 Jul 21
6
Lattice: place ticks only on y-axis
I am using lattice for a bar plot, having a little trouble removing ticks,
tick labels from x-axis, but keeping them on the y-axis. I looked around
quite a bit (http://tolstoy.newcastle.edu.au/R/e7/help/09/06/1733.html, help
pages, etc), tried variations of "scales = list(alternating = c(0,0)",
"scales = list(alternating = c(0,0), tck = c(0,0))" and others, couldn't
quite
2012 Dec 14
2
Manipulation of longitudinal data by row
I have a dataset of the form below, consisting of one unique ID per
row, followed by a series of visit dates. At each visit there are
values for 3 dichotomous variables. Of the 8 different possible
combinations of the three variables, 4 are "abnormal" and the
remaining 4 are "normal". Everyone starts out abnormal, and then
either continues to be abnormal at subsequent visits,
2007 Mar 27
1
basic handling of data.frame
Hello,
I'm new to R but wan't to use it to compute the statistics of my medical study.
The study includes several parameters for a number of patients. Each
parameter was assessed by a number of readers, once with a special
condition, once without.
Now I have a data.frame with colums like:
PatientID, ReaderID, SpecialCond(yes/no), Parameter1, Parameter2.....
the rows are not sorted, and
2011 Jul 11
3
Stacked bar plot of frequency vs time
Hi All,
New to R, but committed. I looked in a number of places but can't figure out
my current problem. I have date of the type:
Time Type1 Type2 Type3
1 .50 .25 .25
4 .55 .25 .20
5 .65 .20 .15
etc
which describe the frequency of types 1, 2 and 3 (adding up to 100%) over
time. I would like to create a stacked bar chart showing these
2013 Dec 02
1
Class parameter flexibility with ENC, hiera or both
Dear puppetteers,
I am having a philosophical question about parametrized classes.
When building modules, one wants to be as flexible as possible, to try
to target as many puppet flavors as possible. This is our target:
- Foreman users, using foreman as an ENC with smart variables (or
potentially any other ENC, but I would say this is the most widespread one).
- Pure Puppet''s site.pp
2006 Oct 05
2
A statement over multiple lines (i.e. the ... feature in Matlab)
Hello again list,
I thought I'd start a new thread, seeing as it's completely different
from my previous question. Some functions I have written require many
parameters, and so do not fit nicely into an 80 column width display.
This is usually avoided, by spreading that particular statement over
a few lines. This is something that I do in Matlab with the following:
myFunc(
2002 Nov 09
2
Nonlinear regression and categories
Hi there:
I'm trying to run a large number of nonlinear regressions on a time
series dataset, where the data will be formatted something to the effect of:
ObservationID,time,dependentvar
I'll have a number of time and dependentvars for each observation, and I
want to apply a nonlinear regression to one ObservationID at a time, and I
want to have a dataset that is the parameter
2011 Jun 07
1
extract data features from subsets
I have a large dataset similar to this:
ID time result
A 1 5
A 2 2
A 3 1
A 4 1
A 5 1
A 6 2
A 7 3
A 8 4
B 1 3
B 2 2
B 3 4
B 4 6
B 5 8
I need to extract a number of features for each individual in it (identified by "ID"). These are:
* The lowest result (the nadir)
* The time of the nadir - but if the nadir level is present at >1 time point, I need the minimum and maximum time of nadir
2007 Nov 01
1
structure data
Hello,
I have a quite simple question, I guess. I have a data frame and I would like
to process the data in several ways.
The processing is dependent on grouping (factors) and the parameter itself.
Meaning for parameter1 in the df, I would like to calculate the mean and sd
when grouping by factor1. But parameter2 might be different. I thought of a
structure like this:
group1
param1
2010 Jan 26
3
Apply a function on an array with the parameter as an array
Hello R buddies, I want to apply a function on an array but for each element
of the array I want to use a different parameter, So here is how I tried to
enter the function:
apply(as.matrix(X),2, function, parameter1 = arrayOfParameter)
I put X as a matrix because it was initially an element of a list. It
returns me an array with the same length as X but with values that I don't
even
2011 Oct 24
1
[LLVMdev] Function pointer parameters in PTX backend
Hi everybody,
I am trying to produce ptx code starting from OpenCL C.
I am experiencing a problem concerning pointer parameters.
Here follows an example:
kernel void function(__global float* parameter1) {}
NVIDIA NVCC Compiler:
.entry function(
.param .u32 *.ptr* .global .align 4 function_param_0
)
{
ret;
}
CLANG + LLVM PTX backend
// (skipping builtin functions definitions)
.entry
2010 Feb 03
1
Calculating subsets "on the fly" with ddply
Hi,
[I sent this to the plyr mailing list (late) last night, but it seems
to be lost in the moderation queue, so here's a shot to the broadeR
community]
Apologies in advance for being more verbose than necessary, but I'm
not even sure how to ask this question in the context of plyr, so ...
here goes.
As meaningless as this might be to do with the `iris` data, the spirit
of it is what
2011 Aug 17
3
How to apply a function to subsets of a data frame *and* obtain a data frame again?
Dear all,
First, let's create some data to play around:
set.seed(1)
(df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10),
Value=c(rexp(10, 1), rexp(10, 4), rexp(10, 10)))[sample(1:30,30),])
## Now we need the empirical distribution function:
edf <- function(x) ecdf(x)(x) # empirical distribution function evaluated at x
##
2006 Oct 08
9
Organizing tests and mocha expectations
I''m simultaneously getting into using Mocha and RSpec-style tests
(courtesy of the simply_bdd plugin) and I''m struggling with some
issues while trying to organize my specs/test. Here''s a code example
illustrating the problem:
context "update cliient invalid data" do
include ClientsControllerSpecHelper
specify "should render edit form" do
2010 May 17
3
Create counter variable for subsets without a loop
Hi all,
I am looking to create a rank variable based on a continuous variable
for subsets of the data. For example, for an R integrated data set
about US states this is how a loop could create what I want:
### Example with loop
data <- cbind(state.region,as.data.frame(state.x77))[,1:2] #
choosing a subset of the data
data <- data[order(data$state.region, 1/data$Population),] #
2005 Feb 01
1
Error in load(dataFile, myEnv)
Dear all,
I just found that some of the packages are not able to load any more,
after I installed R2.0.1 in my Mac, it even affects my old R1.8
installs.
It gives me errors when I load packages that contains "myEnv" settings.
such as: RMySQL, DBI, Rggobi, etc. But others that does not require
"myENV" is all right, like tcltk that only calls the c functions.
The errors