similar to: My first R-program

Displaying 20 results from an estimated 200 matches similar to: "My first R-program"

2000 Apr 05
0
My first R program
Hi, Sorry to bother you guys with this syntax problem, this is my first R program, and I seem to not have grasped something right. I keep getting an error message from 'parse' on the line with the *** : 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 <-
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
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
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 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
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
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:
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,
2018 Apr 13
0
Fwd: 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 =
2009 Nov 19
1
problem post request with RCurl
Hi, I am trying to use a CGI service (Pubchem PUG) via RCurl and am running into a problem where the data must be supplied via POST - but I don't know the keyword for the argument. The data to be sent is an XML fragment. I can do this via the command line using curl: I save the XML string to a file called query.xml and then do curl -d @query.xml
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
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
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)
2012 Jul 09
4
Skipping lines and incomplete rows
I have a text file that has semi-colon separated values. The table is nearly 10,000 by 585. The files looks as follows: ******************************************* First line: Skip this line Second line: skip this line Third line: skip this line variable1 Variable2 Variable3 Variable4 Unit1 Unit2 Unit3 10 0.1 0.01 0.001 20
2011 Aug 03
2
convert a splus randomforest object to R
Hi, I have a randomforest object "cost.rf" that was created in splus 8.0, now I need to use this trained RF model in R. So in Splus, I dump the RF file as below data.dump("cost.rf", file="cost.rf.txt", oldStyle=T) then in R, restore the dumped file, library(foreign) data.restore("cost.rf.txt") it works fine and able to restore the
2003 Jul 10
2
please help on frag polynoms
hi there, can anyone help me on the topic of frag polynoms? i just heard of a friend of mine, that i could build in a functioon called fragpoly (he was talking of such a function in the 'stata' language) in order to improve my process of finding an optimal linear model. instead of trying a vast amount of transformed inputdata to find the best fit and then step backwards down to e.g.
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