I use this function for importing CSV files in excel.
read.table("c:/data.csv",header=TRUE)
X.Y.Z
1 1,7,13
2 2,8,14
3 3,9,15
4 4,10,16
5 5,11,17
6 6,12,18
I want to remove the dot from my column how I correct it.
Hello, I had created a function and I aimed to verify if it complies with certain data and if it was, then it is stored in another variable.
data = c(12, 20, 11, 16, 18, 32, 22 , 8)
class = function(N){}
tabla1= c(1:8)
for (i in length(N)){
if (data[i]<21.78){
table1[i]= data[i]...
Good evening!
I would like to conduct a 2-level fractional factorial experimental design on 8 factors. I used the FrF2 package in R to do so. I have capacity to do roughly 30 experiments, so I selected a resolution IV 2^(8-3) with one center-point. Repeats aren't necessary for reasons related...
Hello everyone,
I am new to the Data world and am facing a problem which I can’t seem to fix.
My task is to analyze why some people cancel their policies and some don’t (find sig. factors) and to estimate the risk of cancelling for different groups. I was thinking of using survival analysis...
I have this code :
dataset <- maml.mapInputPort(1)
library(tm) ## Text mining library
## Set the comlumn names
colnames(dataset) <- c("sentiment", "tweets")
## Extract text data and coerce the vector to a tm corpus
tweet.text<- Corpus(VectorSource(dataset['tweets']))
## Apply...
I have a question that is and R question and a statistical question:
I am analysing sales of a retailer. These sales are related to some vars: var1, var2, var3.., varN
Most of the vars are continuos.
I want to analyze the relationship between sales and the vars. I have made a linear...
I need to plot an Ar(1) graph for the process yk = 0.75yk-1 + ek.
for y0=1 and another graph for y0=10.
assume ek is uniformly distributed on interval [-0.5,0.5].
i have the following code but i am not sure how to control y0.
#----------#Start#---------#
rm(list=ls())...
Hi,
I am new to programming. Sorry for the basic question. I came across this code to find runs for consecutive ones for the vector (1,0,0,1,1,1,0,1,1). The code for this is
findruns1<-function(x,k)
{
n<-length(x)
runs<-vector(length=n)
count<-0
for(i in 1:(n-k+1)){...
Hi,
I am looking at Coursera data anlysis specializations and most (basically all except John Hopkins) offer Python as the language of choice for their courses. I really like R but I started to wonder if I am missing something? I just see no advantages in Python for data analysis, that would...
Hello, I am trying to write a scientific paper using R Markdown, but am unsure about the best way to include the references section.
Since I have over 50 references (currently as a list of 50 PMIDs) I am looking for a fast way to format them in the style of the specific journal I want to...
Short version: I have two values of r^2 from Pearson's correlation, one from a control group (.713) and one for an experimental (.527), and I would like to quantitatively compare the difference in how well/poorly the points in each group cluster around their fit line.
Long Version: The data...
I ran prcomp on my data (7000 observations, 48 variables), and I biplot I got seems to have thousands of points. My guess is that R is treating each of the 7000 observations as variables. Is there a way to "rotate" my data so that I get 48 points on my PCA graph instead of 7000?
Each column...
I am a beginner to R. I have read several guides, but still am stuck on this:
I have data in an excel csv file, on which I want to run PCA.
I'm not sure how the prcomp formula works. The help page states:
prcomp(x, retx = TRUE, center = TRUE, scale. = FALSE,
tol = NULL, ...)...
Hello, this is my first post. I currently I'm working in my phD in a multivariate logistic model but I have a problem regarding the sample size of my observations:
-The "success" (1) event group has a sample size of 249 distinct observations
- The "non success" (0) event group has a sample size...
I have a data with unordered dates as follows:
2009-10-19, 2011-04-28, 2008-04-11, 2009-10-18, 2009-06-12, 2006-08-04,
2009-08-21
With corresponding claims data as follows:
1,0,0,1,1,1,0
This is just a small part of the data, Now I want to specify the claims with dates from...
I want to double check that for M and N kxk mtrices and v a k-vector
M%^%2%*%N%*%v is not automatically read as (M%^%2)%*%N%*%v or
M%*%N%^%2%*%v is not automatically read as M%*%(N%^%2)%*%v or
both
I had been assuming the usual precedence (powers first, then multiplication) applies...
I'm taking a data analysis course with R and in my assignment I am asked how variables A, B and C are associated with X. My answer should include descriptive statistics and analyses (group comparisons and/or association tests). It is not completely clear to me which test I should run. So far...
Apparently R does use only the raw data. In some other statistical programs, there is the option to calculate some simple tests, only by inputting the descriptive statistics.
I for one think it would be much better if we could enable R to run such tests too. There are not many tests that can...