18 21
> #
> # , , C = 4
> #
> #B
> # A2 3 4 5 6
> # 1 6 7 8 9 10
> # 2 8 10 12 14 16
> # 3 10 13 16 19 22
>
> I generally just tack on columns to the expand.grid result... I almost
> never have a need for multidimensional arrays.
>
> On
, C = 3
> #
> #B
> # A 2 3 4 5 6
> # 1 5 6 7 8 9
> # 2 7 9 11 13 15
> # 3 9 12 15 18 21
> #
> # , , C = 4
> #
> #B
> # A2 3 4 5 6
> # 1 6 7 8 9 10
> # 2 8 10 12 14 16
> # 3 10 13 16 19 22
>
> I generally just
of
variables? I’d like something that would simply work from the definition
of the function. If that is possible.
Thanks,
Steve Kennedy
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and mo
s?
I'd like something that would simply work from the definition of the function.
If that is possible.
Thanks,
Steve Kennedy
CONFIDENTIALITY NOTICE: This e-mail message, including a...{{dropped:11}}
__
R-help@r-project.org mailing list -- To UN
eve
Stephen J. Kennedy, Ph.D.
Director, Research & Development
Prollenium Medical Technologies, Inc.
138 Industrial Parkway North
Aurora, ON
L4G 4C3 Canada
+1 (905) 508-1469 X223
step...@prollenium.com
On Oct 1, 2014, at 6:46 PM, peter dalgaard wrote:
On 01 Oct 2014, at 14:29 , Stephen Kennedy
Oct 1, 2014, at 6:46 PM, peter dalgaard wrote:
On 01 Oct 2014, at 14:29 , Stephen Kennedy wrote:
> Simple question. A vector of ‘number of observations’ can be input to
> power.t.test, and a vector of ‘power’ s is output. But, inputting a vector
> of powers generates an err
Kennedy wrote:
> Simple question. A vector of ‘number of observations’ can be input to
> power.t.test, and a vector of ‘power’ s is output. But, inputting a vector
> of powers generates an error. Am I missing something?
>
> Vector of ’n’ s
>
> power.t.test(n=c(28,
Simple question. A vector of ‘number of observations’ can be input to
power.t.test, and a vector of ‘power’ s is output. But, inputting a vector of
powers generates an error. Am I missing something?
Vector of ’n’ s
power.t.test(n=c(28,29,30), delta=2, sd=3, sig.level=0.05, type="two.sample",
Hello there,
I am new to R and have no previous experience using any other statistics
software. Can someone send me basic R notes to help me start off for the
very first time?
*With Kind regards,*
* God bless you*
* Shikami K. Akweyu Manager; Fisheries ComponentKenya Coastal Development
Proj
You can split your string, and then only take the first 4 digits after
that (this is only an improvement if your numbers might not be at the
end of mytext):
mytext <- "I do not want the first number 1234, but the second number 5678"
sstr<-strsplit(mytext,split="second number ")[[1]][2]
nynumbers<-
I have similar problems when trying to install packages while at work.
It might have something to do with your firewall settings.
On Wed, Aug 17, 2011 at 4:38 AM, Dinesh wrote:
> Hi,
>
> I am trying to install a bunch of packages via command line and can use
> some help in getting it right. My e
convert your matrix to a data frame:
df <- as.data.frame(mymatrix)
then you can simplify your formula and specify where the data is coming from:
glm.fit <- glm(y~., data=df)
the "." in the formula means all columns in your dataframe (except
"y", if it is in df)
On Sat, Aug 20, 2011 at 10:43 A
your dataframe needs to be called "Nord". If it is not, then replace
"Nord" with the actual name of your dataframe
On Sat, Aug 13, 2011 at 10:43 PM, maggy yan wrote:
> dear R users,
> my data looks like this
>
> PM10 Ref UZ JZ WT RH FT WR
> 1 10.973195 4.338
Hi Cassie,
I'm not sure exactly what you are trying to get: i assume that each
station will have a different ppt value for each year-month
combination, but it looks like you're trying to get one ppt value for
each station.
Steve
On Thu, Jul 28, 2011 at 1:30 AM, Wilson, Cassandra J wrote:
> I a
use unique()
df <- data.frame(Species_name=c(rep('Abies concolor',4),rep('Accipiter
cooperi',7)),
Longitude=c(-106.601, -106.493, -106.489, -106.496,
-119.688, -119.792,
-118.797,-77.38333,-77.38333,-75.99153,-75.99153),
Latitude=c(35.868, 35.9682, 35.892, 35.85
Hi Vikas,
The following works (I'm not very good with sapply, but the for loop
is ok if your data set is not huge).
> df <- read.table("test.txt",stringsAsFactors=FALSE)
> df
V1V2 V3 V4 V5 V6 V7 V8 V9
1 10 135349467 g G 4 0 0 5 ,,,.,
2 10 135349468 t T 2 0 0 5 ,,c.,
Try RStudio. It is the best IDE for R I've seen.
On Tue, Jul 19, 2011 at 3:31 AM, Michael Bernsteiner
wrote:
>
> I know there are several threads about IDEs for R.
>
> I've tried Tinn-R, but I am looking for an IDE (win) with a preview function
> that shows me the variables and the table/matrix
Hi Kishore,
There should be no problem reading in your data if you have followed
the directions posted by Jim and myself. I suggest you do a search for
a basic R tutorial and follow that through.
Steve
On Wed, Jul 13, 2011 at 10:08 PM, Kishorenalluri
wrote:
> Hi Jim,
> Saving is not a pr
save it as .csv, then use read.csv("your_file.csv")
On Wed, Jul 13, 2011 at 6:23 PM, Kishorenalluri
wrote:
> Friends,
> Could anyone help me the script, how to read the more than 15
> columns from the file. I have Excel sheet, of course can save into any
> readable format. Appreciate you
You should just be able to use the sqlQuery function to execute the
query something like this:
con<-odbcConnect(...)
sqlQuery(con,"EXEC ")
On Thu, Jul 7, 2011 at 11:40 AM, Alex Zhang wrote:
> Steven - I use RODBC. Thx,
> - Alex
> ____
> F
What package are you using to connect to the Access database?
On Thu, Jul 7, 2011 at 7:02 AM, Alex Zhang wrote:
> Hey guys,
>
> Could you please teach me how to run or execute a query stored in an Access
> 2007 database?
>
> I can connect and run queries from my Access database without any prob
What function are you using to export your data.frame to MySQL?
On Wed, Jul 6, 2011 at 10:41 PM, Thiago Clark wrote:
> Dear R-helpers,
>
> I have a huge dataset and I create a filter selecting only the cases I want
> using:
>>data <- subset(data, data$var=='x' | data$var=='y' | data$var=='z' |
I use RODBC and have got it to work fine on Windows, Linux and Mac.
There's some basic info here, and plenty of blog posts out there with
step by step instructions for the different OS's.
http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/RODBC/html/00Index.html
On Tue, Jun 28, 2011 at 11:53 PM
As long as all the fields in each entry are the same, then the
following will work
df<-data.frame(photo_id=NA,owner=NA,secret=NA,server=NA,farm=NA,title=NA,
ispublic=NA,isfriend=NA,isfamily=NA,tags=NA)
x<-''
y<-strsplit(x,split="=\"")
tmp<-c()
for (i in 2:length(y[[1]])){
tmp[i-1
#sampling elements
x<-c(rep(0, 20), seq(1:37))
#number of simulations to perform
sims<-100
#vector to store results
results<-c()
#using for loop to perform simulations
for(i in 1:sims){
#take your sample
y<-sample(x,3,replace=FALSE)
#check if all elements are zero
You can find the volcano script (along with a lot of others) at the
following site:
http://addictedtor.free.fr/graphiques/thumbs.php
On Mon, Jun 27, 2011 at 11:49 AM, Jorge Ivan Velez
wrote:
> Hi Ungku,
>
> Check
>
> ?persp
> ?volcano
>
> in the R console.
>
> HTH,
> Jorge
>
>
> On Sun, Jun 26,
plot(1:20,col='blue')
On Mon, Jun 27, 2011 at 9:40 AM, wrote:
> Dear Sir,
>
> Just started using R. I want to plot x>-1:20, for example, in the colour
> blue. How do I do this?
>
> Regards,
>
> Ivo
>
> [[alternative HTML version deleted]]
>
>
You need:
mydata$apples<-as.numeric(mydata$apples)
On Wed, Jun 22, 2011 at 6:38 AM, Alina Sheyman wrote:
> I'm trying to convert data from character to numeric.
>
> I've imported data as a csv file, I'm assuming that the import is a
> database - are all the columns in a database considered "ve
Please tell us the package you are using and the specific commands. It
is most likely you are retrieving the data into a list or some other
structure that hist() doesn't like.
On Mon, Jun 20, 2011 at 12:57 PM, amrita gs wrote:
> Hi everyone,
>
> I have certain values retrieved from mysql dat
This should work:
mydata$my_column<-as.character(mydata$my_column)
sum(unlist(strsplit(mydata[,"my_column"], "")) == "1")
On Wed, Jun 15, 2011 at 7:09 PM, Jay wrote:
> Hi,
>
> I have a dataframe column from which I want to calculate the number of
> 1's in each entry. Some column values could, f
Have a look at:
http://addictedtor.free.fr/graphiques/thumbs.php
One of the graph examples they have is exactly what you are after.
On Wed, Jun 8, 2011 at 11:14 PM, nandini_bn wrote:
>
> Hello ,
> I am trying to create a histogram in order to compare between two groups and
> would like it to be
This works, but there might be a better way:
misscols<-lapply(howmanyMiss, function(x) sample(1:n, x))
for (i in 1:nMiss){
for (j in misscols[[i]]){
X[idMiss[i],j]<-NA
}
}
__
R-help@r-project.org mailing list
https://sta
As a different approach, you could just use the readLines function:
length(readLines(D:\my_dir\my_file))
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-g
It looks like your MySQL is missing the libmysql.lib file. Download it
from MySQL then put it in the following location:
C:/Program Files/MySQL/MySQL Server 5.5/lib/opt/libmysql.lib
If you are still having problems, you could try using RODBC instead.
_
try the fitdistr() function in the MASS package
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained,
On Fri, May 13, 2011 at 1:31 AM, Dat Mai wrote:
> Yes, but I want to make it so that 2 different square matrices to both have
> the same order for the x and y axis while, at the same time, the x and y
> axis having variables in the same order as well:
>
> a b c d e
You can order each matrix by any column you choose like:
a<-matrix(rnorm(20),ncol=2)
> a[order(a[,1]),] #orders by column 1
[,1] [,2]
[1,] -1.86523489 -1.6920270
[2,] -0.94488744 0.2815087
[3,] 0.02380494 0.2491136
[4,] 0.37295795 0.8156993
[5,] 0.55533366 -0.7053233
How about something like:
> data$DateTime<- strptime(paste(data$day.hour,data$min.sec,sep="
> "),format="%j%H %M%S")
> data$Date <- strftime(data$DateTime,format="%Y-%m-%d")
> data$Time <- strftime(data$DateTime,format="%H:%M:%S")
> data
day.hour min.secDateTime Date Time
The plot works fine for me with the example data you have given. Maybe
it is something in your par settings. Try putting a ylim in your plot
the same as you have done for the xlim:
y1<-min(original.estimate)
y2<-max(original.estimate)
plot(lfdr.true, original.estimate, pch=19, col = "dark red",xli
Histograms plot data in bins - you don't get the exact value, because
each bin contains a range of values. Do you want to plot the range of
values the bin contains? Also, check ?hist to see how to set the
values of the breaks between the bins.
__
R-help@
ive us the new parameters of Beta
> distribution that approximately fits this data.
>
>
> I have tried the function with other distribution like Normal, Gamma,
> Weibull...its working fine..
>
> Regards,
> Som Shekhar
>
>
>
>
> On May 4, 1:25 am, Steven Kennedy
library(MASS)
fitdistr(x,"beta",list(shape1=1,shape2=1))
On Tue, May 3, 2011 at 9:44 PM, Shekhar wrote:
>
> Hi,
> I have some random data and i want to find out the parameters of Beta
> distribution ( a and b) such that this data approximately fits into
> this distribution. I have tried by plot
Rather than selecting all the keys, then having R loop through them, why not
have postgres do it for you with something like:
#go through each line in our entry table
for (i in 1:dim(tbl)[1]){
#check if the pkey already exists
q <- paste ("SELECT key1, key2 FROM tabl WHERE key1=",tbl[i,1],
You can use grepl:
> dat<-data.frame(test=c("abc","cdf","dabc"))
> d<-subset(dat,grepl(test,"abc"))
> d
test
1 abc
3 dabc
On Mon, May 2, 2011 at 7:03 PM, Matevž PavliÄ wrote:
> Hi,
>
>
>
> Is it possible (i am sure it is) to subset data from a data.frame on the
> basis of SQL >LIKE< oper
al message ---------
Message: 107
Date: Tue, 22 Feb 2011 16:09:48 +1300
From: "David Kennedy"
To:
Subject: [R] Adjusting for autocorrelation in a panel model
Message-ID: <00b701cbd23d$f7200560$e5601020$@d...@ihug.co.nz>
Content-Type: text/plain
I am working with
I am working with panel data. I am using the plm package to do this.
I would like to do be able to adjust for autocorrelation, as one does with
glm models and correlation structures (eg corr=corARMA(q=4)) . In
particular, I want to employ MA(4) error structure.
Is there a way of doing thi
Thank you Brian,
Your suggestion helped me a bit but I am not quite there yet. Now I have the
following code:
library(cluster)
library(stats)
D<-matrix(nr=4,nc=4)
rownames(D)<-c("Node 1","Node 2","Node 3","Node 4")
D[1,]<-c(0,.6,.1,.7)
D[2,]<-c(.6,0,.3,.9)
D[3,]<-c(.1,.3,0,.9)
Hi,
I have performed a clustering of a matrix and plotted the result with
pltree. See code below. I want to color the labels of the leafs
individually. For example I want the label name "Node 2" to be plotted in
red. How do I do this?
Sincerely
Henrik
library(cluster)
D <- matrix(nr=4,
Thank you Peter for your help.
I had tried hclust before but I made the mistake of using the D matrix above
instead of a dist object. Hence
library(flashClust)
d <- as.dist(D)
# Clustering using hclust
hc <- hclust(d, method = "median",members=NULL)
# Clustering using flashClust
fc
Hi,
I want to perform a hierarchical clustering using the median as linkage
metric. As I understand it the function hcluster in package amap have this
option but it does not produce the results that I expect.
In the example below M is a matrix of similarities that is transformed into
a matrix of
Thank you very much for the help. I decided to go with the 'plyr' package but
it is nice to have options.
Have a lovely day.
--
View this message in context:
http://r.789695.n4.nabble.com/Aggregate-certain-rows-in-a-matrix-tp2528454p2529238.html
Sent from the R help mailing list archive at Nabb
Hi,
I have a matrix that looks like this
a <- c(1,1,1,1,2,2,3,3,3,3)
b <- c(2,2,2,3,4,4,4,5,5,6)
c <- c(1,2,3,4,5,6,7,8,9,10)
M <- matrix(nr=10,nc=3)
M[,1] <- a
M[,2] <- b
M[,3] <- c
> M
[,1] [,2] [,3]
[1,]121
[2,]122
[3,]123
[4,]
Hello,
I have done some clustering with Agnes and want to calculate the pseudo F
statistics using index.G1. It works for a low number of clusters but when i
increase the number of clusters i eventually get the following message:
Error in apply(x[cl == i, ], 2, mean) :
dim(X) must have a posit
Here's another possibility:
> x <- c("Apple12","HP42","Dell91")
> strsplit(x,"(?<=\\D)(?=\\d)", perl=TRUE)
[[1]]
[1] "Apple" "12"
[[2]]
[1] "HP" "42"
[[3]]
[1] "Dell" "91"
Krishna Tateneni writes:
> Greetings,
>
> I have a vector of values that are a word followed by a number, e.g.,
e key.
xyplot(Force~Time, rawData, groups=Sample, pch=0:18, col="black",
panel = panel.superpose, auto.key=list(space="right", pch=0:18))
Thanks,
Steve Kennedy
Stephen J. Kennedy, Ph.D.
Consulting
Contract Research & Development
PLEASE NOTE: NEW EMAIL ADDRESS
stephenjken
ke to know if there's a better way.
Ian Kennedy
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
ng.
I was planning on using a for loop for the digits at the start of the file
name, but I'm not sure how I can append the letter to the end of the number
string.
I'm also open to any ideas other than the for loop.
Thanks,
Steven Kennedy
==
"
To Whom It May Concern:
Are there more examples / information regarding the use of
'dataedit'? If so, where might I find these?
Regards,
Steve Kennedy
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
58 matches
Mail list logo