Displaying 20 results from an estimated 900 matches similar to: "Extracting columns"
2009 Jul 10
3
strange strsplit gsub problem 0 is this a bug or a string length limitation?
I was working with the rmetrics portfolioBacktesting function and dug into
the code to try to find why my formula with 113 items, i.e. A1 thru A113,
was being truncated and I only get 85 items, not 113.
Is it due to a string length limitation in R or is it a bug in the strsplit
or gsub functions, or in my string?
I'd very much appreciate any suggestions
============Input script:
2013 Apr 10
6
means in tables
Hi.
I have 2 tables, with same dimensions (8000 x 5). Something like:
tab1:
V1 V2 V3 V4 V5
14.23 1.71 2.43 15.6 127
13.20 1.78 2.14 11.2 100
13.16 2.36 2.67 18.6 101
14.37 1.95 2.50 16.8 113
13.24 2.59 2.87 21.0 118
tab2:
V1 V2 V3 V4 V5
1.23 1.1 2.3 1.6 17
1.20 1.8 2.4 1.2 10
1.16 2.6 2.7 1.6 11
1.37 1.5 2.0 1.8 13
1.24 2.9 2.7 2.0 18
I need generate a table of averages, the
2012 Sep 26
3
Reading multiple files
Hi,
I have 35 data files for reading. I would like get a program for
performing reading of 35 files at once.
All are of the type: Dados1.raw, Dados2.raw and so on.
If the files have the same number of columns, I can read with the
following commands:
rm(list=ls())
filenames = list.files(path="~/Silvano/Arq", pattern="Dados+.*raw")
names = substr(filenames, 1, 7)
for(i in
2012 Jul 25
1
regression analysis
Hi,
I have to do 10,000 linear regression analysis, and the response variable
(RESP) is the same for all independent variables (10,000).
y ~ x[i]
i = 1, ..., 10000
For each analysis must extract the p-value and put them in an orderly
increasing.
I thought an analysis of the type:
ana = numeric(10000)
for(i in 1:10000){
mod = lm(RESP~x[i]
p-value[i] = summary(mod)$coe[2,4]
}
Could
2012 Oct 29
1
Interaction
Hi,
I'm fitting a model with 3 variables: A, B and SNP.
The response variable is Y.
I would like fit the following model, in this order:
Y ~ A + B + A*B + SNP
In general, the R sets of the form:
Y ~ A + B + SNP + A*B
How do this?
---------------------------------------------
Silvano Cesar da Costa
Universidade Estadual de Londrina
Centro de Ci?ncias Exatas
Departamento de Estat?stica
2012 Oct 23
1
factor or character
Hi,
The program below work very well.
(snps = c('rs621782_G', 'rs8087639_G', 'rs8094221_T', 'rs7227515_A',
'rs537202_C'))
Selec = todos[ , colnames(todos) %in% snps]
head(Selec)
But, I have a data set with 1.000 columns and I need extract 70 to use
(like snps in command above).
This 70 snps are in a file. So I create a file to extract them with
2010 Sep 03
1
calculate monthly mean
Hello group
Im trying to plot 3d with scatterplot packages, i got error say " length(color) must be equal length(x) or 1 " may data has dimensions (lon,lat,lev,time) ,the time in month i want to
calculate the monthly mean for the time how can i make that , is there any function doing that
Thanks a lot
##load rgl package
library(rgl)
library(fields)
library(ncdf)
2006 Feb 14
2
How to access values returned by R functions (to put into vectors)?
The question is general for all functions, but here is a specific example -
# For the logistic regression of the following correlated variables:
C <- c(457, 1371, 4113, 12339, 37017, 111051, 333153, 999459)
E <- c(0.003858377, 0.014334578, 0.014092836, 0.737950754, 0.996371828,
0.997482379, 1.005569257, 0.994382856)
# The nls function:
A = nls(E~(Em*C^p)/(C50^p + C^p),
2007 May 16
2
use mathematics formula
hello,
I wanna use some mathematics formula and to do this I tried several way in paricular using
strsplit
textconnection
scan
setdiff
but I think that it's a lil hard
the data frame that I'm working on is as follow
> donCalcara2
Id_Cara Form_C
1 743
2011 Oct 12
2
Nonlinear regression aborting due to error
Colleagues,
I am fitting an Emax model using nls. The code is:
START <- list(EMAX=INITEMAX, EFFECT=INITEFFECT, C50=INITC50)
CONTROL <- list(maxiter=1000, warnOnly=T)
#FORMULA <- as.formula(YVAR ~ EMAX - EFFECT * XVAR^GAMMA / (XVAR^GAMMA + C50^GAMMA)) ## alternate version of formula
FORMULA <- as.formula(YVAR ~ EMAX - EFFECT / (1 + (C50/XVAR)^GAMMA))
FIT <-
2010 May 05
3
Latex and Stangle()
Hi,
I'm using the Sweave and I would like include codes of the R
in my LaTeX file.
I extracts the R code with Stangle (), whose name is
Relatorio.R but I can't include it
in the Latex file as an appendix.
Suggests?
Thanks,
--------------------------------------
Silvano Cesar da Costa
Departamento de Estat?stica
Universidade Estadual de Londrina
Fone: 3371-4346
2010 Aug 13
3
Games
Hi,
I want to build the table of a football league with 11
teams. All play together. So will 55 games.
Since there are an odd number of teams in each round a team
will not play.
The games will be:
games = urnsamples(1:11, x =
c('A','B','C','D','E','F','G','H','I','J','K'), size=2,
replace=F,
2011 Jul 06
3
Tables and merge
----- Original Message -----
From: "Silvano" <silvano at uel.br>
To: <r-help at r-project.org>
Sent: Thursday, June 30, 2011 9:07 AM
Subject: Tables and merge
> Hi,
>
> I have 21 files which is common variable CODE.
> Each file refers to a question.
>
> I would like to join the 21 files into one, to construct
> tables for each question by CODE.
>
2013 Oct 31
2
libvirt_lxc: SELinux MCS
Hello list,
my name is Matteo, i'm new on that list.
I'm working on a multitenancy platform with linux containers through libvirt on a production system with Red Hat 6.4.
Every container run a separate instance of OpenSSH and Apache HTTPd and I need to give root privileges to the developers and I try to configure SELinux using svirt and MCS.
I try the secmodel type dynamic and static in
2010 Nov 29
4
subset
?Hi:
I always use subset the same way but now is returning 0 rows.
What's wrong with the way I am subsetting?
library(ggplot2)
structure(list(first = c(38.2086, 43.1768, 43.146, 41.8044, 42.4232,
46.3646, 38.0813, 40.0745, 40.4889, 38.6246, 40.2826, 41.6056,
34.5353, 40.0768), second = c(43.3295, 42.4326, 38.8994, 37.0894,
42.3218, 46.1726, 39.1206, 41.2072, 42.4874, 40.2657, 38.7766,
2010 Jul 21
1
xtable
Hi,
How do I build a table from a regression model adjusted
using xtable?
Commands are:
modelo1 = lm(Y~X1 + X2)
influencia = influence.measures(modelo1)
require(xtable)
xtable(influencia)
but it isn't work.
Thanks,
--------------------------------------
Silvano Cesar da Costa
Departamento de Estat?stica
Universidade Estadual de Londrina
Fone: 3371-4346
2010 Mar 24
2
Mosaic
Hi,
I have this data set:
obitoss = c(
5.8,17.4,5.9,17.6,5.8,17.5,4.7,15.8,
3.8,13.4,3.8,13.5,3.7,13.4,3.4,13.6,
4.4,17.3,4.3,17.4,4.2,17.5,4.3,17.0,
4.4,13.6,5.1,14.6,5.7,13.5,3.6,13.3,
6.5,19.6,6.4,19.4,6.3,19.5,6.0,19.7)
(dados = data.frame(
regiao = factor(rep(c('Norte', 'Nordeste', 'Sudeste', 'Sul',
'Centro-Oeste'), each=8)),
ano =
2010 May 10
2
Extracting a subset
Hi,
I have a dataset with many variables and observations.
The variable Group has two levels: C and P,
the Month variable has four levels: 0, 1, 2 and 3.
I want to extract a subset of the variable Weight,
considering only 1 and 3 levels for Months of the Group
variable.
I tried the command subset but it did not work. Any
suggestions?
Thanks,
--------------------------------------
Silvano
2010 Feb 26
3
Preserving lists in a function
Dear R users,
A co-worker and I are writing a function to facilitate graph plotting in R. The function makes use of a lot of lists in its defaults.
However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the function. For example, if you feed the function codes below into R:
myfunction=function(
list1=list
2010 Jun 14
2
xtable with Sweave
Hi,
I'm using Sweave to prepare a descriptive report.
Are at least 20 tables built with xtable command of kind:
<<echo=F, results=hide>>=
q5 = factor(Q5, label=c("N?o", "Sim"))
(q5.tab = cbind(table(q5)))
@
<<echo=F, results=tex>>=
xtable(q5.tab, align="l|c", caption.placement = "top",
table.placement='H')
@
I'm