Displaying 20 results from an estimated 200 matches similar to: "function to create multiple matrices"
2010 Mar 16
1
nested looping functions and dataframes
Hey All,
So, I am confused how exactly to use nesting loop functions in R to spit out
data frames. I've managed to create a working function for my data set that
generates a data frame for a given set of Year i and Location j; but how
would I do it for all Years and Locations?
Here is my working function:
test<-function(i,j){
a<-x[which(x$Year==i & x$Location==j),]
2010 May 04
2
R for web browser
Hi Everyone,
Does anyone know of any projects for running an interactive R session within
a web browser?
I'm looking for something similar to the one on the Ruby website
(http://tryruby.org), except for R.
Thanks for your responses in advance!
Lanna
-----
Lanna Jin
lannajin at gmail.com
510-898-8525
--
View this message in context:
2010 May 04
7
How to replace all <NA> values in a data.frame with another ( not 0) value
I need to replace <NA> occurrences in multiple columns in a data.frame
with "000/000"
how do I achieve this?
Thanks
Nevil Amos
2010 May 03
8
Delete rows with duplicate field...
as a r noob i am having another problem:
i have a big dataframe where each row corresponds to one entry and each
column is a field...
for instance, i have the column ID and time and many more...
Id like to get a dataframe where all IDs are just included once (some users
with that ID might have several entries but Id like to kepp only one)..
when i use unique I only get a list of the levels (or
2009 Nov 06
1
using xyplot to plot frequencies
Hi all,
First off, thank you for the overwhelming response last time. I'm still
trying to figure out the syntax of R to plot some distributions of some
frequencies. I've managed to plot histograms from the data, but I would
like to clean it up using xyplot from library(lattice). Unfortunately
I cannot find a solution to my problem.
Given a dataframe "all2", with numerical
2009 Nov 05
3
performing operations on a dataframe
Hey all,
I feel like the solution to this problem should be relatively simple, but
for some reason I can't find answers or come up with my own solution.
Given the dataframe:
(SpA and SpB not important, want to look at distribution of cooccurance for
each year)
Year SpA SpB Coocc
2000 0
2000 2
2000 1
2001 8
2001 2
2001 0
2001 0
2002 1
2002 2
How can I apply different functions to
2011 Nov 07
2
adjusting levelplot color scale to data
Hi guys,
I have a matrix with values varying from approximately -0.7 to 0.33 that I
want to create a heatmap/levelplot with.
When I execute the levelplot function for my matrix, I end up getting colors
that are adjusted to the max and min rather than around 0. In other words,
ideally I would like to have a color ramp that goes from red (negative
number), to white (0), to blue (positive);
2012 Mar 29
1
Retrieving matrix column and row names by index value
Hi all,
So let's say I have a matrix, mdat and I only know the index number. How do
I retrieve the column and row names?
For example,
> mdat <- matrix(c(1,2,3, 11,12,13), nrow = 2, ncol=3, byrow=TRUE,
dimnames = list(c("row1", "row2"),
c("C.1", "C.2", "C.3")))
> mdat[4]
[1] 12
>
2010 Apr 30
3
short question about data frame manipulation
Dear group,
I am losing my mind with a simple question. Sorry if obvious, but I maybe
start to be confused after days and days of reading documentations.
Df :
df <-
structure(list(a = 1:3, b = 4:6, c = structure(c(1L, 1L, 1L), class =
"factor", .Label = "w")), .Names = c("a",
"b", "c"), row.names = c(NA, -3L), class =
2010 Sep 03
1
How to use lm() output for systemfit() 'Seemingly unrelated regression'
I am having problem using output of lm() function for further analysing using
systemfit package.
Basicaly, the problem s following - I generate several formulas using lm()
> fo1 <- lm(r98[,2] ~ f98[,1] + f98[,2] + ... + f98[,43])
> fo2 <- lm(r98[,1] ~ f98[,1] + f98[,2] + ... + f98[,43])
and than I want to estimate a general model using package systemfit.
> fitsur <-
2010 Jun 15
2
[LLVMdev] Question on X86 backend
Hi Micah,
> In X86InstrInfo.td for Call Instructions, it mentions that Uses for
> argument registers are added manually. Can someone point me to the
> location where they are added as the comment doesn't reference a
> where or how?
the register uses are added by the function
X86TargetLowering::LowerCall() during the DAG Lowering phase. This is
the relevant code segment:
// Add
2011 Jun 07
3
Logistic Regression
I am working on my thesis in which i have couple of independent variables
that are categorical in nature and the depndent variable is dichotomus.
Initially I run univariate analysis and added the variables with significant
p-values (p<0.25) in my full model.
I have three confusions. Firstly, I am looking for confounding variables by
using formula "(crude beta-cofficient - adjusted
2009 Oct 26
1
zeros keep dropping
Hello All!
I am trying to plot the frequency of species coocurrance.
If given a data set similar like this...(V1="species A", V2="species B",
V3="frequency of cooccurance")
> data
V1 V2 V3
1 A B 0
2 A C 2
3 A D 5
4 B C 0
5 B D 1
6 C D 0
> data1<-as.data.frame(lapply(data,function(x)(rep(x,data$V3))))
> as.data.frame(data1[-1])
>
2010 Feb 18
1
Graphics Question
Hello All,
I'm having some issues controlling graphics in R. I was wondering if anyone
may help me tackle this problem:
Given a data frame "X" with variables "Year", "Factor" (w/ n groups), and
"Freq"
How do I create a single graphic with the following plots aligned in a
vertical stack?
1. box plot in the fashion Freq~Year|Factor
2. box plot
2014 Jan 19
2
PCI Passthrough
I'm trying to pass-through my VGA card to a guest session.
I found: http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM - which is very frustrating because there's no date on the documentation. I suspect it's old. It does clearly say that you must have VT-d support for pci pass-through. It then goes on to say "Some work towards allowing this ["software
2016 Apr 19
5
Interquartile Range
That didn't work Jim!
Thanks anyway
On Mon, Apr 18, 2016 at 9:02 PM, Jim Lemon <drjimlemon at gmail.com> wrote:
> Hi Michael,
> At a guess, try this:
>
> iqr<-function(x) {
> return(paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-")
> }
>
> .col3_Range=iqr(datat$tenure)
>
> Jim
>
>
>
> On Tue, Apr 19, 2016 at
2016 Apr 19
2
Interquartile Range
Hi,
I am trying to show an interquartile range while grouping values using
the function ddply(). So my function call now is like
groupedAll <- ddply(data
,~groupColumn
,summarise
,col1_mean=mean(col1)
,col2_mode=Mode(col2) #Function I wrote for getting the
mode shown below
2010 May 05
0
R-help Digest, Vol 87, Issue 5
Unsubscribe
-----Original Message-----
From: r-help-request at r-project.org
Date: Wed, 05 May 2010 12:00:09
To: <r-help at r-project.org>
Subject: R-help Digest, Vol 87, Issue 5
Send R-help mailing list submissions to
r-help at r-project.org
To subscribe or unsubscribe via the World Wide Web, visit
https://stat.ethz.ch/mailman/listinfo/r-help
or, via email, send a message with subject
2011 Oct 13
1
Legend symbols (line, points) in one column.
Dear R users:
I want to have in the same column both symbols, line and
points, one for a data, and the other for the model.
How can I do that?
Or is there other better form to show both data and model
in the same graphic? I need to make the difference on time
of the same subject (repeated measurements on time)
Problem example:
###########################################################
2016 Apr 19
0
Interquartile Range
Hi Michael,
At a guess, try this:
iqr<-function(x) {
return(paste(round(quantile(x,0.25),0),round(quantile(x,0.75),0),sep="-")
}
.col3_Range=iqr(datat$tenure)
Jim
On Tue, Apr 19, 2016 at 11:15 AM, Michael Artz <michaeleartz at gmail.com> wrote:
> Hi,
> I am trying to show an interquartile range while grouping values using
> the function ddply(). So my function