Displaying 20 results from an estimated 20000 matches similar to: "AutomaticTRUE/FALSE Matrix Generation"
2010 Dec 03
3
colname refered by a variable
Hello,
I tried to use a variable to refer colname, but I got error, could anyone give me advice?
>df=data.frame(cbind(AB=1:3,AC=3:5))
> df$AC
[1] 3 4 5
> df$paste("A","C",sep="")
Error: attempt to apply non-function
thanks
Jian
[[alternative HTML version deleted]]
2010 May 29
3
adding statistical output to a plot
I have written a function to emulate minitab's QQ plotting output (with SW
test and AD test results on the graph):
mtab.norm<-function(x)
{ library(nortest)
library(lattice)
x<-as.numeric(x)
x<-as.vector(x)
plot.ht<-4.6
plot.wd<-4.6
pt.ht=plot.ht/5
txt.sz<-(plot.ht/7.5)
X11(width=plot.wd, height=plot.ht, bg='gray96')
qqplot(x, pch=16, cex=pt.ht,
2020 Oct 08
0
Lahman Baseball Data Using R DBI Package
Hi Philip,
You've probably realized by now that R doesn't like column names that
start with a number. If you try to access an R-dataframe column named
2B or 3B with the familiar "$" notation, you'll get an error:
> library(DBI)
> library(RSQLite)
> con2 <- dbConnect(SQLite(), "~/R_Dir/lahmansbaseballdb.sqlite")
> Hack12Batting <-
2012 Oct 12
4
dotchart ordering problem
I'm having an sorting problem in dotchart. I want to change the order of the
BA in groups to AB, but I haven't found any solution yet. What should I do?
And what if I want to change the groups order as well? At the bottom from
Conrol up to 10 mg/L on the top. Thank you!
x = c(39, 23, 23, 35, 30, 26, 30, 30, 29, 29, 26, 29, 34, 33)
y = c("Control", "DMSO", "0,1
2020 Oct 08
1
Lahman Baseball Data Using R DBI Package
This is really a feature of SQL, not R. SQL requires that you double quote
column names that start with numbers, include spaces, etc., or that are SQL
key words. E.g.,
> d <- data.frame(Order=c("sit","stay","heel"),
Where=c("here","there","there"), From=c("me","me","you"))
>
2016 Jun 01
2
data.frame colname igraph
Si, ese es el problema, lo que implica por ejemplo que no pueda ordenar el data.frame por grados.
Javier Rubén Marcuzzi
De: JCMld
Enviado: miércoles, 1 de junio de 2016 4:28
Para: 'Javier Marcuzzi'; R-help-es en r-project.org
Asunto: RE: [R-es] data.frame colname igraph
Creo que la conversión a data.frame está devolviendo un data frame con una sola columna llamada
2010 May 26
1
Fill a matrix using logical arguments?
Hello all,
I am going slightly mad trying to create a table for running
co-correspondence analysis.
What I have is seed bank and vegetation data, and my aim is to see if
the vegetation found in a site (containing several seed bank samples)
can predict the composition of a seed bank sample within that site. So
for this I need two tables with matching rows.
I have created an empty matrix,
2010 Jun 05
1
Write.fwf works from Mac, throws different number of row error in Windows
Hello,
I am having a problem with write.fwf in Windows. I wrote a code to ingest a
number of text files with weather data in them, process them, and then
output a text file with two parts: 1) a set of column names, 2) the
processed data table.
I wrote and tested the program on my Mac, and it worked fine. However, on
the windows machine, where I intend the work to be done, when I run the
2009 Nov 16
1
extracting values from correlation matrix
Hi! All,
I have 2 correlation matrices of 4000x4000 both with same row names and
column names say cor1 and cor2. I have extracted some information from 1st
matrix cor1 which is something like this:
rowname colname cor1_value
a b 0.8
b a 0.8
c f 0.62
d k 0.59
- - --
-
2005 Aug 08
1
tapply huge speed difference if X has names
Hi all,
Apologies if this has been raised before ... R's tapply is very fast, but if
X has names in this example, there seems to be a huge slow down: under 1
second compared to 151 seconds. The following timings are repeatable and
are timed properly on a single user machine :
> X = 1:100000
> names(X) = X
> system.time(fast<<-tapply(as.vector(X), rep(1:10000,each=10), mean))
2004 Aug 17
2
table and getting rownames
hi there
say that i have this table
>x<-table(adoc, oarb)
>x
oarb
0 1
adoc
ab 1 0
am 5 1
ba 14 1
cc 271 3
ch 87 2
dz 362 6
fl 7 0
fs 84 2
is there an easy way to get the row names or row
2010 Jun 17
2
how to 'average' one col wrt to another one
Hi, folks,
test=matrix(rep(letters[1:3],6),nrow=6,byrow=T)
test[2,]=letters[5:7]
test[4,]=c('e','f','i')
test[1,3]='i'
colnames(test)=c('leave','arrive','line')
The code will generate a sample dataset. I have thousands rows of data.
For the same 'leave' and 'arrive', how can I get the sum of square of
percentages of
2005 Apr 07
2
how to configure
hi all
iam newbee, i ve install shorewall 1.3.11 on mandrake 8.2
, i ve eth0 with local ip 192.168.40.40/21 and eth1
203.128.65.22/255.255.255.248 the problem is
when my client try connect to internet the page cannot be
displayed and while client try ping to internet address
reply from 192.168.40.40 destination net unreachable
why it can happend ? anyone can give me a hand
2010 Dec 30
2
unexpected input in rpart
Hi all, I'm a newbee using R. I need to do a classification tree using the
rpart package. Basically I have a set of birds of known sex and several
morphological measurements and we want to predict the sex using the
morphology. I read my csv file and it shows up in R no problem, looks fine
but when I execute the following rpart command
2005 Sep 27
3
analogue phone with asterisk
I am a newbee to asterisk. I recently installed asterisk@home. Everything went well and my set up is running fine with soft phones, such as kphone and XtenLite. Now, i want to be able to connect my analogue phones to my asterisk pbx box and use it as if i make a regular Phone call (I do have my PSTN gateway account with broadvoice.com and already configured to route through it). I do NOT have a
2004 Dec 04
4
asterisk dabbling...
Newbee here....
I would like to play around with Asterisk a little.
First, I need to prepare a server with FreeBSD.
It's a PII 433mHz/256mb box. Good enough?
Then install Asterisk.
I have a broadband (cable) internet presence.
Could I do anything with this connection and
Asterisk?
Thanks,
Rayasterisk
---------------------------------
Do you Yahoo!?
Read only the mail you want -
2011 Sep 16
2
Referring to an object by a variable containing its name: 6 failures
Dear Folks--
I'm trying to make a function that takes the columns I select from a data
frame and then uses a for loop to print some information about each one,
starting with the column name. I succeed in returning the column name, but
nothing else I have tried using the variable colName, containing the name of
the column, to refer to the column itself has worked.
Below I show my
2011 Nov 26
2
simplify source code
Hi
I would like to shorten
mod1 <- nls(ColName2 ~ ColName1, data = table, ...)
mod2 <- nls(ColName3 ~ ColName1, data = table, ...)
mod3 <- nls(ColName4 ~ ColName1, data = table, ...)
...
is there something like
cols = c(ColName2,ColName3,ColName4,...)
for i in ...
mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...)
I am looking forward to help
Christof
2003 May 31
3
function to populate a matrix based on a lookup to another matrix ?
Hi,
This is a beginner R question.
I have a 4x4 matrix named 'lookup' with the following values:
1 2 3 4
1 0.000000 2.828427 5.656854 8.485281
2 2.828427 0.000000 2.828427 5.656854
3 5.656854 2.828427 0.000000 2.828427
4 8.485281 5.656854 2.828427 0.000000
I then create a new empty matrix named 'dd' with specfic row and col names :
2002 Jun 04
1
documentation inconsistency for [.data.frame ?
(Using R1.5.0 patched for Windows)
Subscripting rows of data.frame only sometimes does what the documentation
says:
> When `[.data.frame' is used for subsetting rows of a `data.frame',
> it returns a dataframe with unique row names, using `make.names( *
> , unique = TRUE)', see the `swiss' example below.
Row names seem to be modified in this way only when