Displaying 20 results from an estimated 209 matches for "testdata".
2005 May 05
6
Need some quick help with lattice - barchart
For the following code below, the x-axis ticks are 1,2,3,4,5,6,7 when I was expection them to be 1,2,8,9,10,11,12. Please help me figure out where is the mistake.
library(lattice)
testdata <- as.data.frame(t(structure(c(
1,2005,9.24,6.18,634,
2,2005,8.65,6.05,96,
8,2004,6.81,6.51,16,
9,2004,9.0,7.29,8,
10,2004,8.84,6.18,524,
11,2004,8.54,6.35,579,
12,2004,9.97,6.3,614,
12,2005,8.75,5.84,32,
), .Dim=c(5,8))))
colnames(testdata) <- c('month', 'year', 'mean...
2015 Aug 05
1
Samba4 not able to write to group writeable folder???
...le of the day: Users connecting using samba4 cannot write to group
writeable folders even they should be able to.
I upgraded one 3.6 fileserver to 4.2.3. PDC is always a samba 4.2.3
instance. I am using samba4 in classic PDC mode for a couple of reasons.
On my fileserver I have a folder called /TestData. It looks like this:
drwxr-xr-x 39 testdata testdata 4096 Aug 5 10:55 .
drwxr-xr-x 34 root root 4096 Aug 4 21:23 ..
drwxrwsr-x 12 testdata testdata 4096 Aug 5 14:20 0-9
drwsrwsr-x 211 testdata testdata 12288 Aug 5 12:21 A
drwxrwsr-x 185 testdata testdata 12288 Jul 8 15:39 B
drwxrws...
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
...ata? And if do need a timevar, what's the best way to add it?
Thanks,
Paul
connection <- textConnection("
005 1 Gemcitabine
005 2 Erlotinib
006 1 Gemcitabine
006 3 Erlotinib
006 2 Paclitaxel
009 1 Gemcitabine
009 2 Erlotinib
010 1 Gemcitabine
010 2 Erlotinib
010 3 Herceptin
")
TestData <- data.frame(scan(connection, list(Subject = 0, RowNo = 0, Drug = "")))
TestData$Subject <- as.integer(TestData$Subject)
TestData$RowNo <- as.integer(TestData$RowNo)
TestData$Drug <- as.character(TestData$Drug)
require(reshape)
Transpose <- reshape(TestData, direction=&q...
2007 May 13
2
extracting text contained in brackets ("[ ... ]") from a character string?
I have a text string that contains text within two brackets.
e.g. "testdata[3]" "testdata[-4]", "testdata[-4g]",
I wish to "extract" the string enclosed in brackets?
What is a good way to do this?
e.g.
fun(testdata[3]) = '3'
fun(testdata[-4g]) = '-4g'
---------------------------------
Moody friends. Drama quee...
2003 Sep 23
2
confusion about what to expect?
In playing around with data.frames (and wanting a simple, cheap way to
use the variable and case names in plots; but I've solved that with
some hacks, yech), I noticed the following behavior with subsetting.
testdata <- data.frame(matrix(1:20,nrow=4,ncol=5))
names(testdata) ## expect labels, get them
names(testdata[2,]) ## expect labels, get them
names(testdata[,2]) ## expect labels, but NOT -- STRIPPED OFF??
testdata[,2] ## would have expect a name (X2) in the front? NOT EXPECTED
testdata[2,] ## get what...
2005 Apr 21
3
Need help with R date handling and barchart with errorbars
Hi All..
Have a question.. For the following r code
testdata <- as.data.frame(t(structure(c(
"1/1/04","LV1",3.8,2,87,
"2/1/04","LV1",3.2,3,28,
"3/1/04","LV1",3.4,3,88,
"4/1/04","LV1",3,2,26,
"5/1/04","LV1",3.8,2,87,
"6/1/04","LV1",3.2,3,...
2005 Apr 25
1
Need help with panel.segment..
Hi All,
For the following code, I'm not sure why the error bars are appearing horizontal. Can someone please tell me how to fix the problem.
testdata <- as.data.frame(t(structure(c(1,2004,"LV1",3.8,2,87,2,2004,"LV1",3.2,3,28,3,2004,"LV1",3.4,3,88,4,2004,"LV1",3,2,26,5,2004,"LV1",3.8,2,87,6,2004,"LV1",3.2,3,28,7,2004,"LV1",3.4,3,88,8,2004,"LV1",3,2,26,9,2004,"...
2010 Aug 13
1
Bug in t.test?
...luated the t.test() function. Here, we found a weird
behaviour that is also reproducible in the following small test
dataset:
Suppose, we have two vectors with numbers and some missing values
that refer to the same individuals and that should therefore be
evaluated with a paired t-test:
> testdata.A <- c(1.15, -0.2, NA, 1, -2, -0.5, 0.1, 1.2, -1.4, 0.01);
> testdata.B <- c(1.2, 1.1, 3, -0.1, 3, 1.1, 0, 1.3, 4, NA);
Then
> print(t.test(testdata.A, testdata.B, paired=TRUE,
>alternative="two.sided", na.action="na.pass"))
and
> print(t.test(testdata....
2009 Mar 06
2
Interaction term not significant when using glm???
...FLC
construct after vernalization, the chance on spots should be lower. So in
the model one would suspect the interaction term to be significant.
Yet, only the two main terms are significant here. Can it be my data is too
sparse to use these models? Am I using the wrong method?
# data generation
testdata <-
matrix(c(rep(0:1,times=4),rep(c("FLC","FLC","free","free"),times=2),
rep(c("no","yes"),each =4),3,42,1,44,27,20,3,42),ncol=4)
colnames(testdata) <-c("spot","constr","vernalized","Freq")
te...
2005 Apr 22
1
Need help arranging the plot in different fashion than the default format
I want to change the way the plot is appearing in the barchart ..
testdata <- as.data.frame(t(structure(c(1,2004,"LV1",3.8,2,87,2,2004,"LV1",3.2,3,28,3,2004,"LV1",3.4,3,88,4,2004,"LV1",3,2,26,5,2004,"LV1",3.8,2,87,6,2004,"LV1",3.2,3,28,7,2004,"LV1",3.4,3,88,8,2004,"LV1",3,2,26,9,2004,"...
2007 Sep 20
1
Bug with Cor(..., method='spearman") and by() (PR#9921)
I posted this on R help, and a few others responded indicating they too
were able to replicate the error as a function of missing data. I
believe this should not be the case and hence and reporting it here.
### Code provided on R-Help by Ivar Herfindal
# Simulate data
testdata <- cbind.data.frame(gr=3Drep(letters[1:4], each=3D5), =
aa=3Drnorm(20),
bb=3Drnorm(20))
# Introduce some missingness
testdata[1:5, 2] <- NA
# This works fine
by(testdata[,c("aa", "bb")], testdata$gr, cor, use=3D"complete",
method=3D"pearson")
# This i...
2010 Mar 12
1
Length as fun.aggregate in cast function of reshape package: unexpected error
...a data table is pulled using rodbc from an sql server.
# the sql server holds the data in a 'long' format - an example is below -
# which appears (to me) to be identical to that generated by melt.
# no melt operation is therefore carried out on the data, which looks exactly like the
# 'testdata' dataframe described below.
# testdata contains four numeric biochemistry results (Na,K,Ur,Cr) from a single test,
# identified by having rowid=1.
# the objective is to compute summaries of this table by a variety of
# explanatory variables; in this case, there is only one, 'rowid'....
2012 Mar 30
3
Adding text for written comments to bottom of graphs
Hello All,
Recently developed the code below for graphing patterns of chemotherapy administration. As someone just starting to use R in their work, I managed to figure out some parts of the code but needed help with others.
setwd("N:/Regimen Coding/0906/Plots Test")
getwd()
TestData <- structure(list(profile_key = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3), line = c(1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2,
1, 1, 1, 1, 1), instance = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 2), drug = structure(c(1L, 2L, 1L, 2L, 3L, 1L, 2L,
3L, 4L, 1L, 2L, 2L, 1L, 3L, 4L, 3L), .Labe...
2010 Feb 12
2
Access dataframe with variable name in function
...guys, but I have another one:
I want to write a function that returns a certain column of a
dataframe. The function accepts two argument: the dataframe and the
name of the column, but the column is not given as a "string" but as
a variable name.
EXAMPLE
----------------------
> testdata
start stop censor groupvar var1 var2
1 0 1 0 1 0.91663902 0.0847912
2 1 2 0 1 0.60470753 0.6487798
3 2 3 0 1 0.09599891 0.2195178
x
k <- function(df, col) df[col]
EXPECTED RESULTS
-------------------------------------
k(tes...
2007 Jul 25
3
Constructing bar charts with standard error bars
....
I want to graph group data using a "Traditional Bar Chart with Standard
Error Bar", like the kind shown here:
http://samiam.colorado.edu/~mcclella/ftep/twoGroups/twoGroupGraphs.html
Is there a simple way to do this?
So far, I have only figured out how to plot the bars using barplot.
testdata <- scan(, list(group=0,xbar=0,se=0))
400 0.36038 0.02154
200 0.35927 0.02167
100 0.35925 0.02341
50 0.35712 0.01968
25 0.35396 0.01931
barplot(testdata$xbar, names.arg=as.character(testdata$group), main="a=4.0",
xlab="Group", ylab="xbar")
xvalues <- c(0.7, 1.9,...
2011 May 30
0
Question of the XLConnect package
...this is possible one can
then also create formulae from R that will just work when opened in Excel
without having to figure out the indices in Excel
I have figured out how to do that individually for each column but would lie
to automate the process
library(XLConnect)
wb <- loadWorkbook("Testdata.xlsx", create = TRUE) # create a workbook
testdata=expand.grid(letters[1:10], 1:10) # create some data
createSheet(wb,"testdata") # create sheet
writeWorksheet(wb,testdata,sheet="testdata") # write data to sheet
# Create named regions named the column names
col1idx=i...
2005 Jun 25
1
Confidence interval bars on Lattice barchart with groups
...mething elementary, but I am unsure what.
Using R 2.1.1 on various platforms. I am aware of xYplot in the Hmisc
library but would prefer to avoid any dependency on a non-core R
library, if possible.
Tim C
##################################################################
# set up dummy test data
testdata <- data.frame(
dsr=c(1,2,3,4,5,6,7,8,9,10,0,1,2,3,4,5,6,7,8,9,
2,3,4,5,6,7,8,9,10,11,3,4,5,6,7,8,9,10,11,12),
year=as.factor(c(1998,1998,1998,1998,1998,1998,1998,1998,1998,1998,
1999,1999,1999,1999,1999,1999,1999,1999,1999,1999,
2000,2000,2000,2000,2000,20...
2005 Feb 16
2
problem with se.contrast()
..."B","C","D"),each=3,times=3))
Measurement <- c(12.20,12.28,12.16,15.51,15.02,15.29,18.14,18.08,18.21,18.54,18.36
,18.45,12.59,12.30,12.67,14.98,15.46,15.22,18.54,18.31,18.60,19.21,18.77
,18.69,12.72,12.78,12.66,15.33,15.19,15.24,18.00,18.15,17.93,18.88,18.12,18.03)
testdata <- data.frame(Lab,Material,Measurement)
rm(list=c("Lab","Material","Measurement"))
test.aov <- with(testdata,aov(Measurement ~ Material + Error(Lab/Material)))
This gives me the desired ANOVA table. I next want to get the standard
errors for certain contrasts a...
2009 Aug 13
1
using the RODBC for excel
Hi,
I am trying to import data directly from an excel spreadsheet using the RODBC package. I am getting the following error messages, wondering if anyone can help me with it?
> connection = odbcConnectExcel('D:\\R files\\TestData.xls')
> tables = sqlTables(connection)
> tables
TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
1 D:\\R files\\TestData <NA> '30092007$' TABLE <NA>
2 D:\\R files\\TestData <NA> '30092008$' TABLE <NA>
3 D:\\R fil...
2012 Jan 19
1
ctree question
...s
follows:
>origdata<-read.csv("origdata.csv")
>ctrl<-ctree_control(mincriterion=0.99,maxdepth=10,minbucket=10)
>test.ct<-ctree(Y~X1+X2+X3,data=origdata,control=ctrl)
The above works fine. Orig data was my training data. I now have a test
data file (testdata), and would like to run the testdata through the above
tree to see predictions. I tried using the following function
>predict(test.ct,newdata=testdata)
but I get the following error:
Error in checkData(oldData, RET) :
Levels in factors of new data do not match original data...