Displaying 20 results from an estimated 200 matches similar to: "My first R program"
2000 Apr 05
2
My first R-program
Sorry, I pasted the wrong file in earlier... this is the correct one:
pValCalculator(b, n=20, m=20)
{
ind <- 1:min(c(n,m))
prob <- (1-pnorm(b,sd=std*sqrt(ind)))
prob1 <- sum((n-ind+1)*(m-ind+1)*prob)
prob1
}
inputData <-
scan("/users/lvssso/projects/LAMA/output/pValLamaScore.tmp", list(block1
= "",block2 = "",width1 = 0,width2 = 0,alignment = 0,score
2010 Mar 27
1
string width calculation
Colleagues,
I am trying to create a PDF document in which I use margin text with two different fonts. The resulting text might be:
XXXXXyZZZ
where X and Z are one font and Y is the other.
My plan was to do this in the following manner:
mtext("XXXXX ZZZ", cex=2, adj=0.5, family=SOMEFONT)
mtext("Y", cex=2, adj=??, family=DIFFERENTFONT)
My question regards how to calculate
2000 Mar 27
1
Installing R on Solaris
Hi,
I've been trying to install R on Solaris, I've been following the
instruction for configuring & compiling R (I have gcc and f77
installed)- but I get Error messages. I'd appreciate it if you could
look at the output, (pasted below) and give me some advice on what to
do. I've attached the R install 'readme'.
Thanks, a quick reply would be greatly appreciated,
2000 Apr 05
1
Working with R batch
Hi all,
I'm trying to invoke R from a perl program, using R BATCH. My original
R program wrote an output to a file and plotted a graph. I'm having
problems with the following three things:
1) To get the output file name form the perl program I wrote the
following, in my R program:
commandArguments <- commandArgs();
outputFile <- commandArguments[length(commandArguments)];
This
2010 Sep 06
1
calculating area between plot lines
Hi everyone. I have these data:
probClass<-seq(0,0.9,0.1)
prob1<-c(0.0070,0.0911,0.1973,0.2949,0.3936,0.5030,0.5985,0.6869,0.7820,0.8822)
prob2<-c(0.0066,0.0791,0.2358,0.3478,0.3714,0.3860,0.6667,0.6400,0.7000,1.0000)
# which I'm plotting as follows:
plot(probClass,prob1,xlim=c(0,1),ylim=c(0,1),xaxs='i',yaxs='i',type="n")
lines(probClass,prob1)
2011 Oct 06
1
sum of functions
Dear all,
I would like to create a code for semiparametric Klein and Spady's
estimator. For that I created a function that provides the log-likelihood
function for each observation (so it is a function of betas and i, where i
denotes the observation). Now, in order to maximize the log-likelihood
function, I have to sum these log-likelihood functions for each i and so to
get another function
2010 Mar 06
1
Plotting Comparisons with Missing Data
Hi,
I'm new to R and I've run into a problem that I'm not really sure how to
express properly in the language. I've got a data table that I've read from
a file containing some simple information about the performance of 4
algorithms. The columns are the name of the algorithm, the problem instance
and the resulting score on that problem (if it wasn't solved I mark that
2012 May 11
0
NLS sensitivity to start= values or poles in data range
Greetings R-help! I'm fairly new to R and am trying to expand my knowledge beyond using R for simple summary statistics and basic tests. To that end I am attempting to write an interactive R-script that will perform a general rational function fit to a given dataset based on the example given at http://www.itl.nist.gov/div898/handbook/pmd/section6/pmd64.htm.
The problem that I seem to have
2005 Apr 08
2
DLL Memory Problem
Hello,
I have created a .dll file using G77 and MinGW on my PC (Windows
2000). After using dyn.load to bring it into R2.0.1, I then call the .dll
through the function ccprox shown below. It returns the correct
values. If I run it a second time though it returns different values, so
it seems something is being placed oddly in memory.
If I unload and reload the .dll it works again the first
2009 Oct 14
2
attach
Hi all,
I have a question regarding the memory usage for the attach function.
Say I have a data.frame inputdat that I create with read.csv.
I would like to know what happens on the memory side when I use
attach(inputdata)
Is there a second allocation of memory for inputdata?
Then I'm using eval on a expression which depends on the columns of
inputdata. Is it better not to use attach
2005 Sep 09
2
Question about plotting discontinuous data
Hi, I have a simple question that I just cannot figure out. I
have 2 corresponding columns of data, one column (X-axis) for
time (formatted thus: 8:30:01am = 830.1, 12:30:05pm = 1230.5,
and one column (Y-axis) for values.
When I attempt to plot the data using something like
plot(inputdata[,1],inputdata[,2],type="l");
I get breaks in the plot (since the time essentially jumps
from
2008 Apr 22
2
Multidimensional contingency tables
How does one ideally handle and display multidimenstional contingency
tables in R v. 2.6.2?
E.g.:
> prob1<- data.frame(victim=c(rep('white',4),rep('black',4)),
+ perp=c(rep('white',2),rep('black',2),rep('white',2),rep('black',2)),
+ death=rep(c('yes','no'),4), count=c(19,132,11,52,0,9,6,97))
> prob1
victim perp
2009 Jun 10
1
Analisys in Multidimensional contingency tables
Dear R-list,
Hi everyone, Im trying to make an analysis of multidimensional contingency
tables using R. I' working with the Agresti example where you have the
data from 3 categories. The thing is how can I do the analisys using the
G2 statistics. Somebody can send me an Idea?
I attach the program where you can find the data.
Best Regards,
> prob1<-
2004 Oct 14
2
fidelity of generated raster images (R and perl)
Hi:
Goal: use R to turn a matrix of 1's and 0's
into a corresponding image (e.g. png)
of black and white pixels.
Why R: Yes, I can do this more efficiently and precisely
with a perl module like Image::PBM. Been there,
done that many times, etc. (Just humor me.
I'm trying to do this with R for a number of reasons.)
Problem:
2003 Feb 21
5
Problem Writeing a pipe using R (stdin is consumed)
Hi everybody,
I a, trying to use R as a pipe like this:
cat inputData | R --silent RCommandFile >outputData
The RCommandFile would contain something like readLines(stdin()).
I have tryed various things and none did work cleanly.
One possible solution is to use the pipe() function inside R and to pass in the "cat inputData" however this is not very convenient
since I would like to
2000 Jan 07
0
VQ generation utilities ready + usage instructions
The VQ codebook generation utilities are more or less ready to go. Minor
things are left to do, but those will have to be handled as I to them :-)
The next thing to do is complete the interface to get compression modes and
codebooks to the library for encoding (minor stuff), and then arrange how
exactly the MDCT residue is filtered through the codebooks.
VQ codebook util instructions:
2007 Jan 19
1
naive bayes help
Hello
I have a rather simple code and for some reason it produces an error
message. If someone can tell me why and how to fix it, I would be very
greatful. Thank you in advance.
##### create data
set.seed(10)
n <- 200 # number of training points
n.test <- 200 # number of test points
p<-2 # dimension of input space
z <-
2018 Apr 12
2
R Timeseries tsoutliers:tso
Hello,
Writing to seek help in regard to some unexpected performance anomaly i am
observing in using tsoutlers:tso on the mac vs on an AWS cloud server..
I am running the following code with very small dataset of about 208
records.
d.dir <- '/Users/darshanpandya/xxxxxx'
FNAME <- 'my_data.csv'
d.input <- fread(file.path(paste0(d.dir,"/zzz/"),FNAME,fsep =
2013 May 17
1
[LLVMdev] Alignment attribute of function arguments
Hello everyone,
Hopefully a simple question. How can I access function argument alignment
information? If my code has something like this:
void foo(short * __restrict __attribute__ ((aligned(8))) InputData){}
...as I deal with argument (InputData) can I get the alignment info set for
it?
Thanks!
Sergei
---
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
2010 Dec 02
1
Arrange elements on a matrix according to rowSums + short 'apply' Q
Greetings,
My goal is to create a Markov transition matrix (probability of moving from
one state to another) with the 'highest traffic' portion of the matrix
occupying the top-left section. Consider the following sample:
inputData <- c(
c(5, 3, 1, 6, 7),
c(9, 7, 3, 10, 11),
c(1, 2, 3, 4, 5),
c(2, 4, 6, 8, 10),
c(9, 5, 2, 1, 1)
)
MAT <- matrix(inputData,