Solved

How to fix Error with Caret library and preProcess()

Posted on 2014-12-10
1
189 Views
Last Modified: 2015-03-12
Hi, I am getting the following error:
Error in if (any(scaleValue == 0)) { : 
  missing value where TRUE/FALSE needed

Open in new window


How can I fix it?  Thank you.

my code:
library(caret)
# read data
features.adj.dfm1<-read.table("features_adj_dfm1k.txt",sep=" ",header=T,stringsAsFactors=F)

###### error after this function
trans<-preProcess(features.adj.dfm1,method=c("BoxCox","center","scale"),na.remove=T)

Open in new window

features-adj-dfm1k.txt
0
Comment
Question by:pgmerLA
1 Comment
 
LVL 17

Accepted Solution

by:
Thibault St john Cholmondeley-ffeatherstonehaugh the 2nd earned 500 total points
ID: 40494481
That text file is massive, and too big to read on my phone. All I see is a lot of numbers.

From your first Code showing the error it is telling you that the if statement is malformed.
It should be of the form:
If (condition, what if true, what if false)

Your second code entry doesn't show the line with that if statement.

As you have included an Any () statement in the if, I would suggest that you have miscounted the brackets and closed the if without including the true/false parameters.

you will need to post that actual line for me to check fully, but you can probably find it yourself if you count the braces.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
QQ problem 22 67
Receiving wifi on an underground station 22 127
Advantages of using Mac Outlook vs Mac Mail 2 48
Partnership Agreement 2 16
Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
Gift cards are not a new concept - it's been around for a very long time.  Undoubtedly, over the past you have received such a card or purchased one for a friend or relative.  Are you aware that you've been feeding the machine?  If not, read on :)
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question